You are not logged in.

#1 2006-02-12 16:56:32

lessthanjake
Member
From: Norway
Registered: 2005-11-09
Posts: 319
Website

I did a $ rm -r /var/lib/pacman/*

Don't ask me way smile But I think it was a bad idea!! Is there a smart way to recover my system. Reinstalling all my packages will do, but then I will probably forget some some.

Offline

#2 2006-02-12 19:09:58

iKevin
Member
From: Ann Arbor, MI
Registered: 2003-07-20
Posts: 132

Re: I did a $ rm -r /var/lib/pacman/*

Hi There

You could look in /var/log/pacman.log to get a history of packages installed.  grep for "install" and "upgrade".

Offline

#3 2006-02-12 19:12:24

_Gandalf_
Member
Registered: 2006-01-12
Posts: 735

Re: I did a $ rm -r /var/lib/pacman/*

U deleted /var/lib/pacman but why you want to recover your system? because you destroyed that folder contents? if yes, then no u don't need such thing, just do pacman -Sy and the contents will get back there...

Offline

#4 2006-02-12 19:50:12

T-Dawg
Forum Fellow
From: Charlotte, NC
Registered: 2005-01-29
Posts: 2,736

Re: I did a $ rm -r /var/lib/pacman/*

_Gandalf_ wrote:

U deleted /var/lib/pacman but why you want to recover your system? because you destroyed that folder contents? if yes, then no u don't need such thing, just do pacman -Sy and the contents will get back there...

no... when you delete that directory, your deleting local database (records of what you have installed) along with repo databases which can be restored from a pacman -Sy.

Your best bet now is to search google for a way to resore that deleted directory or reinstall the entire system. Like you said, going back and reinstalling the packages probably won't get them all.

Offline

#5 2006-02-12 19:51:53

lessthanjake
Member
From: Norway
Registered: 2005-11-09
Posts: 319
Website

Re: I did a $ rm -r /var/lib/pacman/*

Yes its back, but it look like pacman has lost it memory of what packages is installed. I know there is updates waiting for me, but a -Syu does not detect them! Here is an example, this is written i bash:

root@home:~# pacman -Q bash
Package "bash" was not found.

The root of the problem may be somthing else, but it occured at same time i removed the files.

Edit: Posted at the same time as Penguin, from what he said this does not look good :?

Offline

#6 2006-02-12 19:54:38

T-Dawg
Forum Fellow
From: Charlotte, NC
Registered: 2005-01-29
Posts: 2,736

Re: I did a $ rm -r /var/lib/pacman/*

the longer you mess with that directory the less chance you have of restoring anything.

Offline

#7 2006-02-13 10:10:41

tomk
Forum Fellow
From: Ireland
Registered: 2004-07-21
Posts: 9,839

Re: I did a $ rm -r /var/lib/pacman/*

I like iKevin's idea. It would still take a bit of work, but as an example, try this:

grep -r installed /var/log/pacman.log | cut -d " " -f 4 | sort

and you'll get an alphabetical list of everything you've ever installed - including dupes, of course, but the sorting makes those easy to spot. You don't need to look for upgraded apps, because you'll be installing the latest versions anyway. You could do a similar grep for removed apps, and cross-reference them, or you could just reinstall everything, and then remove what you don't want when your system is back in shape.

Maybe some bash wizard around here would have some ideas about getting rid of the dupes..... smile

Offline

#8 2006-02-13 11:16:20

T-Dawg
Forum Fellow
From: Charlotte, NC
Registered: 2005-01-29
Posts: 2,736

Re: I did a $ rm -r /var/lib/pacman/*

log rotation?
Arch keeps 4 copies of each log file from logrotate running as a cronjob, and after the fourth the next is deleted. It would be fine and dandy to use the log files as long as you are sure they are still there...

Offline

#9 2006-02-13 12:07:17

Cerebral
Forum Fellow
From: Waterloo, ON, CA
Registered: 2005-04-08
Posts: 3,108
Website

Re: I did a $ rm -r /var/lib/pacman/*

tomk wrote:

Maybe some bash wizard around here would have some ideas about getting rid of the dupes..... smile

Pipe it through uniq after?

Offline

#10 2006-02-13 12:40:23

lessthanjake
Member
From: Norway
Registered: 2005-11-09
Posts: 319
Website

Re: I did a $ rm -r /var/lib/pacman/*

Thanks for the tips, but now I'm just finished doing a clan install. Parsing the logs might have worked, but i didn't feel like messing alot around. Installing Arch is easy and fast, so I did it the safe way smile

Offline

#11 2006-02-13 14:38:42

tomk
Forum Fellow
From: Ireland
Registered: 2004-07-21
Posts: 9,839

Re: I did a $ rm -r /var/lib/pacman/*

Penguin wrote:

log rotation?

Good point - although pacman.log is not being rotated on any of my 3 machines. A config issue for me, I presume, although I actually like it that way.  tongue

Cerebral - that's cool. Things like this are the reason I love linux, but also the reason I'm not a bash wizard. I wouldn't even know uniq was there except for this thread! Thanks. smile

Sorry, lessthanjake - going OT here - must stop.

Glad you're sorted out, anyway, although if you ask me, it was just getting interesting.........

Offline

Board footer

Powered by FluxBB