Debian buster downgrade from "Unstable" to "Stable"

New to Debian (Or Linux in general)? Ask your questions here!

Debian buster downgrade from "Unstable" to "Stable"

Postby madsurfer » 2020-03-04 05:48

Hello community!

Some weeks ago, I have installed successfully Wireguard via APT. I have added the Wireguard source (deb http://deb.debian.org/debian/ unstable main) to my sources, but didn't defined any preferences for stable, testing, unstable and experimental branches. Now the preferences has been set.

When the Debian 10.3 got published, I did a dist-upgrade, BUT it seems all my packages have been installed now from the unstable branch and not from the stable branch.

Now my debian install is "Linux 5.4.0-4-amd64 #1 SMP Debian 5.4.19-1 (2020-02-13) x86_64 GNU/Linux".

How to get back to a full stabel branch?

Thanks a bunch!


Here is an apt-extract:

~$ sudo apt list --installed | grep linux

WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

binutils-x86-64-linux-gnu/unstable,now 2.34-4 amd64 [installed,automatic]
console-setup-linux/unstable,now 1.194 all [installed,automatic]
firmware-linux-free/unstable,now 20200122-1 all [installed,automatic]
libselinux1/unstable,now 3.0-1+b1 amd64 [installed]
linux-base/stable,unstable,now 4.6 all [installed,automatic]
linux-compiler-gcc-6-x86/now 4.9.168-1+deb9u3 amd64 [installed,local]
linux-compiler-gcc-8-x86/stable,now 4.19.98-1 amd64 [installed,automatic]
linux-compiler-gcc-9-x86/unstable,now 5.4.19-1 amd64 [installed,automatic]
linux-headers-4.19.0-6-amd64/stable,now 4.19.67-2+deb10u2 amd64 [installed,automatic]
linux-headers-4.19.0-6-common/stable,now 4.19.67-2+deb10u2 all [installed,automatic]
linux-headers-4.9.0-9-amd64/now 4.9.168-1+deb9u3 amd64 [installed,local]
linux-headers-4.9.0-9-common/now 4.9.168-1+deb9u3 all [installed,local]
linux-headers-5.4.0-4-amd64/unstable,now 5.4.19-1 amd64 [installed,automatic]
linux-headers-5.4.0-4-common/unstable,now 5.4.19-1 all [installed,automatic]
linux-headers-amd64/unstable,now 5.4.19-1 amd64 [installed,automatic]
linux-image-4.19.0-6-amd64/stable,now 4.19.67-2+deb10u2 amd64 [installed,automatic]
linux-image-5.4.0-4-amd64/unstable,now 5.4.19-1 amd64 [installed,automatic]
linux-image-amd64/unstable,now 5.4.19-1 amd64 [installed]
linux-kbuild-4.19/stable,now 4.19.98-1 amd64 [installed,automatic]
linux-kbuild-4.9/now 4.9.168-1+deb9u3 amd64 [installed,local]
linux-kbuild-5.4/unstable,now 5.4.19-1 amd64 [installed,automatic]
linux-libc-dev/unstable,now 5.4.19-1 amd64 [installed,automatic]
selinux-utils/unstable,now 3.0-1+b1 amd64 [installed,automatic]
util-linux-locales/unstable,now 2.34-0.1 all [installed,automatic]
util-linux/unstable,now 2.34-0.1 amd64 [installed]
madsurfer
 
Posts: 4
Joined: 2020-03-04 05:31

Re: Debian buster downgrade from "Unstable" to "Stable"

Postby Hallvor » 2020-03-04 08:46

Well, I tried that as an experiment a few months ago. I removed the desktop environment with tasksel to get a small code base. Then I changed sources.list and attempted a downgrade.

Unfortunately, I ran into depenency problems that I was unable to solve.

From the Wiki:

Is it supported?
Short answer: No, it isn't supported.

Long answer: It isn't supported because
The packages' installation scripts (postinst...) are designed to handle upgrade only.
The installation tools are designed to replace older versions of packages by newer versions.


https://wiki.debian.org/SystemDowngrade
Last edited by Hallvor on 2020-03-04 08:49, edited 1 time in total.
Lenovo ThinkPad T440S, Intel Core i7-4600U CPU @ 2.10GHz, 8 GB RAM, 256 GB SSD, Debian Buster (KDE)
Lenovo ThinkPad X240, Intel Core i5-4300U CPU @ 2.90GHz, 8 GB RAM, 120 GB SSD, Debian Buster (KDE)
User avatar
Hallvor
 
Posts: 1061
Joined: 2009-04-16 18:35
Location: Norway

Re: Debian buster downgrade from "Unstable" to "Stable"

Postby fred44nl » 2020-03-04 08:47

to begin with, you will have to correct your sources.list
it should look more or less look like this:

deb http://ftp.nl.debian.org/debian/ buster main contrib non-free
deb http://security.debian.org/debian-security/ buster/updates main contrib non-free
deb http://ftp.nl.debian.org/debian/ buster-updates main contrib non-free


next, you boot your machine with the previous kernel.
and you run the command "sudo apt update", which will update your package lists.

now you can remove all the packages that you have from unstable one by one with the command
"sudo apt remove package-name"
immediately follwed with the command "sudo apt install package-name"

you can check this out with the command "sudo apt policy package-name"
with this command you can see what version is installed, and what version you will get.

may be there is a better and easier way, but this is how I repaired my FrankenDebian back to Debian :)
Debian 10 - Buster on Compulab Fitlet2
User avatar
fred44nl
 
Posts: 186
Joined: 2018-07-14 08:54

Debian buster downgrade from "Unstable" to "Stable"

Postby madsurfer » 2020-03-04 11:35

Thanks Fred44nl for all your infos.

I am a bit nervous to break my install, so will probably wait as my server is stable and not facing internet .

I really get caught like a newbie this time.





Sent from my CLT-L29 using Tapatalk
madsurfer
 
Posts: 4
Joined: 2020-03-04 05:31

Debian buster downgrade from "Unstable" to "Stable"

Postby madsurfer » 2020-03-04 11:36

Hallvor wrote:Well, I tried that as an experiment a few months ago. I removed the desktop environment with tasksel to get a small code base. Then I changed sources.list and attempted a downgrade.

Unfortunately, I ran into depenency problems that I was unable to solve.

From the Wiki:

Is it supported?
Short answer: No, it isn't supported.

Long answer: It isn't supported because
The packages' installation scripts (postinst...) are designed to handle upgrade only.
The installation tools are designed to replace older versions of packages by newer versions.


https://wiki.debian.org/SystemDowngrade
Thanks Hallvor!

Sent from my CLT-L29 using Tapatalk
madsurfer
 
Posts: 4
Joined: 2020-03-04 05:31

Re: Debian buster downgrade from

Postby fred44nl » 2020-03-04 13:01

madsurfer wrote:I am a bit nervous to break my install, so will probably wait as my server is stable and not facing internet .


I do understand :)
but I would modify sources.list all the same.
this prevents you from getting even more packages and/or updates from unstable.
Debian 10 - Buster on Compulab Fitlet2
User avatar
fred44nl
 
Posts: 186
Joined: 2018-07-14 08:54

Re: Debian buster downgrade from "Unstable" to "Stable"

Postby Hallvor » 2020-03-04 13:47

If he ran a dist-upgrade, he is already running Sid. There is no easy way back. Reinstall is the only viable option, as I see it.

OP: If you must have packages from Sid (that may break your system), use apt pinning to prevent a full system upgrade next time.

https://www.howtoforge.com/a-short-intr ... pt-pinning


Edit: If you still want to try:

1. Back up all your important files.

2. Remove your desktop environment (if you have one onstalled with # tasksel) any packages from outside the repository and packages only found in Sid.

3. Then edit your /etc/apt/sources.list. It should look like this.
Code: Select all
deb http://deb.debian.org/debian buster main contrib non-free
deb-src http://deb.debian.org/debian buster main contrib non-free

deb http://deb.debian.org/debian-security/ buster/updates main contrib non-free
deb-src http://deb.debian.org/debian-security/ buster/updates main contrib non-free

deb http://deb.debian.org/debian buster-updates main contrib non-free
deb-src http://deb.debian.org/debian buster-updates main contrib non-free


Save and exit.

4. Edit (for instance with nano /etc/apt/preferences) and put the following content into it. This will give packages from stable higher priority, thus making a downgrade possible:

Code: Select all
Package: *
Pin: release a=stable
Pin-Priority: 1001


Save and exit.

5. Run these commands in this order:
Code: Select all
apt-get update
apt-get upgrade
apt-get dist-upgrade



6. Packages will fail. Purge the failing packages with
Code: Select all
apt-get purge nameofpackages


Then dist-upgrade again, and repeat 6 until there are no errors....
Last edited by Hallvor on 2020-03-04 14:17, edited 11 times in total.
Lenovo ThinkPad T440S, Intel Core i7-4600U CPU @ 2.10GHz, 8 GB RAM, 256 GB SSD, Debian Buster (KDE)
Lenovo ThinkPad X240, Intel Core i5-4300U CPU @ 2.90GHz, 8 GB RAM, 120 GB SSD, Debian Buster (KDE)
User avatar
Hallvor
 
Posts: 1061
Joined: 2009-04-16 18:35
Location: Norway

Re: Debian buster downgrade from "Unstable" to "Stable"

Postby CwF » 2020-03-04 13:50

fred44nl wrote:but I would modify sources.list all the same.

For sure, keep the sources list 'clean'.
As Hallvor suggest a full downgrade of everything just doesn't work, as intended. Anything that can be completely purged and leave a booting system can be downgraded. That leaves a few hundred packages without a path to downgrade. However, if working, don't worry about those, they will come out eventually through attrition if you maintain a single release and repo setting.
I do such experiments with images, so never worry when I need to start over. I might say something is possible, my warning I don't always say is possible on the third try, or fifth!
Overall a full upgrade to the next release should always be considered a one way ticket. What can be done, using fail-safe images and vm's, is to temporarily enable the next release and upgrade confined package groups. Some of those will pull in a few irreversible changes, but we should be able to identify those at this step, like the libc6 tree. When that works, switch back to stable and a handful of packages will show as obsolete and happily live on until a legit upgrade. As I've said, these types of systems don't lend themselves to automated actions that include upgrade all or purge all, etc. It's a manual operation from here on out...
Someday I will restore a 8 pen plotter for C and D size debtree dependency plots, so pretty.
CwF
 
Posts: 654
Joined: 2018-06-20 15:16

Re: Debian buster downgrade from "Unstable" to "Stable"

Postby Head_on_a_Stick » 2020-03-04 17:55

https://www.debian.org/doc/manuals/debi ... owngrading

Remove non-stable packages with
Code: Select all
# aptitude purge $(aptitude search '?narrow(?installed, !?archive(stable))')

But I would just re-install. It's the only way to be sure.
User avatar
Head_on_a_Stick
 
Posts: 11992
Joined: 2014-06-01 17:46
Location: /dev/chair

Re: Debian buster downgrade from "Unstable" to "Stable"

Postby Deb-fan » 2020-03-04 20:52

Yep agree reinstall or restore a backup etc would be easiest move here. Not defining preferences apt is going for highest versions of packages available (esp w something like dist-upgrade) Have seen and looked over a possible method, apt-pinning stable at a value of 1001 or over, that would give those pkgs high enough preference to force downgrade. Never been in a situation I actually tried the method though. Never had to, comes to branch mixing, setting proper preferences is obviously important unless someone wants a mess on their hands.
Deb-fan
 
Posts: 708
Joined: 2012-08-14 12:27

Debian buster downgrade from "Unstable" to "Stable"

Postby madsurfer » 2020-03-04 21:42

Try to downgrade and tada...broken dependencies. I basically can't log on anymore. Check account but nothing is locked.

I have an issue with libcrypt1 not reinstallable :-(

Sent from my CLT-L29 using Tapatalk
madsurfer
 
Posts: 4
Joined: 2020-03-04 05:31

Re: Debian buster downgrade from "Unstable" to "Stable"

Postby Deb-fan » 2020-03-04 22:08

Meant to bring up apt-show-versions package too, easy way to keep track of which packages are installed from where, including backports if someone's using any pkgs from there. Would cut losses, access install, recover any important files, including custom config files and reinstall (just restore backup.) When messing around with this, oopies like this are bound to happen initially. It's major mistake/oversight pebcak. Someone goes to fiddle with sources like that, obviously a great time to make an OS backup with any of the proven backup/restore methods used in gnu/nix.
Deb-fan
 
Posts: 708
Joined: 2012-08-14 12:27

Re: Debian buster downgrade from "Unstable" to "Stable"

Postby stevepusser » 2020-03-05 04:14

Seems like a lot less trouble to backport wireguard, or ask someone to do it for you, IMHO. I just did the Sid version for MX 19 and 17 on vanilla Buster and almost vanilla Stretch (just a newer debhelper in Stretch). The MX packages will work on Debian, https://drive.google.com/open?id=13OT_G ... xqL_na0pii

but they can also be backported on the OBS.

Some packages are impracticable to backport, but I may have the Chromium in Sid figured out for Buster. It just needs a llvm-8 or -9 compiler toolchain that I already had backported and had laying around, and also a backport of libre2-dev from Bullseye,and then a lot of compiling time.
Last edited by stevepusser on 2020-03-07 22:51, edited 1 time in total.
The MX Linux repositories: Backports galore! If we don't have something, just ask and we'll try--we like challenges. New packages: Kodi 18.6, Strawberry 0.6.11, Muse 3.1.0, Chromium with va-api, Audacity 2.4.1, Kdenlive 20.04
User avatar
stevepusser
 
Posts: 11692
Joined: 2009-10-06 05:53

Re: Debian buster downgrade from

Postby Head_on_a_Stick » 2020-03-05 17:37

madsurfer wrote:Try to downgrade and tada...broken dependencies.

Ha ha!

madsurfer wrote:I basically can't log on anymore.

https://www.debian.org/releases/jessie/ ... 07.html.en

madsurfer wrote:I have an issue with libcrypt1 not reinstallable

We might be able to help if we can see the actual APT error messages, use this method to generate a link to ix.io rather than hand-copying them.

But I still think you should re-install.
User avatar
Head_on_a_Stick
 
Posts: 11992
Joined: 2014-06-01 17:46
Location: /dev/chair

Re: Debian buster downgrade from "Unstable" to "Stable"

Postby stevepusser » 2020-03-07 23:02

Feature request: a sound board for this forum!

Maybe aptitude can perform the downgrade, though it doesn't have Super Cow powers. :(
But it does magically downgrade system packages like uuid and libcrypt on my pbuilder tar.gz chroot "seeds" after they've been entangled with newer versions from a MX backports repo, though I've just watched it do that in awe.
The MX Linux repositories: Backports galore! If we don't have something, just ask and we'll try--we like challenges. New packages: Kodi 18.6, Strawberry 0.6.11, Muse 3.1.0, Chromium with va-api, Audacity 2.4.1, Kdenlive 20.04
User avatar
stevepusser
 
Posts: 11692
Joined: 2009-10-06 05:53


Return to Beginners Questions

Who is online

Users browsing this forum: No registered users and 4 guests

fashionable