0

I need to perform a dpkg-repack operation on everything to move to a new install on another hard disk, but I can't access any GUI

I have various packages that aren't completely installed and no apt command I've used so far has been able to do a batch install/reinstall/configure-completion on them all, and I end up having to run dpkg-repack until it comes across a bad one, install that, then restart repack again from the beginning. Is there any way I can select all installed (not all packages available to every repo I've added) packages and have them get installed to fix the broken or not fully installed ones?

1
  • Why restart from beginning? You can create a list and once it'sstuck download and install that. Then restart from the next
    – Anwar
    Apr 26, 2017 at 20:15

1 Answer 1

1

Just found a solution:

sudo apt-get install $(dpkg --get-selections | awk '{print $1}' | egrep -v 'dpkg|apt|mysql|mythtv')
sudo apt-get update
sudo apt-get install $(dpkg --get-selections | awk '{print $1}' | egrep -v 'dpkg|apt|mysql|mythtv')

Now get the list of failed-to-install items, then put it at the end of the next command:

sudo apt-get remove --purge <add packages in previous item>
fakeroot -u dpkg-repack $(dpkg --get-selections | grep install | cut -f1)

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .