My boot partition is full and I attempted to follow the solution found here:
https://askubuntu.com/a/142937/178039
Running:
dpkg -l 'linux-*' | sed '/^ii/!d;/'"$(uname -r | sed "s/\(.*\)-\([^0-9]\+\)/\1/")"'/d;s/^[^ ]* [^ ]* \([^ ]*\).*/\1/;/[0-9]/!d'
linux-headers-3.2.0-23
linux-headers-3.2.0-23-generic
linux-headers-3.2.0-25
linux-headers-3.2.0-25-generic
linux-headers-3.2.0-26
linux-headers-3.2.0-26-generic
linux-headers-3.2.0-27
linux-headers-3.2.0-27-generic
linux-headers-3.2.0-29
linux-headers-3.2.0-29-generic
linux-headers-3.2.0-31
linux-headers-3.2.0-31-generic
linux-headers-3.2.0-32
linux-headers-3.2.0-32-generic
linux-headers-3.2.0-33
linux-headers-3.2.0-33-generic
linux-headers-3.2.0-34
linux-headers-3.2.0-34-generic
linux-headers-3.2.0-35
linux-headers-3.2.0-35-generic
linux-headers-3.2.0-36
linux-headers-3.2.0-36-generic
linux-headers-3.2.0-37
linux-headers-3.2.0-37-generic
linux-headers-3.2.0-38
linux-headers-3.2.0-38-generic
linux-headers-3.2.0-40
linux-headers-3.2.0-40-generic
linux-headers-3.2.0-41
linux-headers-3.2.0-41-generic
linux-image-3.2.0-31-generic
linux-image-3.2.0-32-generic
linux-image-3.2.0-33-generic
linux-image-3.2.0-34-generic
linux-image-3.2.0-35-generic
linux-image-3.2.0-36-generic
linux-image-3.2.0-37-generic
linux-image-3.2.0-38-generic
However, when I run the command sudo apt-get -y purge linux-image-3.2.0-31-generic
to remove an older image I get this issue:
You might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies:
linux-server : Depends: linux-image-server (= 3.2.0.49.59) but 3.2.0.40.48 is to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).
I run sudo apt-get -f install
and this just tells me my boot partition is full:
Reading package lists... Done
Building dependency tree
Reading state information... Done
Correcting dependencies... Done
The following packages were automatically installed and are no longer required:
linux-headers-3.2.0-23-generic linux-headers-3.2.0-31-generic linux-headers-3.2.0-26-generic linux-image-3.2.0-37-generic linux-headers-3.2.0-23 linux-headers-3.2.0-25 linux-headers-3.2.0-31 linux-headers-3.2.0-26
linux-headers-3.2.0-32 linux-headers-3.2.0-27 linux-headers-3.2.0-33 linux-headers-3.2.0-34 linux-headers-3.2.0-29 linux-headers-3.2.0-36 linux-headers-3.2.0-37 linux-headers-3.2.0-38 linux-headers-3.2.0-34-generic
linux-headers-3.2.0-29-generic libspeex1 linux-headers-3.2.0-37-generic linux-headers-3.2.0-32-generic linux-headers-3.2.0-27-generic linux-image-3.2.0-38-generic libtheora0 daemon libservlet2.5-java linux-headers-3.2.0-38-generic
linux-headers-3.2.0-25-generic linux-headers-3.2.0-33-generic linux-headers-3.2.0-36-generic
Use 'apt-get autoremove' to remove them.
The following extra packages will be installed:
linux-image-3.2.0-49-generic linux-image-server
Suggested packages:
fdutils linux-doc-3.2.0 linux-source-3.2.0 linux-tools
The following NEW packages will be installed:
linux-image-3.2.0-49-generic
The following packages will be upgraded:
linux-image-server
1 upgraded, 1 newly installed, 0 to remove and 113 not upgraded.
7 not fully installed or removed.
Need to get 0 B/38.5 MB of archives.
After this operation, 150 MB of additional disk space will be used.
Do you want to continue [Y/n]?
(Reading database ... 487607 files and directories currently installed.)
Unpacking linux-image-3.2.0-49-generic (from .../linux-image-3.2.0-49-generic_3.2.0-49.75_amd64.deb) ...
Done.
dpkg: error processing /var/cache/apt/archives/linux-image-3.2.0-49-generic_3.2.0-49.75_amd64.deb (--unpack):
failed in write on buffer copy for backend dpkg-deb during `./boot/vmlinuz-3.2.0-49-generic': No space left on device
No apport report written because the error message indicates a disk full error
dpkg-deb: error: subprocess paste was killed by signal (Broken pipe)
Examining /etc/kernel/postrm.d .
run-parts: executing /etc/kernel/postrm.d/initramfs-tools 3.2.0-49-generic /boot/vmlinuz-3.2.0-49-generic
run-parts: executing /etc/kernel/postrm.d/zz-update-grub 3.2.0-49-generic /boot/vmlinuz-3.2.0-49-generic
Errors were encountered while processing:
/var/cache/apt/archives/linux-image-3.2.0-49-generic_3.2.0-49.75_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
Running apt-get autoremove
gives the me:
Reading package lists... Done
Building dependency tree
Reading state information... Done
You might want to run 'apt-get -f install' to correct these.
The following packages have unmet dependencies:
linux-server : Depends: linux-image-server (= 3.2.0.49.59) but 3.2.0.40.48 is installed
E: Unmet dependencies. Try using -f.
It seems I am in a loop. How can I fix this issue to finally upgrade my server? I am on 12.04
Edit 1: When attempting to remove an image on boot:
sudo rm /boot/initrd.img-3.2.0-31-generic
sudo apt-get -y purge linux-image-3.2.0-31-generic
I get:
Reading package lists... Done
Building dependency tree
Reading state information... Done
You might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies:
linux-server : Depends: linux-image-server (= 3.2.0.49.59) but 3.2.0.40.48 is to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).
I then try and run apt-get -f install and get this error:
Reading package lists... Done
Building dependency tree
Reading state information... Done
Correcting dependencies... Done
The following packages were automatically installed and are no longer required:
linux-headers-3.2.0-23-generic linux-headers-3.2.0-31-generic linux-headers-3.2.0-26-generic linux-image-3.2.0-37-generic linux-headers-3.2.0-23 linux-headers-3.2.0-25 linux-headers-3.2.0-31 linux-headers-3.2.0-26
linux-headers-3.2.0-32 linux-headers-3.2.0-27 linux-headers-3.2.0-33 linux-headers-3.2.0-34 linux-headers-3.2.0-29 linux-headers-3.2.0-36 linux-headers-3.2.0-37 linux-headers-3.2.0-38 linux-headers-3.2.0-34-generic
linux-headers-3.2.0-29-generic libspeex1 linux-headers-3.2.0-37-generic linux-headers-3.2.0-32-generic linux-headers-3.2.0-27-generic linux-image-3.2.0-38-generic libtheora0 daemon libservlet2.5-java linux-headers-3.2.0-38-generic
linux-headers-3.2.0-25-generic linux-headers-3.2.0-33-generic linux-headers-3.2.0-36-generic
Use 'apt-get autoremove' to remove them.
The following extra packages will be installed:
linux-image-server
The following packages will be upgraded:
linux-image-server
1 upgraded, 0 newly installed, 0 to remove and 113 not upgraded.
5 not fully installed or removed.
Need to get 0 B/2,370 B of archives.
After this operation, 0 B of additional disk space will be used.
Do you want to continue [Y/n]?
Setting up linux-image-3.2.0-40-generic (3.2.0-40.64) ...
Running depmod.
update-initramfs: deferring update (hook will be called later)
The link /initrd.img is a dangling linkto /boot/initrd.img-3.2.0-49-generic
Examining /etc/kernel/postinst.d.
run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 3.2.0-40-generic /boot/vmlinuz-3.2.0-40-generic
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 3.2.0-40-generic /boot/vmlinuz-3.2.0-40-generic
update-initramfs: Generating /boot/initrd.img-3.2.0-40-generic
run-parts: executing /etc/kernel/postinst.d/update-notifier 3.2.0-40-generic /boot/vmlinuz-3.2.0-40-generic
run-parts: executing /etc/kernel/postinst.d/zz-update-grub 3.2.0-40-generic /boot/vmlinuz-3.2.0-40-generic
Generating grub.cfg ...
Found linux image: /boot/vmlinuz-3.2.0-49-generic
Found linux image: /boot/vmlinuz-3.2.0-41-generic
Found linux image: /boot/vmlinuz-3.2.0-40-generic
Found initrd image: /boot/initrd.img-3.2.0-40-generic
Found linux image: /boot/vmlinuz-3.2.0-39-generic
Found initrd image: /boot/initrd.img-3.2.0-39-generic
Found linux image: /boot/vmlinuz-3.2.0-38-generic
Found initrd image: /boot/initrd.img-3.2.0-38-generic
Found linux image: /boot/vmlinuz-3.2.0-37-generic
Found initrd image: /boot/initrd.img-3.2.0-37-generic
Found linux image: /boot/vmlinuz-3.2.0-36-generic
Found initrd image: /boot/initrd.img-3.2.0-36-generic
Found linux image: /boot/vmlinuz-3.2.0-35-generic
Found initrd image: /boot/initrd.img-3.2.0-35-generic
Found linux image: /boot/vmlinuz-3.2.0-34-generic
Found linux image: /boot/vmlinuz-3.2.0-33-generic
Found linux image: /boot/vmlinuz-3.2.0-32-generic
Found linux image: /boot/vmlinuz-3.2.0-31-generic
Found memtest86+ image: /memtest86+.bin
done
Setting up linux-image-3.2.0-41-generic (3.2.0-41.66) ...
Running depmod.
update-initramfs: deferring update (hook will be called later)
Examining /etc/kernel/postinst.d.
run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 3.2.0-41-generic /boot/vmlinuz-3.2.0-41-generic
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 3.2.0-41-generic /boot/vmlinuz-3.2.0-41-generic
update-initramfs: Generating /boot/initrd.img-3.2.0-41-generic
run-parts: executing /etc/kernel/postinst.d/update-notifier 3.2.0-41-generic /boot/vmlinuz-3.2.0-41-generic
run-parts: executing /etc/kernel/postinst.d/zz-update-grub 3.2.0-41-generic /boot/vmlinuz-3.2.0-41-generic
Generating grub.cfg ...
Found linux image: /boot/vmlinuz-3.2.0-49-generic
Found linux image: /boot/vmlinuz-3.2.0-41-generic
Found initrd image: /boot/initrd.img-3.2.0-41-generic
Found linux image: /boot/vmlinuz-3.2.0-40-generic
Found initrd image: /boot/initrd.img-3.2.0-40-generic
Found linux image: /boot/vmlinuz-3.2.0-39-generic
Found initrd image: /boot/initrd.img-3.2.0-39-generic
Found linux image: /boot/vmlinuz-3.2.0-38-generic
Found initrd image: /boot/initrd.img-3.2.0-38-generic
Found linux image: /boot/vmlinuz-3.2.0-37-generic
Found initrd image: /boot/initrd.img-3.2.0-37-generic
Found linux image: /boot/vmlinuz-3.2.0-36-generic
Found initrd image: /boot/initrd.img-3.2.0-36-generic
Found linux image: /boot/vmlinuz-3.2.0-35-generic
Found initrd image: /boot/initrd.img-3.2.0-35-generic
Found linux image: /boot/vmlinuz-3.2.0-34-generic
Found linux image: /boot/vmlinuz-3.2.0-33-generic
Found linux image: /boot/vmlinuz-3.2.0-32-generic
Found linux image: /boot/vmlinuz-3.2.0-31-generic
Found memtest86+ image: /memtest86+.bin
done
Setting up linux-image-3.2.0-49-generic (3.2.0-49.75) ...
Running depmod.
update-initramfs: deferring update (hook will be called later)
Examining /etc/kernel/postinst.d.
run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 3.2.0-49-generic /boot/vmlinuz-3.2.0-49-generic
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 3.2.0-49-generic /boot/vmlinuz-3.2.0-49-generic
update-initramfs: Generating /boot/initrd.img-3.2.0-49-generic
run-parts: executing /etc/kernel/postinst.d/update-notifier 3.2.0-49-generic /boot/vmlinuz-3.2.0-49-generic
run-parts: executing /etc/kernel/postinst.d/zz-update-grub 3.2.0-49-generic /boot/vmlinuz-3.2.0-49-generic
Generating grub.cfg ...
Found linux image: /boot/vmlinuz-3.2.0-49-generic
Found initrd image: /boot/initrd.img-3.2.0-49-generic
Found linux image: /boot/vmlinuz-3.2.0-41-generic
Found initrd image: /boot/initrd.img-3.2.0-41-generic
Found linux image: /boot/vmlinuz-3.2.0-40-generic
Found initrd image: /boot/initrd.img-3.2.0-40-generic
Found linux image: /boot/vmlinuz-3.2.0-39-generic
Found initrd image: /boot/initrd.img-3.2.0-39-generic
Found linux image: /boot/vmlinuz-3.2.0-38-generic
Found initrd image: /boot/initrd.img-3.2.0-38-generic
Found linux image: /boot/vmlinuz-3.2.0-37-generic
Found initrd image: /boot/initrd.img-3.2.0-37-generic
Found linux image: /boot/vmlinuz-3.2.0-36-generic
Found initrd image: /boot/initrd.img-3.2.0-36-generic
Found linux image: /boot/vmlinuz-3.2.0-35-generic
Found initrd image: /boot/initrd.img-3.2.0-35-generic
Found linux image: /boot/vmlinuz-3.2.0-34-generic
Found linux image: /boot/vmlinuz-3.2.0-33-generic
Found linux image: /boot/vmlinuz-3.2.0-32-generic
Found linux image: /boot/vmlinuz-3.2.0-31-generic
Found memtest86+ image: /memtest86+.bin
done
Setting up linux-image-server (3.2.0.40.48) ...
dpkg: dependency problems prevent configuration of linux-server:
linux-server depends on linux-image-server (= 3.2.0.49.59); however:
Version of linux-image-server on system is 3.2.0.40.48.
dpkg: error processing linux-server (--configure):
dependency problems - leaving unconfigured
No apport report written because the error message indicates its a followup error from a previous failure.
Errors were encountered while processing:
linux-server
E: Sub-process /usr/bin/dpkg returned an error code (1)
In all the error output you provided there's one important part: No space left on device
. This indicates that your disk is full. A full disk can lead to packages left in an unconfigured state, resulting in the dependency errors you're seeing.
The only sane thing here is to free up some space. For example, manually remove the initrd image:
sudo rm /boot/initrd.img-3.2.0-31-generic
try sudo apt-get -f install
again, then purge the package
sudo apt-get -y purge linux-image-3.2.0-31-generic
If you get another No space left on device
remove one more initrd.img and try again.
No comments:
Post a Comment