How to Delete Old Kernels in Ubuntu

How to delete old Kernels in Ubuntu; Remove old Kernels in Ubuntu Linux. Για το Ubuntu, first list the installed Kernels and then remove old Kernels via CLI/Terminal.

Remove Leftover Temp Files

Run the following command to delete leftover temporary files.

sudo rm -rv ${TMPDIR:-/var/tmp}/mkinitramfs-*

Βήμα 1

Find out the current version of Linux kernel being used on the system and then list all installed kernels on the said system. Να το πράξουν, run the following set of commands:

$ uname -sr
$ dpkg -l | grep linux-image | awk '{print$2}'

Βήμα 2

Run the following command to list all the kernels excluding the booted kernel in the package database, and their status.

dpkg -l | tail -n +6 | grep -E 'linux-image-[0-9]+' | grep -Fv $(uname -r)

Remove Old Kernels

Once the Kernel to be removed is identified, run the following commands. For the example, we will remove Linux Kernel 4.2.0-15:


sudo update-initramfs -d -k 4.2.0-15-generic
sudo dpkg --purge linux-image-4.2.0-15-generic linux-image-extra-4.2.0-15-generic
sudo dpkg --purge linux-headers-4.2.0-15-generic
sudo dpkg --purge linux-headers-4.2.0-15
sudo apt-get -f install
$ sudo update-grub2
$ sudo reboot

How to Delete Old Kernels in Ubuntu αρχικά δημοσιεύτηκε στις Πηγή ψηφίο - Τελευταίας τεχνολογίας, Gadgets & Gizmos.

Σχετικά Άρθρα

Αφήνω μια απάντηση

Η διεύθυνση email σας δεν θα δημοσιευθεί. τα απαιτούμενα πεδία είναι επισημασμένα *

Κλείστε