There are a two things which could cause this. You can find out which by using:
cat /etc/apt/sources.list /etc/apt/sources.list.d/*
- Using a suite instead of a codename:
(1) deb http://ftp.debian.org/debian/ buster main
(2) deb http://ftp.debian.org/debian/ stable main
Line (1)
and (2)
are equivalent today, but they won't always be. One day, stable
will point to bullseye
. When that happens, your machine will automatically change too. If you want control, then use codename buster
. Check for the testing
suite. That switched from buster
to bullseye
on 6 July 2019.
- Multiple distributions:
(1) deb http://ftp.debian.org/debian/ buster main
(2) deb http://ftp.debian.org/debian/ bullseye main
(3) deb http://ftp.debian.org/debian/ testing main
If you have something like what's above, then Debian may see several versions of each package. The latest version of a package will be selected unless you've set APT::Default-Release
in /etc/apt/apt.conf
or explicitly pinned priorities in /etc/apt/preferences.d/
.
The next question is why did your sources.list
have a strange entry? It could be that you've added a line because you wanted the latest version of a package which was only available in bullseye. In that case you may have added the line, apt update
then apt install -t testing some-package
. But the problem is that unless you delete that line and do another apt update
, or add a APT::Default-Release
, you are primed for an upgrade to testing
,
Another option is 3rd party software. It's common for software which doesn't exist in Debian's official archive to give you a *.deb
installer. I've seen *.deb
archives include a custom /etc/apt/sources.list.d/*.list
so that you get updates. It wouldn't be hard for them to say "well I need version X of this dependency, and I know it exists in bullseye, so I'll create a line to add a bullseye repo". It would by sloppy of them, but not impossible.
So how to recover? There are three options at this point:
1: Complete the upgrade - Easiest/quickest
2: Downgrade - Hardest/Least likely to succeed
3: Re-install - Most reliable/Most downtime
To Complete the upgrade, first obviously fix the strange line in your /etc/apt/sources.list[.d/]
. Then:
# Make everything 'bullseye'
sudo sed -i \
-e 's/buster/bullseye/g' \
-e 's/unstable/bullseye/g' \
-e 's/stable/bullseye/g' \
-e 's/testing/bullseye/g' \
-e 's/sid/bullseye/g' \
/etc/apt/sources.list \
/etc/apt/sources.list.d/*
# Upgrade
sudo apt update
sudo apt upgrade
sudo apt dist-upgrade
sudo apt --fix-broken install
sudo apt autoremove
Toggle between upgrade
, dist-upgrade
, --fix-broken install
and autoremove
until apt
finishes successfully everywhere.
To downgrade (and this is likely to fail, I can't stress that enough):
First back everything up. Then, create /etc/apt/preferences.d/buster
:
Package: *
Pin: release n=buster
Pin-Priority: 1001
Then upgrade like we did in step 1
sudo sed -i \
-e 's/bullseye/buster/g' \
-e 's/unstable/buster/g' \
-e 's/stable/buster/g' \
-e 's/testing/buster/g' \
-e 's/sid/buster/g' \
/etc/apt/sources.list \
/etc/apt/sources.list.d/*
# Upgrade
sudo apt update
sudo apt upgrade
sudo apt dist-upgrade
sudo apt --fix-broken install
sudo apt autoremove
Toggle between upgrade
, dist-upgrade
, --fix-broken install
and autoremove
until apt
finishes successfully everywhere.
When you are happy, delete /etc/apt/preferences.d/buster
Best Answer
As indicated by muru, there is a way to get updated packages for Debian 7, through Freexian’s Extended LTS. See also Raphaël Hertzog’s blog post introducing it.
This is a continuation of the Debian 7 LTS, which stopped in May 2018. In the extended LTS, a subset of Debian 7 packages continue to receive support, on
amd64
and possiblyi386
. The subset is determined by the sponsors of the project; to be an extended LTS sponsor, you also have to be a regular LTS sponsor. It is however possible to hitch a ride and use the extended LTS without sponsoring it, the instructions and repository are freely available:Remember to upgrade the kernel too, and set up a local package mirror.
Without becoming a sponsor, this can only be a band-aid and the resulting feeling of security will be misleading. For example, Ghostscript was dropped at the start of September...
(Freexian handles sponsorship and payments. The package maintenance is carried out by Debian developers whose time is paid for by the Extended LTS project.)