Can't clean a full /boot because of unmet dependencies





.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ margin-bottom:0;
}







42















I got an error message explaining my /boot is full. trying to clean up old image files always seems to fail because of disk full errors or dependency errors. Could someone explain where I’m going wrong.



$ sudo apt-get autoremove
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-image-extra-3.13.0-44-generic : Depends: linux-image-3.13.0-44-generic but it is not installed
linux-image-extra-3.13.0-45-generic : Depends: linux-image-3.13.0-45-generic but it is not installed
linux-image-generic : Depends: linux-image-3.13.0-45-generic but it is not installed
E: Unmet dependencies. Try using -f.

$ ls /boot
abi-3.13.0-32-generic initrd.img-3.13.0-43-generic
abi-3.13.0-36-generic lost+found
abi-3.13.0-37-generic memtest86+.bin
abi-3.13.0-39-generic memtest86+.elf
abi-3.13.0-40-generic memtest86+_multiboot.bin
abi-3.13.0-43-generic System.map-3.13.0-32-generic
config-3.13.0-32-generic System.map-3.13.0-36-generic
config-3.13.0-36-generic System.map-3.13.0-37-generic
config-3.13.0-37-generic System.map-3.13.0-39-generic
config-3.13.0-39-generic System.map-3.13.0-40-generic
config-3.13.0-40-generic System.map-3.13.0-43-generic
config-3.13.0-43-generic vmlinuz-3.13.0-32-generic
grub vmlinuz-3.13.0-36-generic
initrd.img-3.13.0-32-generic vmlinuz-3.13.0-37-generic
initrd.img-3.13.0-36-generic vmlinuz-3.13.0-39-generic
initrd.img-3.13.0-37-generic vmlinuz-3.13.0-40-generic
initrd.img-3.13.0-39-generic vmlinuz-3.13.0-43-generic
initrd.img-3.13.0-40-generic


I used



kernelver=$(uname -r | sed -r 's/-[a-z]+//')
dpkg -l linux-{image,headers}-"[0-9]*" | awk '/ii/{print $2}' | grep -ve $kernelver


to get



linux-headers-3.13.0-32
linux-headers-3.13.0-32-generic
linux-headers-3.13.0-36
linux-headers-3.13.0-36-generic
linux-headers-3.13.0-37
linux-headers-3.13.0-37-generic
linux-headers-3.13.0-39
linux-headers-3.13.0-39-generic
linux-headers-3.13.0-40
linux-headers-3.13.0-40-generic
linux-headers-3.13.0-44
linux-headers-3.13.0-44-generic
linux-headers-3.13.0-45
linux-headers-3.13.0-45-generic
linux-image-3.13.0-32-generic
linux-image-3.13.0-36-generic
linux-image-3.13.0-37-generic
linux-image-3.13.0-39-generic
linux-image-3.13.0-40-generic


Then picking the first image to remove



$ sudo apt-get purge linux-image-3.13.0-32-generic
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-image-extra-3.13.0-32-generic : Depends: linux-image-3.13.0-32-generic but it is not going to be installed
linux-image-extra-3.13.0-44-generic : Depends: linux-image-3.13.0-44-generic but it is not going to be installed
linux-image-extra-3.13.0-45-generic : Depends: linux-image-3.13.0-45-generic but it is not going to be installed
linux-image-generic : Depends: linux-image-3.13.0-45-generic but it is not going to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).









share|improve this question

























  • Please edit your question and the output of sudo apt-get autoremove and ls /boot.

    – muru
    Feb 15 '15 at 13:10











  • Try Phrog's answer. Use the uname -r command to find out your current kernel version, and try removing a kernel other than that.

    – muru
    Feb 15 '15 at 13:20


















42















I got an error message explaining my /boot is full. trying to clean up old image files always seems to fail because of disk full errors or dependency errors. Could someone explain where I’m going wrong.



$ sudo apt-get autoremove
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-image-extra-3.13.0-44-generic : Depends: linux-image-3.13.0-44-generic but it is not installed
linux-image-extra-3.13.0-45-generic : Depends: linux-image-3.13.0-45-generic but it is not installed
linux-image-generic : Depends: linux-image-3.13.0-45-generic but it is not installed
E: Unmet dependencies. Try using -f.

$ ls /boot
abi-3.13.0-32-generic initrd.img-3.13.0-43-generic
abi-3.13.0-36-generic lost+found
abi-3.13.0-37-generic memtest86+.bin
abi-3.13.0-39-generic memtest86+.elf
abi-3.13.0-40-generic memtest86+_multiboot.bin
abi-3.13.0-43-generic System.map-3.13.0-32-generic
config-3.13.0-32-generic System.map-3.13.0-36-generic
config-3.13.0-36-generic System.map-3.13.0-37-generic
config-3.13.0-37-generic System.map-3.13.0-39-generic
config-3.13.0-39-generic System.map-3.13.0-40-generic
config-3.13.0-40-generic System.map-3.13.0-43-generic
config-3.13.0-43-generic vmlinuz-3.13.0-32-generic
grub vmlinuz-3.13.0-36-generic
initrd.img-3.13.0-32-generic vmlinuz-3.13.0-37-generic
initrd.img-3.13.0-36-generic vmlinuz-3.13.0-39-generic
initrd.img-3.13.0-37-generic vmlinuz-3.13.0-40-generic
initrd.img-3.13.0-39-generic vmlinuz-3.13.0-43-generic
initrd.img-3.13.0-40-generic


I used



kernelver=$(uname -r | sed -r 's/-[a-z]+//')
dpkg -l linux-{image,headers}-"[0-9]*" | awk '/ii/{print $2}' | grep -ve $kernelver


to get



linux-headers-3.13.0-32
linux-headers-3.13.0-32-generic
linux-headers-3.13.0-36
linux-headers-3.13.0-36-generic
linux-headers-3.13.0-37
linux-headers-3.13.0-37-generic
linux-headers-3.13.0-39
linux-headers-3.13.0-39-generic
linux-headers-3.13.0-40
linux-headers-3.13.0-40-generic
linux-headers-3.13.0-44
linux-headers-3.13.0-44-generic
linux-headers-3.13.0-45
linux-headers-3.13.0-45-generic
linux-image-3.13.0-32-generic
linux-image-3.13.0-36-generic
linux-image-3.13.0-37-generic
linux-image-3.13.0-39-generic
linux-image-3.13.0-40-generic


Then picking the first image to remove



$ sudo apt-get purge linux-image-3.13.0-32-generic
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-image-extra-3.13.0-32-generic : Depends: linux-image-3.13.0-32-generic but it is not going to be installed
linux-image-extra-3.13.0-44-generic : Depends: linux-image-3.13.0-44-generic but it is not going to be installed
linux-image-extra-3.13.0-45-generic : Depends: linux-image-3.13.0-45-generic but it is not going to be installed
linux-image-generic : Depends: linux-image-3.13.0-45-generic but it is not going to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).









share|improve this question

























  • Please edit your question and the output of sudo apt-get autoremove and ls /boot.

    – muru
    Feb 15 '15 at 13:10











  • Try Phrog's answer. Use the uname -r command to find out your current kernel version, and try removing a kernel other than that.

    – muru
    Feb 15 '15 at 13:20














42












42








42


21






I got an error message explaining my /boot is full. trying to clean up old image files always seems to fail because of disk full errors or dependency errors. Could someone explain where I’m going wrong.



$ sudo apt-get autoremove
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-image-extra-3.13.0-44-generic : Depends: linux-image-3.13.0-44-generic but it is not installed
linux-image-extra-3.13.0-45-generic : Depends: linux-image-3.13.0-45-generic but it is not installed
linux-image-generic : Depends: linux-image-3.13.0-45-generic but it is not installed
E: Unmet dependencies. Try using -f.

$ ls /boot
abi-3.13.0-32-generic initrd.img-3.13.0-43-generic
abi-3.13.0-36-generic lost+found
abi-3.13.0-37-generic memtest86+.bin
abi-3.13.0-39-generic memtest86+.elf
abi-3.13.0-40-generic memtest86+_multiboot.bin
abi-3.13.0-43-generic System.map-3.13.0-32-generic
config-3.13.0-32-generic System.map-3.13.0-36-generic
config-3.13.0-36-generic System.map-3.13.0-37-generic
config-3.13.0-37-generic System.map-3.13.0-39-generic
config-3.13.0-39-generic System.map-3.13.0-40-generic
config-3.13.0-40-generic System.map-3.13.0-43-generic
config-3.13.0-43-generic vmlinuz-3.13.0-32-generic
grub vmlinuz-3.13.0-36-generic
initrd.img-3.13.0-32-generic vmlinuz-3.13.0-37-generic
initrd.img-3.13.0-36-generic vmlinuz-3.13.0-39-generic
initrd.img-3.13.0-37-generic vmlinuz-3.13.0-40-generic
initrd.img-3.13.0-39-generic vmlinuz-3.13.0-43-generic
initrd.img-3.13.0-40-generic


I used



kernelver=$(uname -r | sed -r 's/-[a-z]+//')
dpkg -l linux-{image,headers}-"[0-9]*" | awk '/ii/{print $2}' | grep -ve $kernelver


to get



linux-headers-3.13.0-32
linux-headers-3.13.0-32-generic
linux-headers-3.13.0-36
linux-headers-3.13.0-36-generic
linux-headers-3.13.0-37
linux-headers-3.13.0-37-generic
linux-headers-3.13.0-39
linux-headers-3.13.0-39-generic
linux-headers-3.13.0-40
linux-headers-3.13.0-40-generic
linux-headers-3.13.0-44
linux-headers-3.13.0-44-generic
linux-headers-3.13.0-45
linux-headers-3.13.0-45-generic
linux-image-3.13.0-32-generic
linux-image-3.13.0-36-generic
linux-image-3.13.0-37-generic
linux-image-3.13.0-39-generic
linux-image-3.13.0-40-generic


Then picking the first image to remove



$ sudo apt-get purge linux-image-3.13.0-32-generic
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-image-extra-3.13.0-32-generic : Depends: linux-image-3.13.0-32-generic but it is not going to be installed
linux-image-extra-3.13.0-44-generic : Depends: linux-image-3.13.0-44-generic but it is not going to be installed
linux-image-extra-3.13.0-45-generic : Depends: linux-image-3.13.0-45-generic but it is not going to be installed
linux-image-generic : Depends: linux-image-3.13.0-45-generic but it is not going to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).









share|improve this question
















I got an error message explaining my /boot is full. trying to clean up old image files always seems to fail because of disk full errors or dependency errors. Could someone explain where I’m going wrong.



$ sudo apt-get autoremove
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-image-extra-3.13.0-44-generic : Depends: linux-image-3.13.0-44-generic but it is not installed
linux-image-extra-3.13.0-45-generic : Depends: linux-image-3.13.0-45-generic but it is not installed
linux-image-generic : Depends: linux-image-3.13.0-45-generic but it is not installed
E: Unmet dependencies. Try using -f.

$ ls /boot
abi-3.13.0-32-generic initrd.img-3.13.0-43-generic
abi-3.13.0-36-generic lost+found
abi-3.13.0-37-generic memtest86+.bin
abi-3.13.0-39-generic memtest86+.elf
abi-3.13.0-40-generic memtest86+_multiboot.bin
abi-3.13.0-43-generic System.map-3.13.0-32-generic
config-3.13.0-32-generic System.map-3.13.0-36-generic
config-3.13.0-36-generic System.map-3.13.0-37-generic
config-3.13.0-37-generic System.map-3.13.0-39-generic
config-3.13.0-39-generic System.map-3.13.0-40-generic
config-3.13.0-40-generic System.map-3.13.0-43-generic
config-3.13.0-43-generic vmlinuz-3.13.0-32-generic
grub vmlinuz-3.13.0-36-generic
initrd.img-3.13.0-32-generic vmlinuz-3.13.0-37-generic
initrd.img-3.13.0-36-generic vmlinuz-3.13.0-39-generic
initrd.img-3.13.0-37-generic vmlinuz-3.13.0-40-generic
initrd.img-3.13.0-39-generic vmlinuz-3.13.0-43-generic
initrd.img-3.13.0-40-generic


I used



kernelver=$(uname -r | sed -r 's/-[a-z]+//')
dpkg -l linux-{image,headers}-"[0-9]*" | awk '/ii/{print $2}' | grep -ve $kernelver


to get



linux-headers-3.13.0-32
linux-headers-3.13.0-32-generic
linux-headers-3.13.0-36
linux-headers-3.13.0-36-generic
linux-headers-3.13.0-37
linux-headers-3.13.0-37-generic
linux-headers-3.13.0-39
linux-headers-3.13.0-39-generic
linux-headers-3.13.0-40
linux-headers-3.13.0-40-generic
linux-headers-3.13.0-44
linux-headers-3.13.0-44-generic
linux-headers-3.13.0-45
linux-headers-3.13.0-45-generic
linux-image-3.13.0-32-generic
linux-image-3.13.0-36-generic
linux-image-3.13.0-37-generic
linux-image-3.13.0-39-generic
linux-image-3.13.0-40-generic


Then picking the first image to remove



$ sudo apt-get purge linux-image-3.13.0-32-generic
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-image-extra-3.13.0-32-generic : Depends: linux-image-3.13.0-32-generic but it is not going to be installed
linux-image-extra-3.13.0-44-generic : Depends: linux-image-3.13.0-44-generic but it is not going to be installed
linux-image-extra-3.13.0-45-generic : Depends: linux-image-3.13.0-45-generic but it is not going to be installed
linux-image-generic : Depends: linux-image-3.13.0-45-generic but it is not going to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).






boot package-management disk-usage






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Jun 30 '17 at 8:54









Zanna

51.4k13140243




51.4k13140243










asked Feb 15 '15 at 13:00









Philip HowardPhilip Howard

213136




213136













  • Please edit your question and the output of sudo apt-get autoremove and ls /boot.

    – muru
    Feb 15 '15 at 13:10











  • Try Phrog's answer. Use the uname -r command to find out your current kernel version, and try removing a kernel other than that.

    – muru
    Feb 15 '15 at 13:20



















  • Please edit your question and the output of sudo apt-get autoremove and ls /boot.

    – muru
    Feb 15 '15 at 13:10











  • Try Phrog's answer. Use the uname -r command to find out your current kernel version, and try removing a kernel other than that.

    – muru
    Feb 15 '15 at 13:20

















Please edit your question and the output of sudo apt-get autoremove and ls /boot.

– muru
Feb 15 '15 at 13:10





Please edit your question and the output of sudo apt-get autoremove and ls /boot.

– muru
Feb 15 '15 at 13:10













Try Phrog's answer. Use the uname -r command to find out your current kernel version, and try removing a kernel other than that.

– muru
Feb 15 '15 at 13:20





Try Phrog's answer. Use the uname -r command to find out your current kernel version, and try removing a kernel other than that.

– muru
Feb 15 '15 at 13:20










3 Answers
3






active

oldest

votes


















61














In such case I would use the dpkg tool to force the removal of some kernel packages.
This is not suggested for common use and is a bit dangerous, but in such case with unmet dependencies might help.



First of all locate the kernel in which the system is booted. The one that is currently loaded. Open a terminal (CTRL+ALT+T) and issue the following command



uname -r


It will show you the loaded kernel, you should NOT try to remove this one.



Then issue the command



ls /boot 


it will return all the installed images. Pick one or two and try to remove them. Try to force remove/purge them.
For example



sudo dpkg --force-all -P linux-image-3.13.0-32-generic


You can do the same for other images, in order to free up some space.



Then you can try to install the missing packages, or



sudo apt-get install -f 


to try resolve the dependencies.



Finally, issue the "cleanup old kernels" command



 sudo apt-get purge $(dpkg -l linux-{image,headers}-"[0-9]*" | awk '/ii/{print $2}' | grep -ve "$(uname -r | sed -r 's/-[a-z]+//')")


Above command will remove ALL the kernels except the one that is currently loaded.



Because you have a separate /boot partition, keep in mind you will need to track its space and cleaning up often (the frequency depends on the space of /boot)






share|improve this answer





















  • 1





    Hi when I try to remove them I get an error sudo dpkg --force-all -P abi-3.13.0-32-generic dpkg: warning: ignoring request to remove abi-3.13.0-32-generic which isn't installed

    – Philip Howard
    Feb 15 '15 at 13:48








  • 9





    This worked for me, with one modification: after removing kernel images with dpkg, I had to run sudo apt-get -f autoremove to get apt-get to stop complaining about unmet dependencies. Otherwise, sudo apt-get -f install apparently kept trying to re-install all the kernel images I'd removed with dpkg, which obviously just filled up /boot again.

    – mdunsmuir
    Jan 16 '17 at 20:15








  • 3





    After force purging and the apt-get -f autoremove in @mdunsmuir comment above, it still wants to install all the old kernels during any of the clean up operations above. Is there a way to just tell it to ignore unrelated dependencies and remove a single, complete old kernel?

    – NKijak
    Sep 16 '17 at 15:29






  • 3





    I'd like to add that I also had to uninstall the extras with sudo dpkg --force-all -P linux-image-extra-3.13.0-32-generic. Otherwise these extras still depend on the actual image and the -f flag would cause the image to be reinstalled and then running out of disk space.

    – Ghostkeeper
    Mar 21 '18 at 19:40






  • 1





    @LonnieBest I agree. In contrast, Arch Linux keeps only one fallback. Neither does Fedora seem to have this issue.

    – Franklin Yu
    Oct 1 '18 at 19:27



















5














This is what worked for me on Ubuntu 16.04.



sudo apt autoremove --purge
sudo apt autoremove
sudo apt-get -f install
sudo apt-get upgrade





share|improve this answer


























  • This method worked for me.

    – Bok
    Oct 8 '18 at 14:16



















2














List all kernels:



dpkg --list 'linux-image*'


Display current kernel:



uname -r


List all kernels EXCEPT current one:



dpkg -l linux-{image,headers}-"[0-9]*" | awk '/^ii/{ print $2}' | grep -v -e `uname -r | cut -f1,2 -d"-"` | grep -e '[0-9]'


Make sure your current kernel isn't on that list.



Remove all kernels EXCEPT current one:



dpkg -l linux-{image,headers}-"[0-9]*" | awk '/^ii/{ print $2}' | grep -v -e `uname -r | cut -f1,2 -d"-"` | grep -e '[0-9]' | xargs sudo apt-get -y purge


Clear other stuff:



sudo apt-get autoremove





share|improve this answer


























  • If it still gives you boot disk space error for installing/uninstalling files then directly remove one of old image from /boot directory, ls -lh /boot/*-3.13.0-119*; rm /boot/*-3.13.0-119*; NOTE: Please review current kernel image again before deleting any image.

    – Hemant Thorat
    Jul 10 '18 at 10:29














Your Answer








StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "89"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f585736%2fcant-clean-a-full-boot-because-of-unmet-dependencies%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























3 Answers
3






active

oldest

votes








3 Answers
3






active

oldest

votes









active

oldest

votes






active

oldest

votes









61














In such case I would use the dpkg tool to force the removal of some kernel packages.
This is not suggested for common use and is a bit dangerous, but in such case with unmet dependencies might help.



First of all locate the kernel in which the system is booted. The one that is currently loaded. Open a terminal (CTRL+ALT+T) and issue the following command



uname -r


It will show you the loaded kernel, you should NOT try to remove this one.



Then issue the command



ls /boot 


it will return all the installed images. Pick one or two and try to remove them. Try to force remove/purge them.
For example



sudo dpkg --force-all -P linux-image-3.13.0-32-generic


You can do the same for other images, in order to free up some space.



Then you can try to install the missing packages, or



sudo apt-get install -f 


to try resolve the dependencies.



Finally, issue the "cleanup old kernels" command



 sudo apt-get purge $(dpkg -l linux-{image,headers}-"[0-9]*" | awk '/ii/{print $2}' | grep -ve "$(uname -r | sed -r 's/-[a-z]+//')")


Above command will remove ALL the kernels except the one that is currently loaded.



Because you have a separate /boot partition, keep in mind you will need to track its space and cleaning up often (the frequency depends on the space of /boot)






share|improve this answer





















  • 1





    Hi when I try to remove them I get an error sudo dpkg --force-all -P abi-3.13.0-32-generic dpkg: warning: ignoring request to remove abi-3.13.0-32-generic which isn't installed

    – Philip Howard
    Feb 15 '15 at 13:48








  • 9





    This worked for me, with one modification: after removing kernel images with dpkg, I had to run sudo apt-get -f autoremove to get apt-get to stop complaining about unmet dependencies. Otherwise, sudo apt-get -f install apparently kept trying to re-install all the kernel images I'd removed with dpkg, which obviously just filled up /boot again.

    – mdunsmuir
    Jan 16 '17 at 20:15








  • 3





    After force purging and the apt-get -f autoremove in @mdunsmuir comment above, it still wants to install all the old kernels during any of the clean up operations above. Is there a way to just tell it to ignore unrelated dependencies and remove a single, complete old kernel?

    – NKijak
    Sep 16 '17 at 15:29






  • 3





    I'd like to add that I also had to uninstall the extras with sudo dpkg --force-all -P linux-image-extra-3.13.0-32-generic. Otherwise these extras still depend on the actual image and the -f flag would cause the image to be reinstalled and then running out of disk space.

    – Ghostkeeper
    Mar 21 '18 at 19:40






  • 1





    @LonnieBest I agree. In contrast, Arch Linux keeps only one fallback. Neither does Fedora seem to have this issue.

    – Franklin Yu
    Oct 1 '18 at 19:27
















61














In such case I would use the dpkg tool to force the removal of some kernel packages.
This is not suggested for common use and is a bit dangerous, but in such case with unmet dependencies might help.



First of all locate the kernel in which the system is booted. The one that is currently loaded. Open a terminal (CTRL+ALT+T) and issue the following command



uname -r


It will show you the loaded kernel, you should NOT try to remove this one.



Then issue the command



ls /boot 


it will return all the installed images. Pick one or two and try to remove them. Try to force remove/purge them.
For example



sudo dpkg --force-all -P linux-image-3.13.0-32-generic


You can do the same for other images, in order to free up some space.



Then you can try to install the missing packages, or



sudo apt-get install -f 


to try resolve the dependencies.



Finally, issue the "cleanup old kernels" command



 sudo apt-get purge $(dpkg -l linux-{image,headers}-"[0-9]*" | awk '/ii/{print $2}' | grep -ve "$(uname -r | sed -r 's/-[a-z]+//')")


Above command will remove ALL the kernels except the one that is currently loaded.



Because you have a separate /boot partition, keep in mind you will need to track its space and cleaning up often (the frequency depends on the space of /boot)






share|improve this answer





















  • 1





    Hi when I try to remove them I get an error sudo dpkg --force-all -P abi-3.13.0-32-generic dpkg: warning: ignoring request to remove abi-3.13.0-32-generic which isn't installed

    – Philip Howard
    Feb 15 '15 at 13:48








  • 9





    This worked for me, with one modification: after removing kernel images with dpkg, I had to run sudo apt-get -f autoremove to get apt-get to stop complaining about unmet dependencies. Otherwise, sudo apt-get -f install apparently kept trying to re-install all the kernel images I'd removed with dpkg, which obviously just filled up /boot again.

    – mdunsmuir
    Jan 16 '17 at 20:15








  • 3





    After force purging and the apt-get -f autoremove in @mdunsmuir comment above, it still wants to install all the old kernels during any of the clean up operations above. Is there a way to just tell it to ignore unrelated dependencies and remove a single, complete old kernel?

    – NKijak
    Sep 16 '17 at 15:29






  • 3





    I'd like to add that I also had to uninstall the extras with sudo dpkg --force-all -P linux-image-extra-3.13.0-32-generic. Otherwise these extras still depend on the actual image and the -f flag would cause the image to be reinstalled and then running out of disk space.

    – Ghostkeeper
    Mar 21 '18 at 19:40






  • 1





    @LonnieBest I agree. In contrast, Arch Linux keeps only one fallback. Neither does Fedora seem to have this issue.

    – Franklin Yu
    Oct 1 '18 at 19:27














61












61








61







In such case I would use the dpkg tool to force the removal of some kernel packages.
This is not suggested for common use and is a bit dangerous, but in such case with unmet dependencies might help.



First of all locate the kernel in which the system is booted. The one that is currently loaded. Open a terminal (CTRL+ALT+T) and issue the following command



uname -r


It will show you the loaded kernel, you should NOT try to remove this one.



Then issue the command



ls /boot 


it will return all the installed images. Pick one or two and try to remove them. Try to force remove/purge them.
For example



sudo dpkg --force-all -P linux-image-3.13.0-32-generic


You can do the same for other images, in order to free up some space.



Then you can try to install the missing packages, or



sudo apt-get install -f 


to try resolve the dependencies.



Finally, issue the "cleanup old kernels" command



 sudo apt-get purge $(dpkg -l linux-{image,headers}-"[0-9]*" | awk '/ii/{print $2}' | grep -ve "$(uname -r | sed -r 's/-[a-z]+//')")


Above command will remove ALL the kernels except the one that is currently loaded.



Because you have a separate /boot partition, keep in mind you will need to track its space and cleaning up often (the frequency depends on the space of /boot)






share|improve this answer















In such case I would use the dpkg tool to force the removal of some kernel packages.
This is not suggested for common use and is a bit dangerous, but in such case with unmet dependencies might help.



First of all locate the kernel in which the system is booted. The one that is currently loaded. Open a terminal (CTRL+ALT+T) and issue the following command



uname -r


It will show you the loaded kernel, you should NOT try to remove this one.



Then issue the command



ls /boot 


it will return all the installed images. Pick one or two and try to remove them. Try to force remove/purge them.
For example



sudo dpkg --force-all -P linux-image-3.13.0-32-generic


You can do the same for other images, in order to free up some space.



Then you can try to install the missing packages, or



sudo apt-get install -f 


to try resolve the dependencies.



Finally, issue the "cleanup old kernels" command



 sudo apt-get purge $(dpkg -l linux-{image,headers}-"[0-9]*" | awk '/ii/{print $2}' | grep -ve "$(uname -r | sed -r 's/-[a-z]+//')")


Above command will remove ALL the kernels except the one that is currently loaded.



Because you have a separate /boot partition, keep in mind you will need to track its space and cleaning up often (the frequency depends on the space of /boot)







share|improve this answer














share|improve this answer



share|improve this answer








edited Feb 15 '15 at 13:51

























answered Feb 15 '15 at 13:39









NickTuxNickTux

14.1k54565




14.1k54565








  • 1





    Hi when I try to remove them I get an error sudo dpkg --force-all -P abi-3.13.0-32-generic dpkg: warning: ignoring request to remove abi-3.13.0-32-generic which isn't installed

    – Philip Howard
    Feb 15 '15 at 13:48








  • 9





    This worked for me, with one modification: after removing kernel images with dpkg, I had to run sudo apt-get -f autoremove to get apt-get to stop complaining about unmet dependencies. Otherwise, sudo apt-get -f install apparently kept trying to re-install all the kernel images I'd removed with dpkg, which obviously just filled up /boot again.

    – mdunsmuir
    Jan 16 '17 at 20:15








  • 3





    After force purging and the apt-get -f autoremove in @mdunsmuir comment above, it still wants to install all the old kernels during any of the clean up operations above. Is there a way to just tell it to ignore unrelated dependencies and remove a single, complete old kernel?

    – NKijak
    Sep 16 '17 at 15:29






  • 3





    I'd like to add that I also had to uninstall the extras with sudo dpkg --force-all -P linux-image-extra-3.13.0-32-generic. Otherwise these extras still depend on the actual image and the -f flag would cause the image to be reinstalled and then running out of disk space.

    – Ghostkeeper
    Mar 21 '18 at 19:40






  • 1





    @LonnieBest I agree. In contrast, Arch Linux keeps only one fallback. Neither does Fedora seem to have this issue.

    – Franklin Yu
    Oct 1 '18 at 19:27














  • 1





    Hi when I try to remove them I get an error sudo dpkg --force-all -P abi-3.13.0-32-generic dpkg: warning: ignoring request to remove abi-3.13.0-32-generic which isn't installed

    – Philip Howard
    Feb 15 '15 at 13:48








  • 9





    This worked for me, with one modification: after removing kernel images with dpkg, I had to run sudo apt-get -f autoremove to get apt-get to stop complaining about unmet dependencies. Otherwise, sudo apt-get -f install apparently kept trying to re-install all the kernel images I'd removed with dpkg, which obviously just filled up /boot again.

    – mdunsmuir
    Jan 16 '17 at 20:15








  • 3





    After force purging and the apt-get -f autoremove in @mdunsmuir comment above, it still wants to install all the old kernels during any of the clean up operations above. Is there a way to just tell it to ignore unrelated dependencies and remove a single, complete old kernel?

    – NKijak
    Sep 16 '17 at 15:29






  • 3





    I'd like to add that I also had to uninstall the extras with sudo dpkg --force-all -P linux-image-extra-3.13.0-32-generic. Otherwise these extras still depend on the actual image and the -f flag would cause the image to be reinstalled and then running out of disk space.

    – Ghostkeeper
    Mar 21 '18 at 19:40






  • 1





    @LonnieBest I agree. In contrast, Arch Linux keeps only one fallback. Neither does Fedora seem to have this issue.

    – Franklin Yu
    Oct 1 '18 at 19:27








1




1





Hi when I try to remove them I get an error sudo dpkg --force-all -P abi-3.13.0-32-generic dpkg: warning: ignoring request to remove abi-3.13.0-32-generic which isn't installed

– Philip Howard
Feb 15 '15 at 13:48







Hi when I try to remove them I get an error sudo dpkg --force-all -P abi-3.13.0-32-generic dpkg: warning: ignoring request to remove abi-3.13.0-32-generic which isn't installed

– Philip Howard
Feb 15 '15 at 13:48






9




9





This worked for me, with one modification: after removing kernel images with dpkg, I had to run sudo apt-get -f autoremove to get apt-get to stop complaining about unmet dependencies. Otherwise, sudo apt-get -f install apparently kept trying to re-install all the kernel images I'd removed with dpkg, which obviously just filled up /boot again.

– mdunsmuir
Jan 16 '17 at 20:15







This worked for me, with one modification: after removing kernel images with dpkg, I had to run sudo apt-get -f autoremove to get apt-get to stop complaining about unmet dependencies. Otherwise, sudo apt-get -f install apparently kept trying to re-install all the kernel images I'd removed with dpkg, which obviously just filled up /boot again.

– mdunsmuir
Jan 16 '17 at 20:15






3




3





After force purging and the apt-get -f autoremove in @mdunsmuir comment above, it still wants to install all the old kernels during any of the clean up operations above. Is there a way to just tell it to ignore unrelated dependencies and remove a single, complete old kernel?

– NKijak
Sep 16 '17 at 15:29





After force purging and the apt-get -f autoremove in @mdunsmuir comment above, it still wants to install all the old kernels during any of the clean up operations above. Is there a way to just tell it to ignore unrelated dependencies and remove a single, complete old kernel?

– NKijak
Sep 16 '17 at 15:29




3




3





I'd like to add that I also had to uninstall the extras with sudo dpkg --force-all -P linux-image-extra-3.13.0-32-generic. Otherwise these extras still depend on the actual image and the -f flag would cause the image to be reinstalled and then running out of disk space.

– Ghostkeeper
Mar 21 '18 at 19:40





I'd like to add that I also had to uninstall the extras with sudo dpkg --force-all -P linux-image-extra-3.13.0-32-generic. Otherwise these extras still depend on the actual image and the -f flag would cause the image to be reinstalled and then running out of disk space.

– Ghostkeeper
Mar 21 '18 at 19:40




1




1





@LonnieBest I agree. In contrast, Arch Linux keeps only one fallback. Neither does Fedora seem to have this issue.

– Franklin Yu
Oct 1 '18 at 19:27





@LonnieBest I agree. In contrast, Arch Linux keeps only one fallback. Neither does Fedora seem to have this issue.

– Franklin Yu
Oct 1 '18 at 19:27













5














This is what worked for me on Ubuntu 16.04.



sudo apt autoremove --purge
sudo apt autoremove
sudo apt-get -f install
sudo apt-get upgrade





share|improve this answer


























  • This method worked for me.

    – Bok
    Oct 8 '18 at 14:16
















5














This is what worked for me on Ubuntu 16.04.



sudo apt autoremove --purge
sudo apt autoremove
sudo apt-get -f install
sudo apt-get upgrade





share|improve this answer


























  • This method worked for me.

    – Bok
    Oct 8 '18 at 14:16














5












5








5







This is what worked for me on Ubuntu 16.04.



sudo apt autoremove --purge
sudo apt autoremove
sudo apt-get -f install
sudo apt-get upgrade





share|improve this answer















This is what worked for me on Ubuntu 16.04.



sudo apt autoremove --purge
sudo apt autoremove
sudo apt-get -f install
sudo apt-get upgrade






share|improve this answer














share|improve this answer



share|improve this answer








edited Jan 15 '18 at 12:22









Melebius

5,09352041




5,09352041










answered Jan 15 '18 at 12:20









msamsa

5111




5111













  • This method worked for me.

    – Bok
    Oct 8 '18 at 14:16



















  • This method worked for me.

    – Bok
    Oct 8 '18 at 14:16

















This method worked for me.

– Bok
Oct 8 '18 at 14:16





This method worked for me.

– Bok
Oct 8 '18 at 14:16











2














List all kernels:



dpkg --list 'linux-image*'


Display current kernel:



uname -r


List all kernels EXCEPT current one:



dpkg -l linux-{image,headers}-"[0-9]*" | awk '/^ii/{ print $2}' | grep -v -e `uname -r | cut -f1,2 -d"-"` | grep -e '[0-9]'


Make sure your current kernel isn't on that list.



Remove all kernels EXCEPT current one:



dpkg -l linux-{image,headers}-"[0-9]*" | awk '/^ii/{ print $2}' | grep -v -e `uname -r | cut -f1,2 -d"-"` | grep -e '[0-9]' | xargs sudo apt-get -y purge


Clear other stuff:



sudo apt-get autoremove





share|improve this answer


























  • If it still gives you boot disk space error for installing/uninstalling files then directly remove one of old image from /boot directory, ls -lh /boot/*-3.13.0-119*; rm /boot/*-3.13.0-119*; NOTE: Please review current kernel image again before deleting any image.

    – Hemant Thorat
    Jul 10 '18 at 10:29


















2














List all kernels:



dpkg --list 'linux-image*'


Display current kernel:



uname -r


List all kernels EXCEPT current one:



dpkg -l linux-{image,headers}-"[0-9]*" | awk '/^ii/{ print $2}' | grep -v -e `uname -r | cut -f1,2 -d"-"` | grep -e '[0-9]'


Make sure your current kernel isn't on that list.



Remove all kernels EXCEPT current one:



dpkg -l linux-{image,headers}-"[0-9]*" | awk '/^ii/{ print $2}' | grep -v -e `uname -r | cut -f1,2 -d"-"` | grep -e '[0-9]' | xargs sudo apt-get -y purge


Clear other stuff:



sudo apt-get autoremove





share|improve this answer


























  • If it still gives you boot disk space error for installing/uninstalling files then directly remove one of old image from /boot directory, ls -lh /boot/*-3.13.0-119*; rm /boot/*-3.13.0-119*; NOTE: Please review current kernel image again before deleting any image.

    – Hemant Thorat
    Jul 10 '18 at 10:29
















2












2








2







List all kernels:



dpkg --list 'linux-image*'


Display current kernel:



uname -r


List all kernels EXCEPT current one:



dpkg -l linux-{image,headers}-"[0-9]*" | awk '/^ii/{ print $2}' | grep -v -e `uname -r | cut -f1,2 -d"-"` | grep -e '[0-9]'


Make sure your current kernel isn't on that list.



Remove all kernels EXCEPT current one:



dpkg -l linux-{image,headers}-"[0-9]*" | awk '/^ii/{ print $2}' | grep -v -e `uname -r | cut -f1,2 -d"-"` | grep -e '[0-9]' | xargs sudo apt-get -y purge


Clear other stuff:



sudo apt-get autoremove





share|improve this answer















List all kernels:



dpkg --list 'linux-image*'


Display current kernel:



uname -r


List all kernels EXCEPT current one:



dpkg -l linux-{image,headers}-"[0-9]*" | awk '/^ii/{ print $2}' | grep -v -e `uname -r | cut -f1,2 -d"-"` | grep -e '[0-9]'


Make sure your current kernel isn't on that list.



Remove all kernels EXCEPT current one:



dpkg -l linux-{image,headers}-"[0-9]*" | awk '/^ii/{ print $2}' | grep -v -e `uname -r | cut -f1,2 -d"-"` | grep -e '[0-9]' | xargs sudo apt-get -y purge


Clear other stuff:



sudo apt-get autoremove






share|improve this answer














share|improve this answer



share|improve this answer








edited May 21 '18 at 17:41









SurvivalMachine

1,4703920




1,4703920










answered May 21 '18 at 16:44









Hemant ThoratHemant Thorat

1412




1412













  • If it still gives you boot disk space error for installing/uninstalling files then directly remove one of old image from /boot directory, ls -lh /boot/*-3.13.0-119*; rm /boot/*-3.13.0-119*; NOTE: Please review current kernel image again before deleting any image.

    – Hemant Thorat
    Jul 10 '18 at 10:29





















  • If it still gives you boot disk space error for installing/uninstalling files then directly remove one of old image from /boot directory, ls -lh /boot/*-3.13.0-119*; rm /boot/*-3.13.0-119*; NOTE: Please review current kernel image again before deleting any image.

    – Hemant Thorat
    Jul 10 '18 at 10:29



















If it still gives you boot disk space error for installing/uninstalling files then directly remove one of old image from /boot directory, ls -lh /boot/*-3.13.0-119*; rm /boot/*-3.13.0-119*; NOTE: Please review current kernel image again before deleting any image.

– Hemant Thorat
Jul 10 '18 at 10:29







If it still gives you boot disk space error for installing/uninstalling files then directly remove one of old image from /boot directory, ls -lh /boot/*-3.13.0-119*; rm /boot/*-3.13.0-119*; NOTE: Please review current kernel image again before deleting any image.

– Hemant Thorat
Jul 10 '18 at 10:29




















draft saved

draft discarded




















































Thanks for contributing an answer to Ask Ubuntu!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f585736%2fcant-clean-a-full-boot-because-of-unmet-dependencies%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

mysqli_query(): Empty query in /home/lucindabrummitt/public_html/blog/wp-includes/wp-db.php on line 1924

How to change which sound is reproduced for terminal bell?

Can I use Tabulator js library in my java Spring + Thymeleaf project?