1

I run manual updates weekly on my machine / home server.

When I ran the apt update && apt upgrade command, a lot of packages would be updated. I thought it has something to do with the release of buster (my current system should be using stretch), e.g. a lot of security updates or last final release/push to stretch.. Oh boy was I wrong. After several reboots and fixing a few non-working programs because of library version mismatches, my machine presented me with the MOTD containing Debian 10.

That certainly was very weird. My sources indicate this:

# grep ^ /etc/apt/sources.list /etc/apt/sources.list.d/*
/etc/apt/sources.list:#
/etc/apt/sources.list:
/etc/apt/sources.list:# deb cdrom:[Debian GNU/Linux 9.3.0 _Stretch_ - Official amd64 NETINST 20171209-12:10]/ stretch main
/etc/apt/sources.list:
/etc/apt/sources.list:# deb cdrom:[Debian GNU/Linux 9.3.0 _Stretch_ - Official amd64 NETINST 20171209-12:10]/ stretch main
/etc/apt/sources.list:
/etc/apt/sources.list:deb http://ftp.nl.debian.org/debian/ stretch main non-free
/etc/apt/sources.list:deb-src http://ftp.nl.debian.org/debian/ stretch main non-free
/etc/apt/sources.list:
/etc/apt/sources.list:deb http://security.debian.org/debian-security stretch/updates main non-free
/etc/apt/sources.list:deb-src http://security.debian.org/debian-security stretch/updates main non-free
/etc/apt/sources.list:
/etc/apt/sources.list:# stretch-updates, previously known as 'volatile'
/etc/apt/sources.list:deb http://ftp.nl.debian.org/debian/ stretch-updates main non-free
/etc/apt/sources.list:deb-src http://ftp.nl.debian.org/debian/ stretch-updates main non-free
/etc/apt/sources.list:# deb-src [arch=amd64] https://download.docker.com/linux/debian stretch stable
/etc/apt/sources.list:
/etc/apt/sources.list:deb [arch=amd64] https://download.docker.com/linux/debian stretch stable
/etc/apt/sources.list:# deb-src [arch=amd64] https://download.docker.com/linux/debian stretch stable
/etc/apt/sources.list:
/etc/apt/sources.list:deb http://ftp.nl.debian.org/debian stretch-backports main
/etc/apt/sources.list.d/mono-official-stable.list:deb https://download.mono-project.com/repo/debian stable-stretch main
/etc/apt/sources.list.d/mono-official-stable.list.save:deb https://download.mono-project.com/repo/debian stable-stretch main
/etc/apt/sources.list.d/stable.list:deb http://ftp.nl.debian.org/debian/ stable main contrib non-free
/etc/apt/sources.list.d/stable.list:deb-src http://ftp.nl.debian.org/debian/ stable main contrib non-free
/etc/apt/sources.list.d/stable.list:
/etc/apt/sources.list.d/stable.list:deb http://security.debian.org/ stable/updates main contrib non-free
/etc/apt/sources.list.d/stable.list.save:deb http://ftp.nl.debian.org/debian/ stable main contrib non-free
/etc/apt/sources.list.d/stable.list.save:deb-src http://ftp.nl.debian.org/debian/ stable main contrib non-free
/etc/apt/sources.list.d/stable.list.save:
/etc/apt/sources.list.d/stable.list.save:deb http://security.debian.org/ stable/updates main contrib non-free
/etc/apt/sources.list.d/testing.list:# deb http://ftp.nl.debian.org/debian/ testing main contrib non-free
/etc/apt/sources.list.d/testing.list:# deb-src http://ftp.nl.debian.org/debian/ testing main contrib non-free
/etc/apt/sources.list.d/testing.list:
/etc/apt/sources.list.d/testing.list:# deb http://security.debian.org/ testing/updates main contrib non-free
/etc/apt/sources.list.d/testing.list.save:#deb http://ftp.nl.debian.org/debian/ testing main contrib non-free
/etc/apt/sources.list.d/testing.list.save:#deb-src http://ftp.nl.debian.org/debian/ testing main contrib non-free
/etc/apt/sources.list.d/testing.list.save:
/etc/apt/sources.list.d/testing.list.save:#deb http://security.debian.org/ testing/updates main contrib non-free

There is nothing in my sources indicating that my install should be buster. Almost everything points to stretch.

Checking the version indeed point to 10.0:

# cat /etc/debian_version
10.0

Where did it go wrong and why did this happen to me (again, last time was jessie to stretch on a PROD server at work... ugh, bad times!)? I though Debian wouldn't update to a new version on its' own willy-nilly?

Also, how would I fix this weird spaghetti mess and unfrankenstein my Debian install without starting from scratch? I don't care if my install is stretch or buster but I don't want them to mix and most importantly I don't want it to update to a new version when doing regular security updates!

  • 1
    You are using "stable" in your sources.list instead of explicitly "stretch" or "buster" so every time you upgrade, you will get the latest stable, even if its a major release. You shouldn't be frankendebian at this point, just pure buster. – jordanm Aug 4 at 3:29
  • side note: apt is just really awful, not user friendly, and known to bite people in this way... – jordanm Aug 4 at 3:29
3

You have multiple different versions enabled at once in various places.

/etc/apt/sources.list.d/stable.list:deb http://ftp.nl.debian.org/debian/ stable main contrib non-free

This line says you want packages from stable, i.e. buster these days. These "purpose" labels always point to the relevant version: oldstable now refers to stretch, and testing to bullseye.

/etc/apt/sources.list:deb http://ftp.nl.debian.org/debian/ stretch main non-free

This one is explicitly getting packages from stretch, and that doesn't change when a new version appears or when stretch becomes oldstable.

/etc/apt/sources.list.d/mono-official-stable.list:deb https://download.mono-project.com/repo/debian stable-stretch main
/etc/apt/sources.list:deb [arch=amd64] https://download.docker.com/linux/debian stretch stable

These are third-party repositories with packages for stretch specifically. They will have dependencies on mainline stretch packages.

Some of your version mismatches may be because of this mingling (in particular, the upgrade instructions suggest disabling third-party repositories for the duration). The stretch-updates and stretch-backports lines ought to be safe, but I would disable them for upgrades as well. Once you're on buster they will no longer serve a purpose.


Generally, if you don't specifically want upgrades like this, you'll want to have all your sources.list entries tagged to the codename (stretch, buster) rather than the branch label (stable). That way you can choose when you update by changing the key word everywhere it appears, and then follow the upgrade instructions.

At present, this automatic upgrading when a new version is released is exactly what you've asked for, in the top code box from stable.list. That seems to be the entire purpose of stable.list (and the same for the commented lines in testing.list).

The undesirable mixing of versions is a side effect of having both stretch and stable enabled simultaneously, once those were no longer synonymous.

Buster has actually been out for almost a month, so with a weekly update cycle on your end it seems like your mirrors were a bit slow to update, or else this would have happened a few weeks ago. That may also be a concern to follow up on.


For the moment, you won't realistically be able to roll back to stretch and will need to move fully forward to buster. Update both "stretch" and "stable" to "buster" where they appear and consult the upgrade instructions. From the sounds of things you may still be in need of an apt full-upgrade, but could be all the way through the rest.

I would suggest disabling the external repositories for the moment, and setting them up fresh according to their own instructions for buster once the rest of the upgrade is done. It's possible that organisational changes happened between the two such that the upgrade path isn't clean, and that you may want to remove packages installed from them as well and to reinstall them after setting up the new repositories.

For the future, always use the release names in your sources and you won't have this issue.

  • @roaima I believe all the testing lines are commented out – Michael Homer Aug 4 at 8:31
  • Ah So they are. I find the list very hard to read thanks – roaima Aug 4 at 11:13
  • Ah thank you for that. It seems that stable.lst is read anyway (why is it there?) so I commented all entries in there. And in testing too. now my Debian is 100% buster. – Gizmo Aug 4 at 14:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.