You are not logged in.

#1 2016-11-26 21:29:47

tsangares
Member
Registered: 2016-11-26
Posts: 21

[SOLVED] Pacman : Remove all packages after a certain date

Hi all,

I messed up with some driver stuff and need to remove a lot of packages. I can list out all the packages I have installed and when using

pacman -Qi | egrep "Name|Install Date"

For something like:

Name            : xz
Install Date    : Thu Sep  1 19:59:10 2016
Name            : yajl
Install Date    : Sun Oct 16 15:01:32 2016
Name            : yaourt
Install Date    : Sun Oct 16 15:01:32 2016
Name            : zeromq
Install Date    : Fri Nov 25 18:18:36 2016
Name            : zita-alsa-pcmi
Install Date    : Mon Nov 21 14:51:23 2016
Name            : zita-resampler
Install Date    : Mon Nov 21 14:51:23 2016
Name            : zlib
Install Date    : Thu Sep  1 19:59:11 2016

UPDATE: I am using

pacman -Qi | egrep "Name|Install Date" | grep -B 1 "Nov 25"

To get the dates to look like this:

Name            : xdg-utils
Install Date    : Fri Nov 25 18:21:04 2016
--
Name            : xine-lib
Install Date    : Fri Nov 25 18:33:31 2016
--
Name            : xorg-xset
Install Date    : Fri Nov 25 18:21:04 2016
--
Name            : zeromq
Install Date    : Fri Nov 25 18:18:36 2016

How can I tell pacman to remove all things installed in since Nov 25th?

Last edited by tsangares (2016-11-26 21:57:03)

Offline

#2 2016-11-26 21:36:59

tsangares
Member
Registered: 2016-11-26
Posts: 21

Re: [SOLVED] Pacman : Remove all packages after a certain date

I keep figuring it out. I am using

pacman -Qi | egrep "Name|Install Date" | grep -B 1 "Nov 25" | grep "Name" | awk '{print $3}'

To get a list like

apache-ant
boost
clang
cmake
czmq
freeglut
gcc5
glew
glu
gtk2
gtkglext
ilmbase
intel-tbb
java-environment-common
jdk7-openjdk
jre7-openjdk
jsoncpp
libclc
libdc1394
libpgm
libxv
libxvmc
linux-firmware
linux-headers
llvm
opencl-nvidia
opencv
openexr
pangox-compat
videoproto
xdg-utils
xine-lib
xorg-xset
zeromq

And I am putting this in a text document, now I am going to figure out how to put that into pacman.

Offline

#3 2016-11-26 21:37:01

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: [SOLVED] Pacman : Remove all packages after a certain date

expac -Q '%l\t%n' | awk '/2016/&&/Nov 2[5-7]/ {print $NF}'

Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#4 2016-11-26 21:37:37

tsangares
Member
Registered: 2016-11-26
Posts: 21

Re: [SOLVED] Pacman : Remove all packages after a certain date

Thank you @jasonwryan

Offline

#5 2016-11-26 21:39:26

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: [SOLVED] Pacman : Remove all packages after a certain date

Cool. Please remember to mark your thread as [Solved] by editing your first post and prepending it to the title.


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#6 2016-11-26 21:40:56

tsangares
Member
Registered: 2016-11-26
Posts: 21

Re: [SOLVED] Pacman : Remove all packages after a certain date

Well I still need to figure out how to get pacman to remove packages by bulk, once I do that I will post how I did that and mark as solved.

Or maybe it is a better idea to do it by hand.

Last edited by tsangares (2016-11-26 21:41:42)

Offline

#7 2016-11-26 21:43:46

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: [SOLVED] Pacman : Remove all packages after a certain date

pacman -Rds $(command)

There are plenty of examples on the wiki: https://wiki.archlinux.org/index.php/Pa … and_tricks


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#8 2016-11-26 21:56:32

tsangares
Member
Registered: 2016-11-26
Posts: 21

Re: [SOLVED] Pacman : Remove all packages after a certain date

Thank you,

What motivates you to help ignorant people like me?

Are you getting paid or is this out of good will?

Offline

#9 2016-11-26 21:58:52

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: [SOLVED] Pacman : Remove all packages after a certain date

I get paid in tacos.

Every post = .05 taco
Every ban  = 5.0 tacos


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#10 2016-11-27 09:12:48

ngoonee
Forum Fellow
From: Between Thailand and Singapore
Registered: 2009-03-17
Posts: 7,354

Re: [SOLVED] Pacman : Remove all packages after a certain date

jasonwryan wrote:

I get paid in tacos.

Every post = .05 taco
Every ban  = 5.0 tacos

Hey, I don't remember the ban rate being so high!


Allan-Volunteer on the (topic being discussed) mailn lists. You never get the people who matters attention on the forums.
jasonwryan-Installing Arch is a measure of your literacy. Maintaining Arch is a measure of your diligence. Contributing to Arch is a measure of your competence.
Griemak-Bleeding edge, not bleeding flat. Edge denotes falls will occur from time to time. Bring your own parachute.

Offline

#11 2016-11-27 15:29:04

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: [SOLVED] Pacman : Remove all packages after a certain date

ngoonee wrote:
jasonwryan wrote:

I get paid in tacos.

Every post = .05 taco
Every ban  = 5.0 tacos

Hey, I don't remember the ban rate being so high!

It's indexed to post count...  smile


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#12 2016-11-27 15:59:27

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

Re: [SOLVED] Pacman : Remove all packages after a certain date

You can also use expac's timefmt if you don't want awk be able to do just one numeric comparison rather than two regex string matches:

expac -Q --timefmt=%Y%m%d '%l\t%n' | awk '$1 > 20161125 { print $2; }'

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

Offline

Board footer

Powered by FluxBB