Sunday, May 19, 2024
 Popular · Latest · Hot · Upcoming
10
rated 0 times [  10] [ 0]  / answers: 1 / hits: 6330  / 1 Year ago, mon, january 23, 2023, 6:20:15

I have a /boot overload.
Tried to follow /dev/sda1 /boot is full, but got stuck.



History:



df
Filesystem 1K-blocks Used Available Use% Mounted on
udev 485360 0 485360 0% /dev
tmpfs 100744 10824 89920 11% /run
/dev/mapper/vg00-lv01 49011528 7513836 39300100 17% /
tmpfs 503716 0 503716 0% /dev/shm
tmpfs 5120 0 5120 0% /run/lock
tmpfs 503716 0 503716 0% /sys/fs/cgroup
/dev/sda1 474730 466955 0 100% /boot

dpkg --list | grep linux-image

ii linux-image-4.4.0-21-generic 4.4.0-21.37 amd64 Linux kernel image for version 4.4.0 on 64 bit x86 SMP
ii linux-image-4.4.0-59-generic 4.4.0-59.80 amd64 Linux kernel image for version 4.4.0 on 64 bit x86 SMP
ii linux-image-4.4.0-62-generic 4.4.0-62.83 amd64 Linux kernel image for version 4.4.0 on 64 bit x86 SMP
ii linux-image-4.4.0-63-generic 4.4.0-63.84 amd64 Linux kernel image for version 4.4.0 on 64 bit x86 SMP
ii linux-image-4.4.0-64-generic 4.4.0-64.85 amd64 Linux kernel image for version 4.4.0 on 64 bit x86 SMP
ii linux-image-4.4.0-66-generic 4.4.0-66.87 amd64 Linux kernel image for version 4.4.0 on 64 bit x86 SMP
ii linux-image-4.4.0-67-generic 4.4.0-67.88 amd64 Linux kernel image for version 4.4.0 on 64 bit x86 SMP
ii linux-image-4.4.0-70-generic 4.4.0-70.91 amd64 Linux kernel image for version 4.4.0 on 64 bit x86 SMP
ii linux-image-4.4.0-71-generic 4.4.0-71.92 amd64 Linux kernel image for version 4.4.0 on 64 bit x86 SMP
ii linux-image-4.4.0-72-generic 4.4.0-72.93 amd64 Linux kernel image for version 4.4.0 on 64 bit x86 SMP
ii linux-image-extra-4.4.0-21-generic 4.4.0-21.37 amd64 Linux kernel extra modules for version 4.4.0 on 64 bit x86 SMP
ii linux-image-extra-4.4.0-59-generic 4.4.0-59.80 amd64 Linux kernel extra modules for version 4.4.0 on 64 bit x86 SMP
ii linux-image-extra-4.4.0-62-generic 4.4.0-62.83 amd64 Linux kernel extra modules for version 4.4.0 on 64 bit x86 SMP
ii linux-image-extra-4.4.0-63-generic 4.4.0-63.84 amd64 Linux kernel extra modules for version 4.4.0 on 64 bit x86 SMP
ii linux-image-extra-4.4.0-64-generic 4.4.0-64.85 amd64 Linux kernel extra modules for version 4.4.0 on 64 bit x86 SMP
ii linux-image-extra-4.4.0-66-generic 4.4.0-66.87 amd64 Linux kernel extra modules for version 4.4.0 on 64 bit x86 SMP
ii linux-image-extra-4.4.0-67-generic 4.4.0-67.88 amd64 Linux kernel extra modules for version 4.4.0 on 64 bit x86 SMP
ii linux-image-extra-4.4.0-70-generic 4.4.0-70.91 amd64 Linux kernel extra modules for version 4.4.0 on 64 bit x86 SMP
ii linux-image-extra-4.4.0-71-generic 4.4.0-71.92 amd64 Linux kernel extra modules for version 4.4.0 on 64 bit x86 SMP
iF linux-image-extra-4.4.0-72-generic 4.4.0-72.93 amd64 Linux kernel extra modules for version 4.4.0 on 64 bit x86 SMP
iU linux-image-extra-4.4.0-75-generic 4.4.0-75.96 amd64 Linux kernel extra modules for version 4.4.0 on 64 bit x86 SMP
iU linux-image-generic 4.4.0.75.81 amd64 Generic Linux kernel image


!!! wow, so much, how could this happen ?



And then:



uname -r
4.4.0-21-generic


Trials to purge unused images:



apt-get purge linux-image-4.4.0-59-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-4.4.0-59-generic : Depends: linux-image-4.4.0-59-generic but it is not going to be installed
linux-image-extra-4.4.0-75-generic : Depends: linux-image-4.4.0-75-generic but it is not going to be installed
linux-image-generic : Depends: linux-image-4.4.0-75-generic but it is not going to be installed
Recommends: thermald but it is not going to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).


Anyone got an idea?


More From » boot

 Answers
6

Removing old kernels to free space in /boot partition



If your system is running using an old kernel (usually the newest kernel boots by default) you should boot from the newest kernel installed, which seems to be linux-image-4.4.0-72-generic in your case.



Select it from the GRUB menu (hold or repeatedly press Shift during boot if GRUB doesn't show at all).



When you have booted from your newest kernel, first run sudo apt-get -f install, trying to fix the unmet dependencies issues, if it works go on with any of the first two method below; if it fails jump to manual package purge.



The apt way



Try to correctly manage the space issue with apt:




  • Run sudo apt autoclean && sudo apt autoremove, apt should correctly manage removing all old-kernels and related packages if you haven't messed too much with it.



Using purge_old_kernels from byobu package



If the apt way doesn't work or it doesn't remove enough space:




  • Install byobu running sudo apt install byobu.

  • Then run sudo purge-old-kernels, which should remove old kernels in a cleaner way than directly purging packages.



Manual package purge



If any oh the above worked:




  • Purge the oldest (not running) kernel with sudo apt-get purge linux-image-4.4.0-21-generic && sudo update-grub.

  • Reboot and boot from the newest kernel available.

  • Run sudo apt-get -f install.

  • Run sudo apt update && sudo apt full-upgrade.

  • Reboot using your newest kernel.

  • Clean older kernels, via The apt way and/or _purge_old_kernels_.



The dpkg way



As a last resort, you can try to do it in the dpkg way which isn't the safest.




  • Run from your terminal (running from your newest installed kernel):



    echo $(dpkg --list | grep linux-image | awk '{ print $2 }' | sort -V | sed -n '/'`uname -r`'/q;p') $(dpkg --list | grep linux-headers | awk '{ print $2 }' | sort -V | sed -n '/'"$(uname -r | sed "s/([0-9.-]*)-([^0-9]+)/1/")"'/q;p') | xargs sudo apt-get -y purge


    Borrowed from this response.


  • Reboot your system and run sudo apt-get -f install


  • Do a full upgrade with sudo apt update && sudo apt full-upgrade.

  • Reboot if needed (new kernel¿?) and go with the apt way: sudo apt autoclean && sudo apt autoremove.

  • Run sudo purge_old_kernels, command from byoby package if still remains any old kernel version (in addition to the current and previous version which are always kept as a safety precaution).


[#11415] Tuesday, January 24, 2023, 1 Year  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
variark

Total Points: 82
Total Questions: 114
Total Answers: 122

Location: Sweden
Member since Mon, May 8, 2023
1 Year ago
;