This question already has an answer here:
I'm running Ubuntu 14.04.4 LTS, and I'm trying to install a new package using apt-get. Unfortunately, whenever I try I get messages like:
The following packages have unmet dependencies: linux-image-extra-3.16.0-70-generic : Depends: linux-image-3.16.0-70-generic but it is not going to be installed linux-image-generic-lts-utopic : Depends: linux-image-3.16.0-70-generic but it is not going to be installed linux-signed-image-3.16.0-70-generic : Depends: linux-image-3.16.0-70-generic (= 3.16.0-70.90~14.04.1) but it is not going to be installed
Doing some googling, I found that this can be caused by lack of space on the boot partition (and sure enough,
/boot at 100%). However, any time I try running the
apt-get commands in the accepted answer there, I get the same errors as above.
Looking for another solution that didn't use
apt-get, I came across this post, which recommends using things like
sudo dpkg --purge linux-image-4.2.0-15-generic on old, unused kernels.
dpkg -l | tail -n +6 | grep -E 'linux-image-[0-9]+' | grep -Fv $(uname -r) (from the afore-mentioned post) shows that I have several old kernels in the
pi state (desired purged, state is installed according to this)
uname -r tells me the kernel I'm running is 3.16.0-62-generic, so I thought I should be safe to remove these old kernels. However, trying to do so with things like
sudo dpkg --purge linux-image-3.16.0-49-generic results in:
dpkg: error processing package linux-image-3.16.0-49-generic (--purge): dependency problems - not removing Errors were encountered while processing: linux-image-3.16.0-49-generic
Garrg! I'm at my wit's end, and out of my depth (don't really know much about dpkg or apt-get), so I need some help.
Why can't I uninstall the old kernels with
If that question can't be directly solved, I guess ultimately I want to know: What do I need to do to get into a state where I can install new packages again?
Other things I have tried:
sudo apt-get autoremove: results in the original error about unmet dependencies
sudo apt-get -f autoremove: results in:
Unpacking linux-image-3.16.0-70-generic (3.16.0-70.90~14.04.1) ... dpkg: error processing archive /var/cache/apt/archives/linux-image-3.16.0-70-generic_3.16.0-70.90~14.04.1_amd64.deb (--unpack): cannot copy extracted data for './boot/vmlinuz-3.16.0-70-generic' to '/boot/vmlinuz-3.16.0-70-generic.dpkg-new': failed to write (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.16.0-70-generic /boot/vmlinuz-3.16.0-70-generic run-parts: executing /etc/kernel/postrm.d/zz-update-grub 3.16.0-70-generic /boot/vmlinuz-3.16.0-70-generic Errors were encountered while processing: /var/cache/apt/archives/linux-image-3.16.0-70-generic_3.16.0-70.90~14.04.1_amd64.deb E: Sub-process /usr/bin/dpkg returned an error code (1)
Note: I've migrated this question from "Unix & Linux Stack Exchange"