$ sudo gainroot # apt-get install dpkg-repack (...dpkg-repack installation...) # cd /home/user/MyDocs/debbackup # for package in $( dpkg -l | awk 'NR>5 {print $2}' ); do dpkg-repack $package; done