howto commandline package rollback from logged console spew?

Archived topics about LMDE 1 and LMDE 2
Locked
TomRoche

howto commandline package rollback from logged console spew?

Post by TomRoche »

summary: Suppose one does a commandline update of one's packages and captures console spew like

Code: Select all

Get: 1 http://packages.linuxmint.com/ betsy/import firefox amd64 41.0.1~linuxmint1+betsy [43.5 MB]
...
Preparing to unpack .../firefox_41.0.1~linuxmint1+betsy_amd64.deb ...
Unpacking firefox (41.0.1~linuxmint1+betsy) over (39.0~linuxmint1+betsy) ...
then decides one needs to reverse the update. For the above example, what is the appropriate commandline syntax to rollback package='firefox' from version='41.0.1~linuxmint1+betsy' back to version='39.0~linuxmint1+betsy' ?

details:

I currently have 3 laptops running LMDE2/Betsy. When there are "big updates" like the last kernel update, I update them from {oldest, Xfce, least used} to {newest, Cinnamon, production}. ~2 months ago I started the last Big One, and my oldest laptop updated with no problems. Unfortunately my {middle, MATE, main backup} box

1. did not update cleanly (more below).

2. did not have the latest version of my backup scripts, which do stuff like

Code: Select all

dpkg --get-selections > "${PACKAGE_LIST_FILEPATH}"
sudo cp -R /etc/apt/sources.list* "${REPO_BACKUP_DIR}/"
sudo apt-key exportall > "${REPO_KEYS_FILEPATH}"
rsync --progress /etc "${ETC_BACKUP_DIR}"
So when I rebooted it and

1. got a good {mdm, GINA, graphical login} with the happy-landscapes slideshow, from which I successfully logged in (as normal)

2. screen went black with mouse icon in middle (as normal)

3. after a few seconds, I got full-screen white except for icon=unhappy-face-monitor, button='Log Out', and text=

Code: Select all

Oh no! Something has gone wrong.

A problem has occurred and the system can't recover.
Please log out and try again
I first tried log-cycling, then power-cycling, then thought, "Sweet! Time to try out my new package-restore code," then realized that I hadn't done package backup on that box :-( However I *did* (as usual) save the console spew from my commandline update, so I'm pretty sure I know the names and versions of all packages that were added, updated, or removed ... I just can't do a programmatic bulk restore.

So how to rollback individual packages like that given in the summary example above?
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
kevinthefixer
Level 4
Level 4
Posts: 280
Joined: Thu Jul 23, 2015 10:36 pm

Re: howto commandline package rollback from logged console s

Post by kevinthefixer »

Maybe easier to do a clean install?
TomRoche

trying to "be nice"

Post by TomRoche »

TomRoche wrote:Suppose one does a commandline update of one's packages and captures console spew like

Code: Select all

Get: 1 http://packages.linuxmint.com/ betsy/import firefox amd64 41.0.1~linuxmint1+betsy [43.5 MB]
...
Preparing to unpack .../firefox_41.0.1~linuxmint1+betsy_amd64.deb ...
Unpacking firefox (41.0.1~linuxmint1+betsy) over (39.0~linuxmint1+betsy) ...
then decides one needs to reverse the update.
kevinthefixer wrote:Maybe easier to do a clean install?
Note that one is not an idiot, therefore one knows

1. that a full install is an option ... except that it would need to be followed by recreating all the many tweaks that go into making a productive workstation out of a generic install. Therefore one wants to reject that option in favor of the original proposal, if feasible.

2. how nice it would have been to have done an image backup before the update. But one also knows time travel is impossible.
bigbenaugust

Re: howto commandline package rollback from logged console s

Post by bigbenaugust »

I notice that apt, apt-get, and aptitude have no option to roll back.

BUT there is this: http://linuxg.net/downgrade-package-in- ... nd-debian/, in which you specify a version for the package explicitly. You could specify the old versions from your update output.

If you were using btrfs, you could do a snapshot before the updates and then revert if things went sideways and then hold the packages at their current versions for a while. But that will not help you now. openSUSE does this by default now.
TomRoche

Re: howto commandline package rollback from logged console s

Post by TomRoche »

bigbenaugust wrote:http://linuxg.net/downgrade-package-in- ... nd-debian/ [show that `aptitude` and `apt-get` allow one to] specify a version for the package explicitly.
Thanks! I'll shortly attempt to make use of that manually, and later to incorporate that into an automation.
bigbenaugust

Re: howto commandline package rollback from logged console s

Post by bigbenaugust »

That would be a lovely bit of scripting. :)
Locked

Return to “LMDE Archive”