You are not logged in.

#1 2016-04-29 17:03:27

schultzter
Member
From: Montreal, QC
Registered: 2012-01-18
Posts: 15
Website

Roll back installations to marked point

Good afternoon...

I've searching whether this has been discussed, here in the forums and on the mailing list, but I'm not finding anything clear.

Essentially, I'm looking for a feature in pacman (or it's tools) to be able to roll back to a given point - i.e.: to un-install or remove what has been installed since a certain point.

What happened was I decided to give i3 window manager a try. It looks very pretty, and works quite nicely, but it just isn't for me. I've done this with other things before, given them a try and then decided they weren't for me. When it's just one package it's no big deal. But when it's several packages with optional dependencies it gets a bit more complicated.

So I'm looking for a way to either mark a point that I can easily come back to (by removing everything installed - not upgraded - since that point). Or be able to add a tag when installing packages and then be able to remove every package associated with that tag.

Is there a pacman tool do this? Is this something that has been discussed before?

Thanks,


Headed for the second star to the right and straight on 'til morning...

  Schultzter

Offline

#2 2016-04-29 17:07:05

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,517
Website

Re: Roll back installations to marked point

Other than something like btrfs snapshots, not really.  But for clarity, you don't actually want to rollback packages, you just want to remove things you've installed.  This should take no more work than installing them did - as long as you use the right pacman flags.  If you installed pkgA pkgB and pkgC to experiment, then you just need to `pacman -Rsn pkgA pkgB pkgC` to get back to where you were.

You could easily parse the pacman log file for anything you've installed since a given date and remove those.  But given the way this question is presented I suspect there is a more basic confusion - likely about using removal flags for pacman like those I mentioned above.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#3 2016-04-29 17:29:55

schultzter
Member
From: Montreal, QC
Registered: 2012-01-18
Posts: 15
Website

Re: Roll back installations to marked point

Good afternoon...

What I'm looking for is a quick and easy way to remove all the packages I installed for a particular reason. If tracking the reason could be integrated into pacman that would be awesome.

Of course I could always keep a text file handy with the things I installed and why they were installed and then grep that.

But to me the tagging solution sounds like the most elegant.

Referring back to the i3 example, I started by installing plain i3wm and it's dependencies. Played around with that for a bit, troubleshot some issues, and eventually installed dmenu. Then I went to bed and didn't get back to my computer for a couple days, when I installed j4-dmenu-desktop. A couple days later I figured I should just stick with Xfce. Now a week later I'm trying to figure out what I need to remove to get rid of my little i3 experiment. There was probably a system upgrade in there too somewhere.

If I could have tagged everything I installed as part of my experiment with "i3try" or such then I could have removed everything I tagged "i3try"


Headed for the second star to the right and straight on 'til morning...

  Schultzter

Offline

#4 2016-04-29 17:51:30

alphaniner
Member
From: Ancapistan
Registered: 2010-07-12
Posts: 2,810

Re: Roll back installations to marked point

But to me the tagging solution sounds like the most elegant.

You can't really judge the elegance of a solution without implementing it. If it's really as simple as you suggest, a wrapper script should suffice. wink


But whether the Constitution really be one thing, or another, this much is certain - that it has either authorized such a government as we have had, or has been powerless to prevent it. In either case, it is unfit to exist.
-Lysander Spooner

Offline

#5 2016-04-29 20:20:06

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,517
Website

Re: Roll back installations to marked point

schultzter wrote:

Referring back to the i3 example, I started by installing plain i3wm and it's dependencies ... and eventually installed dmenu ... I installed j4-dmenu-desktop ... Now a week later I'm trying to figure out what I need to remove to get rid of my little i3 experiment

You need to properly remove only i3wm, dmenu, and j4-dmenu-desktop.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#6 2016-04-30 12:24:12

Lone_Wolf
Member
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 11,911

Re: Roll back installations to marked point

Schultzter, https://bbs.archlinux.org/viewtopic.php?id=201791 is similar to your idea.


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.


(A works at time B)  && (time C > time B ) ≠  (A works at time C)

Offline

#7 2016-05-05 11:10:16

bergersau
Member
Registered: 2012-01-19
Posts: 52

Re: Roll back installations to marked point

@schultzter, perhaps you could try breaking your system like Allan....
http://allanmcrae.com/2011/07/secondary … th-pacman/

He describes how to fudge install flags in pacman to achieve a result similar to what you seem to want.

Offline

#8 2016-05-05 16:42:35

nstgc
Member
Registered: 2014-03-17
Posts: 393

Re: Roll back installations to marked point

While requiring some manual intervention, I think you could generate a list of sorts with the following:

awk '/2016-01-01/,0' /var/log/pacman.log |grep installed |awk '{print $5}'

This example uses January first of this year as an example. It should generate the list you want. There will be some extra bits however.

edit: Instead of "grep installed" it would likely be better to use "egrep "installed|removed"" instead since you also probably would want to reinstall those packages you deleted. In which case you also need to print column 4. That also would allow you to get rid of some of those warnings.

awk '/2016-01-01/,0' /var/log/pacman.log |egrep "installed|removed |awk '{print $4 " " $5}' |grep -v warning

edit2: Oh, ah, one downside is that if the date you use doesn't appear in the log (you don't run pacman everyday) then it will print nothing. hmm

Last edited by nstgc (2016-05-05 16:57:17)

Offline

Board footer

Powered by FluxBB