Author Topic: Roll back feature, an automatic downgrade option?  (Read 3476 times)

0 Members and 1 Guest are viewing this topic.

Offline Strandvaskeren

  • Jr. Mitglied
  • **
  • Posts: 60
  • Skill: Novice
Roll back feature, an automatic downgrade option?
« on: 21. April 2016, 08:55:27 »
It's been a while since I had to downgrade anything, normally everything works just fine. Last time were a year ago or so, some intel graphics driver issue where I had to roll back to an older driver a couple of times after doing general upgrades.

It's awesome that the system keeps a cache of older versions and allowing you to downgrade at all, all thumbs up - however it's not always easy to figure out which package to downgrade if your system gets messed up.

Once in a while pamac tells me it has 52 new upgrades. I prefer using yaourt for the job but that's besides the point. I do the upgrade and as I said, normally everything keeps working just fine. But in those rare cases where it doesn't it would be awesome to have a function to roll back those 52 new upgrades.

Now I could just do a ls -ltr on /var/cache/pacman/pkg and start using yaourt -U on everything from today but it can be quite a lot of work.

Ideally I should dig into which package is the culprit and do a bug report, but that isn't always in the cards time wise.

Is there any sneaky command that lets me just roll back all "todays" upgrades, getting me back to "yesterdays" version that worked?

Offline handy

  • Global Moderator
  • *****
  • Posts: 5738
  • Desktop: Openbox 3.6.1-3 & Worker :)
  • GPU Card: intel...
  • GPU driver: open-source
  • Kernel: OpenBSD
  • Skill: Intermediate
Re: Roll back feature, an automatic downgrade option?
« Reply #1 on: 21. April 2016, 13:43:59 »
Surely some smart script writer must have created a script where you can enter a date/time & have pacman/yaourt downgrade all of the packages since that date & time. Someone could even stick a GUI in front of such a script & make it fancy too.

Hasn't this been done yet?

I personally don't know as I usually go beyond a year between ever having to downgrade a package or packages. So such a tool is of no value to me.
The ultimate tyranny in a society is not control
by martial law. It is control by the psychological
manipulation of consciousness, through which reality
is defined so that those who exist within do not even
realize that they are in prison.
  —  Barbara Marciniak

Offline excalibur1234

  • Global Moderator
  • *****
  • Posts: 2508
  • Branch: unstable
  • Desktop: net-minimal + LXQt
  • GPU driver: video-nouveau
  • Kernel: 4.6
  • Skill: Intermediate
Re: Roll back feature, an automatic downgrade option?
« Reply #2 on: 21. April 2016, 13:50:59 »
Is there any sneaky command that lets me just roll back all "todays" upgrades, getting me back to "yesterdays" version that worked?
i do not know about something like that.


i always downgrade using the following commands. in most cases, i have a rough idea which packages could be the cause for a system breakage and which packages are harmless:


"tail -2000 /var/log/pacman.log"
This command displays the last 2000 lines of your Pacman Log.
The Pacman Log contains all updates, installations, and removals (also in the AUR) you have done. Whenever something breaks on your system (e.g. after an udpate), but you do not remember anymore which packages were changed recently (e.g. during the update), take a look at your Pacman Log and find out. Then, DOWNGRADE PACKAGES, which you think might be broken.
Navigate the list with your Mouse Wheel or SHIFT + PageUp.


"downgrade <PACKAGE NAME>"
Manjaro uses a rolling release development model. This means ALL packages on your system continuously get updated to the latest version. If the latest version of a packages does not work on your system, you can downgrade that package to an earlier, working version.
This command downgrades <PACKAGE NAME> and offers you a list of old <PACKAGE NAME> versions to choose from. This list includes all old <PACKAGE NAME> versions from your package cache and online sources (if you have a working internet connection).

After a successful downgrade, you can add <PACKAGE NAME> to your ignore list. This will prevent Pacman from showing any available updates for <PACKAGE NAME>. Remove <PACKAGE NAME> from your ignore list with CONFIGURE PACMAN.
Alternatively, you can run future updates with the command "sudo pacman -Syu --ignore <PACKAGE NAME>" until a fixed version of <PACKAGE NAME> gets released.


"sudo $EDITOR /etc/pacman.conf"
This command opens pacman settings file in your terminal text editor. This lets you configure various options, like what command is used to download packages, what repositories are used and what packages are ignored.


source: https://github.com/Manjaro-Pek/pacli/blob/master/pacli.help
Need more information? Search here:   Manjaro Forum   |   Manjaro Wiki   |   Arch Wiki

Offline eugen-b

  • Support Team
  • ****
  • Posts: 3191
  • Branch: testing
  • Desktop: LXDE, Fluxbox, JWM, LXQt, bspwm
  • GPU Card: Intel 82945G/GZ
  • GPU driver: free
  • Kernel: 4.5, 4.6
  • Skill: Intermediate
Re: Roll back feature, an automatic downgrade option?
« Reply #3 on: 21. April 2016, 14:35:33 »
Install on a filesystem which allows making snapshots like btrfs
But all this holding back cannot be a long term solution on a rolling release distro.
I, for instance, would like to keep libreoffice 4.4.7, but I need to hold back icu and harfbuzz-icu, but then I cannot start atril anymore (didn't figure out what package I need to hold back yet, probably poppler and poppler-glib).
« Last Edit: 21. April 2016, 14:49:23 by eugen-b »
MSI Wind Nettop, Intel Atom 230 1.6GHz (64bit), 2GB RAM
DEs: NET-minimal + (LXDE / Fluxbox / JWM); LXQt OpenRC
how to install on btrfs subvolumes
http://manjaro.github.io/donate/

Offline handy

  • Global Moderator
  • *****
  • Posts: 5738
  • Desktop: Openbox 3.6.1-3 & Worker :)
  • GPU Card: intel...
  • GPU driver: open-source
  • Kernel: OpenBSD
  • Skill: Intermediate
Re: Roll back feature, an automatic downgrade option?
« Reply #4 on: 21. April 2016, 14:41:43 »
I agree with excalibur  in that when there is a problem the looks like I need to downgrade one or more packages, I try to pick the most likely culprit. If this isn't obvious then looking at the Manjaro forum, asking a question in the forum, &/or having a look at the Arch forum (if appropriate) should provide the information that you need. If you have lost your internet connection due to the problem at hand, that may make it easier to identify the package that needs to be downgraded.

If you can't pick the package out, then downgrade all of them that have arrived since your machine was working correctly.

I use something along these lines:

The comments in the .bashrc alias section are well worth a read.
The ultimate tyranny in a society is not control
by martial law. It is control by the psychological
manipulation of consciousness, through which reality
is defined so that those who exist within do not even
realize that they are in prison.
  —  Barbara Marciniak

Offline fassil

  • Support Team
  • ****
  • Posts: 709
  • Branch: stable/unstable
  • Desktop: E19/E20
  • GPU driver: free
  • Kernel: Linux314 & 318
  • Skill: Intermediate
Re: Roll back feature, an automatic downgrade option?
« Reply #5 on: 21. April 2016, 15:26:29 »
'LLo,

Maybe, it could be one or two additional buttons "downgrade" & "downgrade all" in the bottom field (Installed packages) of octopi-cachecleaner wihen "keep" is configured at least to 1...
« Last Edit: 21. April 2016, 15:32:46 by fassil »
"Are you enlightened ?"

Offline Strandvaskeren

  • Jr. Mitglied
  • **
  • Posts: 60
  • Skill: Novice
Re: Roll back feature, an automatic downgrade option?
« Reply #6 on: 23. April 2016, 16:35:26 »
But all this holding back cannot be a long term solution on a rolling release distro.
I absolutely agree, it's only for those "Poop, I don't have the time to deal with this right now, let me roll back, wait a couple of days for a fix and try upgrading again"-situations.

I agree with excalibur  in that when there is a problem the looks like I need to downgrade one or more packages, I try to pick the most likely culprit. If this isn't obvious then looking at the Manjaro forum, asking a question in the forum, &/or having a look at the Arch forum (if appropriate) should provide the information that you need. If you have lost your internet connection due to the problem at hand, that may make it easier to identify the package that needs to be downgraded.
I do the same. Popping the error message into google and ask it only to show results from the last week or so normally queues you right in on the culprit.

Basically I just need to remember not to upgrade when I've got limited time or I'm tired. I can't go to sleep with a broken system and if I upgrade in the morning my day goes in the crapper if I know that I have to get home and fight the problem after work..

Offline handy

  • Global Moderator
  • *****
  • Posts: 5738
  • Desktop: Openbox 3.6.1-3 & Worker :)
  • GPU Card: intel...
  • GPU driver: open-source
  • Kernel: OpenBSD
  • Skill: Intermediate
Re: Roll back feature, an automatic downgrade option?
« Reply #7 on: 24. April 2016, 02:42:14 »
If you have the desire to, you can make a rolling backup of whatever part of your system that you want to, like the fabled OS/X Time machine (not that they invented such a thing, they just made it famous amongst the plebs).

There is more than one thread on the topic in existence here. I've mentioned a very good GUI application for the job, (there is more than one i.e. grsync is a very good too) called LuckyBackup.

Also, if you want to get your hands dirty with rsync (what most of the sys' admin's use, & what would have inspired the OS/X people to make Time machine), then you will find the fastest most customisable way to organise your system backups.

Here's a simple script to play with: ;)

Code: [Select]
#!/bin/sh

## This does a good job (quicker than GUI rsync based backup app's)
## backs-up in the "time machine" style if one uses cron to have it recur.

date=`date "+%Y-%m-%dT%H:%M:%S"`
rsync -aP --link-dest=/mnt/backup.handy/backups/current /home/handy /mnt/backup.handy/backups/back-$date
rm -f /mnt/backup.handy/backups/current
ln -s back-$date /mnt/backup.handy/backups/current

Copy & paste the above script to your editor, then modify the following two lines to suit your system's directory structure & your desired backup directory(s):

Code: [Select]
rsync -aP --link-dest=/mnt/backup.handy/backups/current /home/handy /mnt/backup.handy/backups/back-$date
& this line:

Code: [Select]
rm -f /mnt/backup.handy/backups/current
Give the file a name, save it & then make it executable.

After that you can test it & play with it so you can get to know what is going on. If it suits your needs you can have multiples of this file being automatically run by cron at hourly, daily, weekly & monthly intervals. Which is quite easily done by dropping the files into the appropriate /etc/cron.* directories (they are VERY obvious when you have a look into the /etc directory.

I've looked into the backup problem from time to time over the years & used grsync for a bit. In my most recent search & study, the best I could come up with (I know others will disagree & that's fine) were rsync & LuckyBackup. rsync wins in speed & configurability, LuckyBackup may(?) win on ease of use. I say may, as once someone gives you a script like I have above for rsync, it gets a whole lot easier.

The above script in combination with cron (or the likes) will supply a rolling backup where you have so much more control than the OS/X Time machine users do. You can choose multiples of what to backup & how often to do it & where to put them.

There is a man page for rsync, & lots of web pages with how-to's & the like. I'm no master of rsync, so if you use the above script you'll have to ferret out the answers to any questions from someone else.

Good luck. ;)
The ultimate tyranny in a society is not control
by martial law. It is control by the psychological
manipulation of consciousness, through which reality
is defined so that those who exist within do not even
realize that they are in prison.
  —  Barbara Marciniak

Offline badbodh

  • Held Mitglied
  • *****
  • Posts: 923
  • Windows assumes I'm stupid, Linux proves it.
  • Branch: Testing
  • Desktop: Xfce, i3
  • GPU Card: Intel Mobile 4 Series
  • Kernel: linux41 64-bit
  • Skill: Intermediate
Re: Roll back feature, an automatic downgrade option?
« Reply #8 on: 24. April 2016, 04:02:26 »
Well. Everybody pretty much covered everything. The only thing left for me to do is point out how people use the word "automatic" when they actually mean "i don;t know how to do it". Just ask mate .

Just kidding. On a more serious note downgrading never works as intended . Ok, you downgrade something. But it breaks dependency of another update, you will have to ignore that update too, and a few others. Days pass by, you decide to install something from the repo - Boom! You can;t, not without catching up with -ALL- those updates you ignored before. And your "downgraded" package needs to be updated too, or you break your system.

Downgrading is dirty business, and "automating" a dirty business is like giving a blind man a grenade launcher. -1 vote from me.
You can't feel the love till it hurts a little. Go rolling, go bleeding-edge !

Offline mandog

  • Held Mitglied
  • *****
  • Posts: 1921
  • Architect Forum And G+ Forum Owner With Daniel S
  • Branch: All
  • Desktop: Gnome, Mate, E19, Openbox,FLuxbox,Budgie, XFCE openRC,
  • GPU Card: nvidia
  • GPU driver: Non Free
  • Kernel: latest
  • Skill: Advanced
Re: Roll back feature, an automatic downgrade option?
« Reply #9 on: 24. April 2016, 05:27:18 »
So get this right you decide to use a bleeding edge rolling release that you have not got a clue how to manage then, you want someone to make a app to roll it back when you f###k it up because you don't know and don't want to learn how to fix it.
@badboth i Tototally agree with your statement,
Downgrading is dirty business, and "automating" a dirty business is like giving a blind man a grenade launcher. -1 vote from me.
A ENGLISHMAN IN PERU
I'm dyslexic Please do not complain about punctuation or spelling,
FANBOY,Taken from the urban dictionary
 A pathetic insult often used by fanboys themselves to try and put down people who don't like whatever it is they like.

Offline Strandvaskeren

  • Jr. Mitglied
  • **
  • Posts: 60
  • Skill: Novice
Re: Roll back feature, an automatic downgrade option?
« Reply #10 on: 25. April 2016, 07:19:41 »
Mandog, I like how you start your post by writing "So get this right" and then get everything wrong. Nice troll attempt.

Badbodh, excellent point, forgot about the dependency thing.

Thanks to all of you for your input.

Offline tjanpool

  • Neuling
  • *
  • Posts: 8
  • Branch: unstable
  • Desktop: Gnome
  • Kernel: linux4.1-x64
  • Skill: Intermediate
Re: Roll back feature, an automatic downgrade option?
« Reply #11 on: 25. April 2016, 08:06:18 »
Well, actually I like the idea of being able to jump back after walking against a wall, or in cases in where we have no knowledge at all, because we morons are not that experiences.
It is nice to be able to rewind to the moment you where running of a cliff. Just to see how deep it is.
After a huge rewind with the packages, it maybe is a nice way to fidle arround and to debug how far you can jump before you actually fall back in the cliff again. Keeping downgrading
is indeed not a good idea. It maybe is throwing more dynamite in the cliff. How cares, we learn we reinstall our OS, jump happy of that cliff again with a touch, without the dynamite
of course next time. Just let us stupid dogs slowly figure out what that strange shiny thing is in front of us.
It is not a bug, it's a feature. No wait it's a window, No a mirror. Where is that dam log what tells us what that f*** in front of us is. So +1 vote from this moron.
Didn't know that we had to vote by the way.

That some people like to run in the hamster wheel as it was envisioned,
doesn't mean that hamsters are not allowed to run on top of it or underneath it.
Effect is the same. Hamster have nice exercising and round and round goes the wheel.

Offline fassil

  • Support Team
  • ****
  • Posts: 709
  • Branch: stable/unstable
  • Desktop: E19/E20
  • GPU driver: free
  • Kernel: Linux314 & 318
  • Skill: Intermediate
Re: Roll back feature, an automatic downgrade option?
« Reply #12 on: 25. April 2016, 11:44:03 »
'LLo,

I thought one of the goal of Manjaro was "user-friendliness" with regard to arch. Then, temporarely & exceptionnaly downgrade a full update which doesn't works fine to keep/refind an operational system in waiting for something else (but without any package ignored durably) sounds obvious, imho...
So, +1 with the moron, too  ;)
"Are you enlightened ?"

Offline viking

  • Sr. Mitglied
  • ****
  • Posts: 346
  • Branch: Unstable
  • Desktop: XFCE
  • GPU Card: Intel HD3000
  • GPU driver: Free
  • Kernel: Whichever is the latest
  • Skill: Intermediate
Re: Roll back feature, an automatic downgrade option?
« Reply #13 on: 25. April 2016, 12:17:03 »
Another +1 for the OP from me.

Surprised at the attitudes of some contributors here, rollback is the obvious, and in my case, first choice to any breakage that I cant fix in the time scale available to me (or can't fix at all maybe ? ) . RPM has had the function for years https://access.redhat.com/solutions/29617  and note that this page comes from Red Hat, a distro well known for its server presence many installations of which are looked after by qualified sysadmins. So if they aren't scoffing at the idea then I see no reason why Manjaro members should either. Arch Linux - yes of course their members would scoff at it, the 'Arch Way' imho has always meant "If you can't understand what we are saying we don't want to know you" That is why I have tried Arch and rejected it (although I would be the first to admit their wiki is a very good information source). Please don't import their unmpleasant superiority here.

Perhaps because I came very late into the world of computers (I was 40 years old before I even saw one) I can empathize with newcomers to this alien world with its strange incomprehensible language, whereas people brought up with computers since they were born may find difficulty with this, but scoffing at ideas which are simple, safe, sensible and already in use in the mainstream computing world is a sad reflection on the hostility newcomers sometimes face.
Fujitsu Lifebook AH532 laptop. Intel i5 processor, 16Gb ram, Intel HD3000 graphics, Intel Audio/wifi, Mint17, Ubuntu1404, Manjaro, all Xfce4.

Offline artoo

  • OpenRC Team
  • ****
  • Posts: 2373
  • Branch: Unstable
  • Desktop: LXQT/Plasma5, openrc & eudev
  • Kernel: x86_64
  • Skill: Advanced
Re: Roll back feature, an automatic downgrade option?
« Reply #14 on: 25. April 2016, 12:24:39 »
People who want to rollback need to be aware they are using a rolling distro.
Previous version packages are usually not kept, but on manjaro, this can be and is done with the branches.

So, except for stable, manjaro in fact has already rollback, in form of branches.

Rollback within a branch is not possible or likely, same as on arch linux, since the repo always contains the latest version of a given package.

Info how to get a previous package can be found here:
https://wiki.archlinux.org/index.php/Arch_Linux_Archive
« Last Edit: 25. April 2016, 12:26:57 by artoo »