You are not logged in.

#1 2010-06-27 19:30:14

Nibble
Member
Registered: 2009-09-29
Posts: 34

Removed /usr/lib

Hello!
I accidentally removed /usr/lib from my system. I got my hands on enough files to get pacman working again(thankfully). But now I need to reinstall every package on my computer to make sure that each and every file exists that needs to exist.

This has to be done before I reboot so I do not miss any critical files.

Any suggestions? Installing them manually will take a long, long time.

Offline

#2 2010-06-27 19:37:42

Ogion
Member
From: Germany
Registered: 2007-12-11
Posts: 367

Re: Removed /usr/lib

I didn't have this case yet, but maybe try the pacman -k opption (check if given package is missing files, if no package specified checks all, is what the manpage says) to see which packages are affected?

Ogion


(my-dotfiles)
"People willing to trade their freedom for temporary security deserve neither and will lose both." - Benjamin Franklin
"Enlightenment is man's leaving his self-caused immaturity." - Immanuel Kant

Offline

#3 2010-06-27 19:50:55

V for Vivian
Member
Registered: 2009-04-28
Posts: 52

Re: Removed /usr/lib

Never done this before. You could grab a list of all packages with

pacman -Qs | grep local | cut -d'/' -f2 | cut -d' ' -f1 > installed_packages

and then reinstall them with

sudo pacman -S `cat installed_packages`

But this would fail if there are packages installed which are from the AUR. They should be removed from the list somehow.


YES WE CAN
(but that doesn't necessarily mean we're going to)

Offline

#4 2010-06-27 19:52:20

loafer
Member
From: the pub
Registered: 2009-04-14
Posts: 1,772

Re: Removed /usr/lib

There's a forum post or wiki article which describes soemthing like this:

 comm -13 <(pacman -Qmq | sort) <(pacman -Qq | sort) > ~/pkglist

then

 cat pkglist | xargs pacman -S --needed --noconfirm

Please do a forum search before trying this as I don't remember where I first found it.


All men have stood for freedom...
For freedom is the man that will turn the world upside down.
Gerrard Winstanley.

Offline

#5 2010-06-27 19:53:05

Nibble
Member
Registered: 2009-09-29
Posts: 34

Re: Removed /usr/lib

Thanks!
That worked, but there are still lots and lots of packages, any idea how to reinstall all these?

Didn't see previous post when I posted this one. Will look into that.

Last edited by Nibble (2010-06-27 19:55:16)

Offline

#6 2010-06-27 20:00:18

loafer
Member
From: the pub
Registered: 2009-04-14
Posts: 1,772

Re: Removed /usr/lib

You can list your aur packages with "pacman -Qqm".  Hope this helps.


All men have stood for freedom...
For freedom is the man that will turn the world upside down.
Gerrard Winstanley.

Offline

#7 2010-06-27 20:00:40

xduugu
Member
Registered: 2008-10-16
Posts: 292

Re: Removed /usr/lib

It's also a good idea to run

pacman -Qk | grep ^warning:

as root.

Offline

#8 2010-06-27 20:03:10

Nibble
Member
Registered: 2009-09-29
Posts: 34

Re: Removed /usr/lib

Seems to be working now, will wait for reboot until I mark it solved.

Offline

#9 2010-06-27 20:39:57

andresp
Member
Registered: 2010-05-29
Posts: 62

Re: Removed /usr/lib

loafer wrote:

There's a forum post or wiki article which describes soemthing like this:

 comm -13 <(pacman -Qmq | sort) <(pacman -Qq | sort) > ~/pkglist

then

 cat pkglist | xargs pacman -S --needed --noconfirm

hmm

No sort,

 LC_ALL=C comm -23 <(pacman -Qq) <(pacman -Qmq)

No cat,

xargs pacman -S --needed --noconfirm < pkglist

And pacman doesn't have ARG_MAX,

pacman $(for i in {1..999}; do echo -h; done)

so no xargs either.

pacman -S --needed --noconfirm $(< pkglist)

Offline

#10 2010-06-27 20:58:47

loafer
Member
From: the pub
Registered: 2009-04-14
Posts: 1,772

Re: Removed /usr/lib

andresp wrote:
loafer wrote:

There's a forum post or wiki article which describes soemthing like this:

 comm -13 <(pacman -Qmq | sort) <(pacman -Qq | sort) > ~/pkglist

then

 cat pkglist | xargs pacman -S --needed --noconfirm

hmm

No sort,

 LC_ALL=C comm -23 <(pacman -Qq) <(pacman -Qmq)

No cat,

xargs pacman -S --needed --noconfirm < pkglist

And pacman doesn't have ARG_MAX,

pacman $(for i in {1..999}; do echo -h; done)

so no xargs either.

pacman -S --needed --noconfirm $(< pkglist)

which is why I said:

loafer wrote:

Please do a forum search before trying this as I don't remember where I first found it.

Please quote in it's entirety.

Last edited by loafer (2010-06-27 21:01:54)


All men have stood for freedom...
For freedom is the man that will turn the world upside down.
Gerrard Winstanley.

Offline

Board footer

Powered by FluxBB