Wednesday, March 27, 2024

Living With Linux - How I was able to Switch from Debian Testing to Stable to use Backports

There is a meme in the Linux World.  The Answer is Always Debian

However, there are times where the question is "How will I be frustrated by ancient software today".

I moved from "Stable" to "Testing" about six months ago.  This week I moved back from Testing To Stable. 

People don't often do this, and it is difficult to do gracefully.  In short the way I did it was to use a second computer, install a fresh copy of Debian Stable onto it, then use my backup to put back what I needed.  Both my /home and my programs.

The long form of that is pretty long and nuanced.  The syntax for "backports" is at the bottom of this article.

The scenario was that I had software that got to far out of date because the modern connected world your browser and other software must be absolutely current.  Surf the wrong site and you have viruses infesting you.  Other sites are purposely breaking software you have and you are forced to upgrade to current.

Debian Linux's reputation is rock hard stability.  It does so by very thoroughly testing what they put to get everything safe as of date of issue.  Lawyer's Answer is that a week later in the fast world of the modern internet, you will have to have more modern software to protect yourself.

First I want an Encrypted Hard Drive.  Reason is in case the house gets broken into, the computer goes missing, whatever, you will have the machine, but you won't have my personal information.  My password on the machine is fairly UN-guessable.

Second.  That creates a problem.  To do a secure clone of the hard drive means that the way encryption works, you need a second machine to get the data off of the backup so you can copy it back to wherever you want it.  

Second machine makes things easy.  One machine gives you more difficulty and grief.  I have the old hardware, I'm fine with maintaining two similar but distinct machines.

Third, my "Daily Driver" computer was great, and went through two different upgrades to the actual hardware.  I'm very fortunate to have someone who gives me hand me down laptops that are basically worthless to the organization they work for, and they are expensed.  I repair them, which gives me a "New To Me" computer out of something that does not work.

I fix the broken new machine with parts scavenged, recycle the old one, and while everything is out in the open, I simply put the old hard drive in the new machine and go with it at the end of it all.  Fast, Safe, Secure.

My old install on Debian Testing that I had for about 3 years via multiple computers and multiple updates was now broken.  It was asking for an upgrade and when I did that via "apt update" and "apt upgrade" it killed my install if I forced the upgrade.  After two months of this I decided enough is enough and proceeded after a backup happened and I did it to use backports and in this broad fashion.

First, get a clone of the original Debian Testing hard drive and set it aside.

Second, install the most up to date version of Debian Stable you can find on to a stick and then onto the other similar computer.

I did say nuanced.  All my machines are Thinkpad. with similar hardware, and all are encrypted.  The older one I installed to is over 7 years old with a bad battery which is why I now consider it "parts".

To create the 8gb stick I used 'dd if="MyDebianISO.iso" of=/dev/sdb conv=noerror,sync status=progress' and walked away.  When finished, I booted from that stick on the older computer, installed it.

It takes about 15 minutes on the "old" computer to install Debian.  It's just not worth the time to delve into fixing things at this point.

Third, create a list of markings on the "new" computer that is running Testing.  Run Synaptic, Create a text file of everything installed.  That creates a problem where the programs that are broken will break the install on the new machine.  To find them, sort the markings and hunt.  Delete what you do not need, and import it into Synaptic on the old, Stable install.

Sorry, I can't be more specific than that since your needs are different than mine, but the sort command is simple.  Assuming you have marks.txt as your input, marks_sorted.txt as output:  cat marks.txt | sort > marks_sorted.txt

Get that file to the Stable machine and import your marks_sorted.txt after deleting anything you do not want into Synaptic there.  Then verify you don't have a broken install, and update the Stable computer

I verified my install, rebooted the computer a couple times and verified I was up to date.  

Result was now my computer now had a "clean" version of Stable up to date.  I swapped hard drives with the newer hardware because it was marginally faster with a fresh battery in it, and rebooted there.  Everything worked.

Except my Firefox was the older one, and yt-dlp was not working in some situations.  After all, you sometimes want to listen to media offline, especially as an endurance athlete like I am.

That required two different fixes.

Firefox - I went with the version in www.flathub.org instead of going with the one in mozilla.  It's said to be current.  Same with Librewolf.  I use one for "my surfing" the Librewolf for emails and (unfortunately) facebook.  In my mind along with my own /etc/hosts file,  it keeps the garbage ads and spying by the sites down.

yt-dlp was demanding that I went to backports to do an update.  This is the point of all this text.

Backports.  

Determine that /etc/apt/sources.list has backports enabled.
I had these lines at the bottom of my sources.list file:

# Backports allow you to install newer versions of software made available for this release
deb http://deb.debian.org/debian/ bookworm-backports main non-free-firmware
deb-src http://deb.debian.org/debian/ bookworm-backports main non-free-firmware

To use Backports to update, you only update a SINGLE program.  apt will grab what it needs to keep you up to date (I hope) so you aren't missing any dependencies.

apt update
apt upgrade "NeededPackageName"/bookworm-backports

In my specific case:  apt upgrade yt-dlp/bookworm-backports


No comments:

Post a Comment