Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

Debian buster downgrade from "Unstable" to "Stable"

New to Debian (Or Linux in general)? Ask your questions here!
Post Reply
Message
Author
madsurfer
Posts: 12
Joined: 2020-03-04 05:31

Debian buster downgrade from "Unstable" to "Stable"

#1 Post by madsurfer »

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]

User avatar
Hallvor
Global Moderator
Global Moderator
Posts: 2042
Joined: 2009-04-16 18:35
Location: Kristiansand, Norway
Has thanked: 149 times
Been thanked: 212 times

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

#2 Post by Hallvor »

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.
[HowTo] Install and configure Debian bookworm
Debian 12 | KDE Plasma | ThinkPad T440s | 4 × Intel® Core™ i7-4600U CPU @ 2.10GHz | 12 GiB RAM | Mesa Intel® HD Graphics 4400 | 1 TB SSD

User avatar
fred44nl
Posts: 215
Joined: 2018-07-14 08:54
Has thanked: 1 time

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

#3 Post by fred44nl »

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
Debian 12 - Bookworm on Acer Spin 1

madsurfer
Posts: 12
Joined: 2020-03-04 05:31

Debian buster downgrade from "Unstable" to "Stable"

#4 Post by madsurfer »

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: 12
Joined: 2020-03-04 05:31

Debian buster downgrade from "Unstable" to "Stable"

#5 Post by madsurfer »

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

User avatar
fred44nl
Posts: 215
Joined: 2018-07-14 08:54
Has thanked: 1 time

Re: Debian buster downgrade from

#6 Post by fred44nl »

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
Debian 12 - Bookworm on Acer Spin 1

User avatar
Hallvor
Global Moderator
Global Moderator
Posts: 2042
Joined: 2009-04-16 18:35
Location: Kristiansand, Norway
Has thanked: 149 times
Been thanked: 212 times

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

#7 Post by Hallvor »

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.
[HowTo] Install and configure Debian bookworm
Debian 12 | KDE Plasma | ThinkPad T440s | 4 × Intel® Core™ i7-4600U CPU @ 2.10GHz | 12 GiB RAM | Mesa Intel® HD Graphics 4400 | 1 TB SSD

CwF
Global Moderator
Global Moderator
Posts: 2680
Joined: 2018-06-20 15:16
Location: Colorado
Has thanked: 41 times
Been thanked: 196 times

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

#8 Post by CwF »

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.

User avatar
Head_on_a_Stick
Posts: 14114
Joined: 2014-06-01 17:46
Location: London, England
Has thanked: 81 times
Been thanked: 133 times

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

#9 Post by Head_on_a_Stick »

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.
deadbang

Deb-fan
Posts: 1047
Joined: 2012-08-14 12:27
Been thanked: 4 times

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

#10 Post by Deb-fan »

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.
Most powerful FREE tech-support tool on the planet * HERE. *

madsurfer
Posts: 12
Joined: 2020-03-04 05:31

Debian buster downgrade from "Unstable" to "Stable"

#11 Post by madsurfer »

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

Deb-fan
Posts: 1047
Joined: 2012-08-14 12:27
Been thanked: 4 times

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

#12 Post by Deb-fan »

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.
Most powerful FREE tech-support tool on the planet * HERE. *

User avatar
stevepusser
Posts: 12930
Joined: 2009-10-06 05:53
Has thanked: 41 times
Been thanked: 71 times

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

#13 Post by stevepusser »

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.
MX Linux packager and developer

User avatar
Head_on_a_Stick
Posts: 14114
Joined: 2014-06-01 17:46
Location: London, England
Has thanked: 81 times
Been thanked: 133 times

Re: Debian buster downgrade from

#14 Post by Head_on_a_Stick »

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.
deadbang

User avatar
stevepusser
Posts: 12930
Joined: 2009-10-06 05:53
Has thanked: 41 times
Been thanked: 71 times

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

#15 Post by stevepusser »

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.
MX Linux packager and developer

Post Reply