howto commandline package rollback from logged console spew?

Archived topics about LMDE 1
Forum rules
Locked
TomRoche
Level 4
Level 4
Posts: 248
Joined: Thu Jan 13, 2011 2:52 pm

howto commandline package rollback from logged console spew?

Post by TomRoche » Tue Nov 17, 2015 2:22 am

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?

kevinthefixer
Level 4
Level 4
Posts: 274
Joined: Thu Jul 23, 2015 10:36 pm

Re: howto commandline package rollback from logged console s

Post by kevinthefixer » Tue Nov 17, 2015 9:40 am

Maybe easier to do a clean install?

TomRoche
Level 4
Level 4
Posts: 248
Joined: Thu Jan 13, 2011 2:52 pm

trying to "be nice"

Post by TomRoche » Wed Nov 18, 2015 12:23 am

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
Level 3
Level 3
Posts: 107
Joined: Wed Dec 07, 2011 2:46 pm
Location: the 919

Re: howto commandline package rollback from logged console s

Post by bigbenaugust » Wed Nov 18, 2015 1:28 pm

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

TomRoche
Level 4
Level 4
Posts: 248
Joined: Thu Jan 13, 2011 2:52 pm

Re: howto commandline package rollback from logged console s

Post by TomRoche » Wed Nov 18, 2015 11:44 pm

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
Level 3
Level 3
Posts: 107
Joined: Wed Dec 07, 2011 2:46 pm
Location: the 919

Re: howto commandline package rollback from logged console s

Post by bigbenaugust » Thu Nov 19, 2015 10:28 am

That would be a lovely bit of scripting. :)
--Ben

Locked

Return to “LMDE 1 Archive”