You are not logged in.

#1 2007-06-23 16:17:19

roadboy
Member
From: Turkey
Registered: 2007-06-23
Posts: 38
Website

How to regenerate pacman cache

my pacman cache was broken and now there's no file or folder in /var/lib/pacman directory. is there any way i can recover installed packages cache?

i did pacman -Syu but no upgradable packages detected hmm


in /dev/null no one can hear your scream...

Turkish Archlinux & KDEmod Mirror Administrator
http://server.elsistech.com/archlinux/ ~ http://server.elsistech.com/archlinux/kdemod/

Offline

#2 2007-06-23 17:06:08

shining
Pacman Developer
Registered: 2006-05-10
Posts: 2,043

Re: How to regenerate pacman cache

Are you talking about pacman local database, in /var/lib/pacman/local ?

And do you mean these files were automatically deleted ?
That's rather funny.

You can recover from the backup you didn't make, or by reinstalling all installed packages.
Maybe pacman.log could help, if it wasn't deleted as well, but I'm not sure it'll contain everything.


pacman roulette : pacman -S $(pacman -Slq | LANG=C sort -R | head -n $((RANDOM % 10)))

Offline

#3 2007-06-23 17:11:05

roadboy
Member
From: Turkey
Registered: 2007-06-23
Posts: 38
Website

Re: How to regenerate pacman cache

shining wrote:

Are you talking about pacman local database, in /var/lib/pacman/local ?

And do you mean these files were automatically deleted ?
That's rather funny.

You can recover from the backup you didn't make, or by reinstalling all installed packages.
Maybe pacman.log could help, if it wasn't deleted as well, but I'm not sure it'll contain everything.

when upgrading system ups went off and no more pacman db in /var/lib/pacman anymore. but the logfile is still there. i found pacfix but i'm not sure how to use it. which file name do i have to put listed files in /var/lib/pacman/local ?

today after, i'll backup important configs but 1st i'll have to fix pacman neutral


in /dev/null no one can hear your scream...

Turkish Archlinux & KDEmod Mirror Administrator
http://server.elsistech.com/archlinux/ ~ http://server.elsistech.com/archlinux/kdemod/

Offline

#4 2007-06-23 18:01:17

shining
Pacman Developer
Registered: 2006-05-10
Posts: 2,043

Re: How to regenerate pacman cache

Well, it looks like pacfix looks at pacman.log so that should work. The version I saw will only work for english output though.
And also, the author mentions the thing I was wondering about :

Remember that packages installed during arch setup are not logged in /var/log/pacman.log, so they are found by this script only if they were upgraded later.

http://bbs.archlinux.org/viewtopic.php?id=29629


pacman roulette : pacman -S $(pacman -Slq | LANG=C sort -R | head -n $((RANDOM % 10)))

Offline

#5 2007-06-23 18:53:39

Bebo
Member
From: Göteborg, Sweden
Registered: 2006-06-07
Posts: 207

Re: How to regenerate pacman cache

About fixing a broken package db; I've been thinking about how to do that myself, _without_ information from /var/log/pacman.log. However, the two ways I'd be interested in to try out need a list of all the files in all packages in each repository (or at least all "active" repositories in /etc/pacman.conf), kind of like the MANIFEST.gz file in Slackware.

The first idea I had was to write a script that makes a least-square fit of the files in the packages in the active repositories in /etc/pacman.conf and the actual files on the computer. However, when thinking about that, I thought there is a simpler way (more "stupid" anyway), i.e. to make a loop that went through all the files in all packages in the active repositories, and as soon as it found a file in the currently tested package that was _not_ on the filesystem, it would skip that package, and go on to test the next. Roughly (python-ish pseudocode):

for repos in /etc/pacman.conf:
    for package in repos:
        for file in package:
            if not os.path.exists(file):
                continue 2
        print package

Sorry, roadboy, I know this wasn't helpful at all for you, but I've been thinking about this for some time, and wanted to get it out smile

Offline

#6 2007-06-23 19:14:34

shining
Pacman Developer
Registered: 2006-05-10
Posts: 2,043

Re: How to regenerate pacman cache

Bebo wrote:

About fixing a broken package db; I've been thinking about how to do that myself, _without_ information from /var/log/pacman.log. However, the two ways I'd be interested in to try out need a list of all the files in all packages in each repository (or at least all "active" repositories in /etc/pacman.conf), kind of like the MANIFEST.gz file in Slackware.

Indeed, I first thought about that when reading this thread, but pacman doesn't have this feature.
See http://bugs.archlinux.org/task/4824?histring=filelist


pacman roulette : pacman -S $(pacman -Slq | LANG=C sort -R | head -n $((RANDOM % 10)))

Offline

#7 2007-06-23 20:58:43

roadboy
Member
From: Turkey
Registered: 2007-06-23
Posts: 38
Website

Re: How to regenerate pacman cache

I got the list of installed packages with pacfix. I'm reinstalling the packages now to let pacman renew it's db. I hope there were a simple way to fix it but there isn't. I don't know other distros have the same problem but I know debian doesn't have this.

Thanks guys for your help. I'm getting bored with my slow 256kbps connection now. God save your UPS wink


in /dev/null no one can hear your scream...

Turkish Archlinux & KDEmod Mirror Administrator
http://server.elsistech.com/archlinux/ ~ http://server.elsistech.com/archlinux/kdemod/

Offline

#8 2007-06-23 22:28:33

shining
Pacman Developer
Registered: 2006-05-10
Posts: 2,043

Re: How to regenerate pacman cache

roadboy wrote:

I got the list of installed packages with pacfix. I'm reinstalling the packages now to let pacman renew it's db. I hope there were a simple way to fix it but there isn't. I don't know other distros have the same problem but I know debian doesn't have this.

Really? I never tried to remove the database in debian either.
How can you regenerate the database there ?


pacman roulette : pacman -S $(pacman -Slq | LANG=C sort -R | head -n $((RANDOM % 10)))

Offline

#9 2007-06-25 15:08:47

Filosofem
Member
Registered: 2006-03-01
Posts: 28

Re: How to regenerate pacman cache

Something similar happened to me once.  I did a pacman-optimize, and everything was fixed.  But I'm truely not sure whether it will work in your case.

Offline

#10 2007-06-25 19:37:43

roadboy
Member
From: Turkey
Registered: 2007-06-23
Posts: 38
Website

Re: How to regenerate pacman cache

shining wrote:
roadboy wrote:

I got the list of installed packages with pacfix. I'm reinstalling the packages now to let pacman renew it's db. I hope there were a simple way to fix it but there isn't. I don't know other distros have the same problem but I know debian doesn't have this.

Really? I never tried to remove the database in debian either.
How can you regenerate the database there ?

I deleted all the apt-get files/folders except sources.list and rebooted system. apt-get was running fine. I dunno how they do this or it's just my luck smile

And guys, reinstalling packages which i got the list with pacfix.py made system unusable. I got bored fighting with the .pacorig files and reinstalled Arch. After now, I'll backup important system files smile


in /dev/null no one can hear your scream...

Turkish Archlinux & KDEmod Mirror Administrator
http://server.elsistech.com/archlinux/ ~ http://server.elsistech.com/archlinux/kdemod/

Offline

Board footer

Powered by FluxBB