Skip to content

Commit

Permalink
debian-11.sh: Correctly process raspi.list
Browse files Browse the repository at this point in the history
Signed-off-by: Tobias K <[email protected]>
  • Loading branch information
theCalcaholic committed May 2, 2024
1 parent b0f86cc commit f7aa18f
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions bin/ncp-dist-upgrade.d/debian-11.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,6 @@

set -eu -o pipefail

if grep -R 'raspberrypi.com' /etc/apt/sources.list* > /dev/null
then
echo "WARN: Raspbian system detected!
There have been errors reported when upgrading from Raspbian which are still being worked on.
Please try this command again in some time."
exit 0
fi

new_cfg=/usr/local/etc/ncp-recommended.cfg
[[ -f "${new_cfg}" ]] || { echo "Already on the lastest recommended distribution. Abort." >&2; exit 1; }

Expand Down Expand Up @@ -46,15 +38,16 @@ save_maintenance_mode
# Perform dist-upgrade

apt-get update && apt-get upgrade -y
for aptlist in /etc/apt/sources.list /etc/apt/sources.list.d/php.list /etc/apt/sources.list.d/armbian.list
for aptlist in /etc/apt/sources.list /etc/apt/sources.list.d/{php.list,armbian.list,raspi.list}
do
[ -f "$aptlist" ] && sed -i -e "s/bullseye/bookworm/g" "$aptlist"
done
for aptlist in /etc/apt/sources.list.d/*.list
do
[[ "$aptlist" =~ "/etc/apt/sources.list.d/"(php|armbian)".list" ]] || continue
[[ "$aptlist" =~ "/etc/apt/sources.list.d/"(php|armbian|raspi)".list" ]] || {
echo "Disabling repositories from \"$aptlist\""
sed -i -e "s/deb/#deb/g" "$aptlist"
}
done
apt-get update && apt-get upgrade -y --without-new-pkgs
if is_lxc
Expand Down

0 comments on commit f7aa18f

Please sign in to comment.