From 10cbdf88dc7fb68ca2f85dc1c44b776d0009dab5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Pi=C3=A9dallu?= Date: Fri, 1 Nov 2024 12:04:29 +0100 Subject: [PATCH] Add swtichtoStable script --- switchtoStable | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 switchtoStable 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