0

I updated my Dell OEM linux machine from 14.04 to 16.04. Something went wrong during the upgrade and when I tried to login it got stuck in a loop I managed to fix it using the tty terminal and manually connect to wifi using wpa_supplicant. My apt-get is now stuck with 33 not fully installed or removed. when I run apt-get autoremove or apt-get install -f i get the same errors. It quits with this error message.

 Errors were encountered while processing:
 ufw
 gufw
 linux-firmware
 linux-image-4.4.0-98-generic
 linux-image-extra-4.4.0-98-generic
 linux-image-generic
 linux-generic
 linux-generic-lts-xenial
 linux-image-4.4.0-53-generic
 linux-image-4.4.0-57-generic
 linux-image-4.4.0-59-generic
 linux-image-4.4.0-72-generic
 linux-image-4.4.0-75-generic
 linux-image-4.4.0-78-generic
 linux-image-4.4.0-79-generic
 linux-image-4.4.0-83-generic
 linux-image-4.4.0-92-generic
 linux-image-4.4.0-93-generic
 linux-image-4.4.0-96-generic
 linux-image-4.4.0-97-generic
 linux-image-extra-4.4.0-53-generic
 linux-image-extra-4.4.0-57-generic
 linux-image-extra-4.4.0-59-generic
 linux-image-extra-4.4.0-72-generic
 linux-image-extra-4.4.0-75-generic
 linux-image-extra-4.4.0-78-generic
 linux-image-extra-4.4.0-79-generic
 linux-image-extra-4.4.0-83-generic
 linux-image-extra-4.4.0-92-generic
 linux-image-extra-4.4.0-93-generic
 linux-image-extra-4.4.0-96-generic
 linux-image-extra-4.4.0-97-generic
 initramfs-tools
 E: Sub-process /usr/bin/dpkg returned an error code (1)

Here is the full output of sudo apt-get autoremove https://pastebin.com/18zbyBAK

10
  • 1
    First error seems to be mv: '/lib/ufw/user.rules' and '/etc/ufw/user.rules' are the same file. You could try renaming/moving one of them and see if that helps? At least it should give you one less error. – Mikael Kjær Nov 19 '17 at 3:58
  • It looks like initramfs is failing. What happens if you do sudo initramfs -u -k all -v? – Nate Eldredge Nov 19 '17 at 4:04
  • @NateEldredge I get sudo: initramfs: command not found or without sudo initramfs: command not found – Baasic Nov 19 '17 at 4:44
  • 1
    Oh sorry, I meant sudo update-initramfs -u -k all -v – Nate Eldredge Nov 19 '17 at 6:15
  • First, your machine seems to still be running + rebooting may fail, so if you haven't take a full backup, best to this now. Whenever I hit this type of problem in a update, I tend to just delete the offending package, so in your case delete ufw + any other package in error. The try + do a repair. Usually dpkg --configure -a is sufficient... well... after all packages that can't be recovered are removed. – David Favor Nov 19 '17 at 13:08
1

I had the same issue, I solved it with:

sudo mv /etc/ufw/user{,6}.rules /lib/ufw/

It seems the installation script awaits real files in /lib/ufw/user{,6}.rules and want to copy them to /etc/ufw/user{,6}.rules AND then create a link from the old location to the new, probably for compatibility reasons. However, the script doesn't check if it already set up this way.

The given instruction (first instruction on the top) is simply erasing the links and move the 2 files back to /lib/ufw where it seems that ufw install script is expecting them.

Afterwards, sudo apt-get install -f went through ufw installation process without complaining.

-1

Controll with df -h;df -i if you have enough space particulary if a seperate boot-partition is present.

In the case boot-partition is full dpkg -l 'linux-[ihs]*' | sed '/^ii/!d;/'"$(uname -r | sed "s/\([-0-9]*\)-\([^0-9]\+\)/\1/")"'/d;s/^[^ ]* [^ ]* \([^ ]*\).*/\1/;/[0-9]/!d' | xargs sudo dpkg -P This removes every kernel-package besides your current running Kernel.

Not this case?

sudo dpkg -P ufw gufw linux-generic-lts-xenial  linux-image-4.4.0-98-generic linux-image-extra-4.4.0-98-generic

Install initramfs-tools directly with dpkg. sudo dpkg -i /var/cache/apt/archives/initramfs-tools-full-packagename.deb Use autocomplete. We need it.

In both cases sudo dpkg --configure -a && sudo apt -f install If apt is free please run sudo apt-get autoremove --purge

Good luck.

6
  • There is no .deb file for initramfs-tools in /archive – Baasic Nov 20 '17 at 2:19
  • Bad wget -c http://mirrors.kernel.org/ubuntu/pool/main/i/initramfs-tools/initramfs-tools_0.122ubuntu8.9_all.deb After that package is in your curent pwd. – user192526 Nov 20 '17 at 8:29
  • I'm getting a 404 for that url: --2017-11-24 00:17:03-- http://mirrors.kernel.org/ubuntu/pool/main/i/initramfs-tools%E2%80%8C%E2%80%8B/initramfs-tools_0.1%E2%80%8C22ubuntu8.9_all.deb Reusing existing connection to mirrors.kernel.org:80. HTTP request sent, awaiting response... 404 Not Found 2017-11-24 00:17:03 ERROR 404: Not Found. – Baasic Nov 24 '17 at 5:17
  • Great. wget -c http://de.archive.ubuntu.com/ubuntu/pool/main/i/initramfs-tools/initramfs-tools_0.122ubuntu8.9_all.deb This is working. I try it. – user192526 Nov 24 '17 at 7:35
  • same 404 --2017-11-24 11:07:52-- http://de.archive.ubuntu.com/ubuntu/pool/main/i/initramfs-to%E2%80%8C%E2%80%8Bols/initramfs-tools_%E2%80%8C%E2%80%8B0.122ubuntu8.9_all.d%E2%80%8C%E2%80%8Beb Reusing existing connection to de.archive.ubuntu.com:80. HTTP request sent, awaiting response... 404 Not Found 2017-11-24 11:07:53 ERROR 404: Not Found. – Baasic Nov 24 '17 at 16:08
-2

I ended up copying off my home data and reinstalling 16.04

1
  • 1
    This is YOUR solution, which did NOT actually solved the problem, it should be unmarked as accepted. – LinuxSecurityFreak Dec 7 '17 at 3:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.