by Devin Yang
(This article was automatically translated.)

Published - 6 years ago ( Updated - 6 years ago )

During this process, I actually perform the process of clearing the old Kernel on ubuntu.

automatically remove

The command below can automatically remove unused Kernels.
sudo apt autoremove
 

​​​​​​Manual removal

1. View the Kernel in use
uname -r
View the currently used kernel, such as my current Kernel
4.4.0-104-generic

Do not remove the Kernel in use!

2. View all kernels in the system.
dpkg --list | grep linux-image


3. Remove unwanted old versions of Kernel
I want to remove multiple brace expansions that can be used in bash.
sudo apt-get purge linux-image-4.4.0-9{2,6,7}-generic
The command above removes three at a time.
linux-image-4.4.0-92-generic
linux-image-4.4.0-96-generic
linux-image-4.4.0-97-generic

If we only want to remove a specific kernel on the system.
sudo apt-get purge linux-image-4.4.0-93-generic

4. Update grub2. (linux boot loader)
update-grub2

5. Restart the system
reboot

Tags: linux

Devin Yang

Feel free to ask me, if you don't get it.:)

No Comment

Post your comment

Login is required to leave comments

Similar Stories


linux

About setfacl

I think most of the current Linux supports Access Control List (ACL). With filesystem ACLs enabled, We can set additional permissions to different users or groups. This allows us to set the file system permissions of different users more freely. Go straight to the command.

cli,linux,macos

How to use find to delete old files based on the creation time

This function is very useful, but be very careful, read it first and then delete it, if you make a wrong directory, you will die miserably 

php,linux

WebShell Function Introduction and Precautions

I suddenly wanted to introduce what is WebShell, so I found one on the Internet. Its functions are quite good. But I still wanted some features, so I spent three nights making some small optimizations for him. If you haven't heard of WebShell yet, take a look at this video. If you like my optimized version, please give me a like, thank you.