diff --git a/switchtoStable b/switchtoStable new file mode 100644 index 0000000..b7fb3e7 --- /dev/null +++ b/switchtoStable @@ -0,0 +1,28 @@ +#!/usr/bin/env bash + +cat << EOF +---- +Patching sources.list to disable testing repository... +---- +EOF + +readarray -d '' apt_files < <(find /etc/apt/sources.list /etc/apt/sources.list.d -type f -print0) +for FILE in "${apt_files[@]}"; do + # Remove 'testing' and 'unstable' in lines using the yunohost repo + sed -i 's|^\(deb.*yunohost.org.*\) testing\(.*\)$|\1\2|' "$FILE" + sed -i 's|^\(deb.*yunohost.org.*\) unstable\(.*\)$|\1\2|' "$FILE" +done + +cat << EOF +---- +Running 'apt-get update' +---- +EOF +apt-get update + +cat << EOF +---- +Running 'apt-get dist-upgrade' +---- +EOF +apt-get dist-upgrade -y