You are not logged in.

#1 2006-04-03 21:42:45

erniee
Member
Registered: 2005-11-27
Posts: 15

DELETED USR

I made a HUGE mistaked today, I delted my usr directory by accident I meant to do cp -R usr/ / but for some reason I used rm -R like an idiot. So how do I get it back? This is a stupid mistake. Thanks for reading and hope you have an idea.

Offline

#2 2006-04-03 22:30:44

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

Re: DELETED USR

what kind of filesystem are you using?

Have a look at this thread for recovering files from a reiserfs partition.

Offline

#3 2006-04-04 00:12:49

Dusty
Schwag Merchant
From: Medicine Hat, Alberta, Canada
Registered: 2004-01-18
Posts: 5,986
Website

Re: DELETED USR

one thing you could try is pacman -Sc and then pacman -U /var/cache/pacman/pkg/*. That will reinstal all packages and since /usr usually contains only files managed by pacman, should restore it to pristine condition. It won't help with thnigs you've installed or modified locally though.

Dusty

Offline

#4 2006-04-04 00:46:16

erniee
Member
Registered: 2005-11-27
Posts: 15

Re: DELETED USR

Awesome, thanks guys. I do use Resiser FS sorry for not including, I was in a bit of a rush when I wrote this post. I'll let you guys know if it that gets me going and I'll append a fix to the title. Thanks again.

Offline

#5 2006-04-04 16:51:54

patroclo7
Member
From: Bassano del Grappa, ITALY
Registered: 2006-01-11
Posts: 915

Re: DELETED USR

If you have deleted /usr, you can not use pacman, which was in /usr/bin/pacman tongue


Mortuus in anima, curam gero cutis

Offline

#6 2006-04-04 16:58:49

Dusty
Schwag Merchant
From: Medicine Hat, Alberta, Canada
Registered: 2004-01-18
Posts: 5,986
Website

Re: DELETED USR

patroclo7 wrote:

If you have deleted /usr, you can not use pacman, which was in /usr/bin/pacman tongue

very true, you'd need to untar the package directly and then grab pacman.static from inside.

Dusty

Offline

#7 2006-04-04 19:01:45

erniee
Member
Registered: 2005-11-27
Posts: 15

Re: DELETED USR

I'm still a bit of a noob and I'm not sure how to go about untarring whichever package we're speaking about sad anyone know where to point me to?

Offline

#8 2006-04-04 19:22:45

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

Re: DELETED USR

To untargz a package, just run

tar xzf filename

or, specifically for pacman,

tar xzf /var/cache/pacman/pkg/pacman-2.9.8-1.pkg.tar.gz

You might want to do this in a temporary folder so you don't accidentally overwrite anything in /etc

Offline

#9 2006-04-04 20:13:22

copernikus
Member
From: Philadelphia, PA
Registered: 2005-12-09
Posts: 16

Re: DELETED USR

Cerebral wrote:

To untargz a package, just run

tar xzf filename

umm... I could be wrong, not on my arch box but isn't tar in /usr/bin?

Anyway, best bet would be to fire up a live cd and mount your drives and use the livecds tar to get pacman back.

-Fran

Offline

#10 2006-04-04 20:18:15

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

Re: DELETED USR

tar is in /bin

I still think the filesystem recovery procedure is a better route. You have to be sure that if you do a pacman -U /var/cache/pacman/pkg/* that everything in that folder was everything that you have installed. YOu also have to factor in older packages and cleared cache....

Maybe you could do something with pamcan -Q and strip out the versions so you can give it as a list to pacman to reinstall

Offline

#11 2006-04-06 02:50:36

erniee
Member
Registered: 2005-11-27
Posts: 15

Re: DELETED USR

Luckily I gave in and took the "easy route" and just reinstalled Arch, I won't make this noobified mistake again, and luckily I hardly had anything on my computer at that moment so all is well, thanks for the great suggestions in case it someday helps someone else out there.

Offline

Board footer

Powered by FluxBB