recovery from "rm -rf /var/lib/dpkg/info" ?

Aaron Haviland orion at
Wed Aug 22 20:36:11 BST 2007

Aaron Haviland wrote, on Aug 22, 2007 at 15:20 EDT:
> Uhm, you'll be needing to wipe $TMPDIR somewhere towards the end as
> well.

Actually, you won't. I just finished debugging it.
I'll leave it up to you to create the TMPDIR or change the path in the



for i in $(dpkg --list | grep ^ii | cut -f3 -d' '); do
        echo "Now rebuilding package: ${i}" 
        sudo apt-get -d install --reinstall $i -qqy

        # extract control information
        dpkg-deb -e $DEBNAME $TMPDIR

        # we don't actually need the control file itself
        rm $TMPDIR/control

        # but we do need a file list
        dpkg-deb --contents $DEBNAME | cut -f2- -d'.' | while read k; do echo "${k%*/}"; done > $TMPDIR/list
        echo "/." >> $TMPDIR/list
        for j in $(cd $TMPDIR && echo *); do
                mv $TMPDIR/$j $DPKGINFO/$i.$j
                # $i.$j = packagename.postinst, for example

        #wipe clean, save space
        sudo apt-get clean

Aaron Haviland
34 Wayne Ave, Dudley, MA                       home:  [508] 943 - 7974
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : 

More information about the Ubuntu-us-ma mailing list