[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: I've got a corrupt filesys. How do I check integrity of all installed packages?



Found the answer over at http://www.debianhelp.org

I did all this as root.

Clean out the package cache. Since I had suffered a filesystem corruption I 
couldn't trust the files in /var/cache/apt/archives to be ok.

 apt-get clean


Find installed packages 

  dpkg --get-selections | grep -v 'deinstall' | grep 'install'|awk '{print $1}' > packs
 

Now we have a file 'pack' with the names of all installed packages. This bash oneliner will install
them. 

   for p in `cat packs`; do apt-get install --reinstall --yes $p ;done

Although we gave the --yes option, some packages will still ask you questions, so you'll 
have to monitor the process. This will be a bit less boring if you separate downloading and
installation. I didn't do this, but I sure will next time. This should do the trick:
 
 download

   for p in `cat packs`; do apt-get install --download-only --reinstall --yes $p ;done


 and install

   for p in `cat packs`; do apt-get install --reinstall --yes $p ;done



This method worked like a charm. The only problem was that I had installed an xserver 
that wasn't deb packed. This had the packaging systems dependency calculations confused 
and it took some manual fiddling to sort it out.



On Tuesday 12 June 2001 16:57, oivvio polite wrote:
> OK, here's an other:
>
> Last week I played around with hdparm to optimize hd performance.
> Not only did manage to speed up the hd considerably, I also managed
> to corrupt my file system. I could still boot after fsck. I can still get
> up kmail to write you this. Most stuff still works but some services
> want come up. I know for sure that some symlinks disappeared and I suspect
> that some files are gone or corrupt.
>
> Is there an dpkg or apt trick to go through all installed packages,  check
> their integrity and reinstall any files that need it?


-- 
oivvio polite

cell +46 (0)709 30 40 30 / phone +46 (0)8 669 64 18 / fax +46 (0)8 84 00 18
varvsgatan 10A / s-117 29 stockholm / sweden



Reply to: