Backup upgradable packages with dpkg-repack on debian

by user1209216   Last Updated August 10, 2018 13:00 PM

I want to list upgradable packages and automatically repack them to .debs. My try:

fakeroot -u dpkg-repack `apt list --upgradable | cut -f1 -d"/" | awk '{if(NR>2)print}'`

So it gets package names, then redirects names to dpkg-repack. It works partially, because dpkg-repack throws error when amd64 and i386 package exists and both have the same name - in this case it expects architecture to be added to package name.

Do you have any idea how to manage it and in case of multiple arch exists, auto generate both debs? It seems dpkg-repack is not smart enough to be able to generate multiple architectures automatically, it only throws error message saying multiple packages with the same name are installed

Tags : debian bash dpkg

Related Questions

Ubuntu dpkg, non interactive installation

Updated November 27, 2015 07:00 AM