Too many old kernels and /boot partition full - Dependencies pbs with old kernel image preventing clean up

Questions about applications and software
Forum rules
Before you post please read how to get help
gm10
Level 9
Level 9
Posts: 2597
Joined: Thu Jun 21, 2018 5:11 pm

Re: Too many old kernels and /boot partition full - Dependencies pbs with old kernel image preventing clean up

Post by gm10 » Thu Aug 16, 2018 3:37 pm

w7fzy wrote:
Thu Aug 16, 2018 3:20 pm
Hijacked?
Interesting.
Usually, when you start a new post on forums you are flamed for not doing a search for the same problem. I didn't do anything to my computer and since I'm not experienced, I figured I WAS following the forum rules of doing a search first. I've never been reprimanded for doing a search and finding what I think is the correct post and asking a question. Until now.
Well, you could argue my response was a bit terse, but it started with a "please" and ended on a "happy to help" if you just made your own thread. That's pretty far from a flame.

As I said, your problem is not the same. OP has a package management system malfunction due to a full /boot partition. You don't even have a /boot partition. Your problem is just that you need to clear some space on your / root partition. Other than a full partition there's no relation. So please don't continue being disrespectful to the OP of this thread and those trying to help him, just make your own thread and we can help you.

w7fzy
Level 1
Level 1
Posts: 23
Joined: Mon Oct 10, 2016 12:00 am

Re: Too many old kernels and /boot partition full - Dependencies pbs with old kernel image preventing clean up

Post by w7fzy » Thu Aug 16, 2018 3:45 pm

So please don't continue being disrespectful to the OP of this thread and those trying to help him, just make your own thread and we can help you.
Now I'm being disrespectful for doing a search and thinking my problem is the same?
Time flies like an arrow.
Fruit flies like a banana.

gm10
Level 9
Level 9
Posts: 2597
Joined: Thu Jun 21, 2018 5:11 pm

Re: Too many old kernels and /boot partition full - Dependencies pbs with old kernel image preventing clean up

Post by gm10 » Thu Aug 16, 2018 3:48 pm

w7fzy wrote:
Thu Aug 16, 2018 3:45 pm
Now I'm being disrespectful for doing a search and thinking my problem is the same?
No, for perpetuating this here after I told you twice now that it isn't the same problem. This thread is now being side-tracked, which is exactly what I wanted to prevent. Imagine someone did this in a thread you created and are seeking help in?

Bildo
Level 1
Level 1
Posts: 8
Joined: Wed Aug 15, 2018 4:14 am

Re: Too many old kernels and /boot partition full - Dependencies pbs with old kernel image preventing clean up

Post by Bildo » Fri Aug 17, 2018 3:54 am

Hello,

I just passed the latest commands you mentionned in the thread before.

Code: Select all

~ $ ls /boot
abi-4.15.0-29-generic         memtest86+.bin
config-4.15.0-29-generic      memtest86+.elf
grub                          memtest86+_multiboot.bin
initrd.img-4.10.0-40-generic  retpoline-4.15.0-29-generic
initrd.img-4.15.0-29-generic  System.map-4.15.0-29-generic
lost+found                    vmlinuz-4.15.0-29-generic
There is still a file related to linux image 4.10.0.40 remaining ...

Code: Select all

 $ apt list --installed linux-*
En train de lister... Fait
linux-base/xenial-updates,xenial-updates,xenial-security,xenial-security,now 4.5ubuntu1~16.04.1 all  [installé]
linux-firmware/xenial-updates,xenial-updates,now 1.157.20 all  [installé]
linux-headers-4.13.0-36/xenial-updates,xenial-updates,xenial-security,xenial-security,now 4.13.0-36.40~16.04.1 all  [installé]
linux-headers-4.13.0-36-generic/xenial-updates,xenial-security,now 4.13.0-36.40~16.04.1 amd64  [installé]
linux-headers-4.13.0-37/xenial-updates,xenial-updates,xenial-security,xenial-security,now 4.13.0-37.42~16.04.1 all [installé, pouvant être supprimé automatiquement]
linux-headers-4.13.0-37-generic/xenial-updates,xenial-security,now 4.13.0-37.42~16.04.1 amd64 [installé, pouvant être supprimé automatiquement]
linux-headers-4.13.0-45/xenial-updates,xenial-updates,xenial-security,xenial-security,now 4.13.0-45.50~16.04.1 all  [installé, automatique]
linux-headers-4.13.0-45-generic/xenial-updates,xenial-security,now 4.13.0-45.50~16.04.1 amd64  [installé, automatique]
linux-headers-4.15.0-29/xenial-updates,xenial-updates,xenial-security,xenial-security,now 4.15.0-29.31~16.04.1 all  [installé, automatique]
linux-headers-4.15.0-29-generic/xenial-updates,xenial-security,now 4.15.0-29.31~16.04.1 amd64  [installé, automatique]
linux-image-4.13.0-36-generic/xenial-updates,xenial-security,now 4.13.0-36.40~16.04.1 amd64  [installé]
linux-image-4.13.0-37-generic/xenial-updates,xenial-security,now 4.13.0-37.42~16.04.1 amd64 [installé, pouvant être supprimé automatiquement]
linux-image-4.13.0-45-generic/xenial-updates,xenial-security,now 4.13.0-45.50~16.04.1 amd64  [installé, automatique]
linux-image-4.15.0-29-generic/xenial-updates,xenial-security,now 4.15.0-29.31~16.04.1 amd64  [installé, automatique]
linux-image-extra-4.13.0-36-generic/xenial-updates,xenial-security,now 4.13.0-36.40~16.04.1 amd64  [installé]
linux-image-extra-4.13.0-37-generic/xenial-updates,xenial-security,now 4.13.0-37.42~16.04.1 amd64 [installé, pouvant être supprimé automatiquement]
linux-image-extra-4.13.0-45-generic/xenial-updates,xenial-security,now 4.13.0-45.50~16.04.1 amd64  [installé, automatique]
linux-libc-dev/xenial-updates,xenial-security,now 4.4.0-133.159 amd64  [installé]
linux-modules-4.15.0-29-generic/xenial-updates,xenial-security,now 4.15.0-29.31~16.04.1 amd64  [installé, automatique]
linux-modules-extra-4.15.0-29-generic/xenial-updates,xenial-security,now 4.15.0-29.31~16.04.1 amd64  [installé, automatique]
linux-sound-base/xenial,xenial,now 1.0.25+dfsg-0ubuntu5 all  [installé]

gm10
Level 9
Level 9
Posts: 2597
Joined: Thu Jun 21, 2018 5:11 pm

Re: Too many old kernels and /boot partition full - Dependencies pbs with old kernel image preventing clean up

Post by gm10 » Fri Aug 17, 2018 4:20 am

Looking good. Two more commands to run and your spring cleaning will be all done. :)

Code: Select all

sudo rm /boot/initrd.img-4.10.0-40-generic
apt purge linux-*4.13*

User avatar
catweazel
Level 16
Level 16
Posts: 6930
Joined: Fri Oct 12, 2012 9:44 pm
Location: Australian Antarctic Territory

Re: Too many old kernels and /boot partition full - Dependencies pbs with old kernel image preventing clean up

Post by catweazel » Fri Aug 17, 2018 4:26 am

gm10 wrote:
Fri Aug 17, 2018 4:20 am
Looking good. Two more commands to run and your spring cleaning will be all done. :)

Code: Select all

sudo rm /boot/initrd.img-4.10.0-40-generic
apt purge linux-*4.13*
Don't mind me. I'm just seeing if there's anything around that you can be blamed for.

viewtopic.php?p=1511871#p1512405

:)
Caution: Dancing Wu Li Master and Official curmudgeon-in-chief

gm10
Level 9
Level 9
Posts: 2597
Joined: Thu Jun 21, 2018 5:11 pm

Re: Too many old kernels and /boot partition full - Dependencies pbs with old kernel image preventing clean up

Post by gm10 » Fri Aug 17, 2018 4:28 am

catweazel wrote:
Fri Aug 17, 2018 4:26 am
gm10 wrote:
Fri Aug 17, 2018 4:20 am
Looking good. Two more commands to run and your spring cleaning will be all done. :)

Code: Select all

sudo rm /boot/initrd.img-4.10.0-40-generic
apt purge linux-*4.13*
Don't mind me. I'm just seeing if there's anything around that you can be blamed for.

viewtopic.php?p=1511871#p1512405

:)
That is the most random post I've seen you make yet, and that is to say something. lmfao. I shall wander over and give you some attention. <3

Bildo
Level 1
Level 1
Posts: 8
Joined: Wed Aug 15, 2018 4:14 am

Re: Too many old kernels and /boot partition full - Dependencies pbs with old kernel image preventing clean up

Post by Bildo » Sun Aug 19, 2018 7:15 am

gm10 wrote:
Fri Aug 17, 2018 4:20 am
Looking good. Two more commands to run and your spring cleaning will be all done. :)

Code: Select all

sudo rm /boot/initrd.img-4.10.0-40-generic
apt purge linux-*4.13*
Done. Thx for help.
I got back almost 1Gig of space thanks to that cleaning. I really should learn how to do this cleaning properly each time I upgrade the kernel of my system.
I would like to know the easiest way of doing this ...

Thx

gm10
Level 9
Level 9
Posts: 2597
Joined: Thu Jun 21, 2018 5:11 pm

Re: Too many old kernels and /boot partition full - Dependencies pbs with old kernel image preventing clean up

Post by gm10 » Sun Aug 19, 2018 8:43 am

Bildo wrote:
Sun Aug 19, 2018 7:15 am
Done. Thx for help.
I got back almost 1Gig of space thanks to that cleaning. I really should learn how to do this cleaning properly each time I upgrade the kernel of my system.
I would like to know the easiest way of doing this ...
You can just automate it. Run this to create a script that cleans out your old kernels automatically once a week:

Code: Select all

echo "dpkg-query -W -f '\${Version}\n' 'linux-image-[^g]*'|sort -u|sed -e '/^$/d' -e 's/\~[^~]*$//' -e 's/\.[^.]*$//' -e \"/\$(uname -r|sed 's/-generic//')/d\" -e 's/.*/linux-*-&*/'|tr '\n' ' '|xargs -r apt-get remove --purge -y"|sudo tee /etc/cron.weekly/purge_old_kernels
Make it executable like this:

Code: Select all

sudo chmod +x /etc/cron.weekly/purge_old_kernels
To stop the automation again, run

Code: Select all

sudo rm /etc/cron.weekly/purge_old_kernels
And you're welcome. ;)

Post Reply

Return to “Software & Applications”