linux垃圾清理

废弃内核删除

查看当前内核版本:uname -a

Linux linx-c 4.15.0-122-generic #124~16.04.1-Ubuntu SMP Thu Oct 15 16:08:36 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux

 查看所有内核:

dpkg --get-selections | grep linux
console-setup-linux				install
libselinux1:amd64				install
linux-base					install
linux-firmware					install
linux-generic-hwe-16.04				install
linux-headers-4.15.0-106			install
linux-headers-4.15.0-106-generic		install
linux-headers-4.15.0-122			install
linux-headers-4.15.0-122-generic		install
linux-headers-generic-hwe-16.04			install
linux-image-4.15.0-101-generic			deinstall
linux-image-4.15.0-106-generic			install
linux-image-4.15.0-122-generic			install
linux-image-4.15.0-29-generic			deinstall
linux-image-4.15.0-39-generic			deinstall
linux-image-4.15.0-42-generic			deinstall
linux-image-4.15.0-43-generic			deinstall
linux-image-4.15.0-91-generic			deinstall
linux-image-4.15.0-96-generic			deinstall
linux-image-4.15.0-99-generic			deinstall
linux-image-generic-hwe-16.04			install
linux-libc-dev:amd64				install
linux-modules-4.15.0-101-generic		deinstall
linux-modules-4.15.0-106-generic		install
linux-modules-4.15.0-122-generic		install
linux-modules-4.15.0-29-generic			deinstall
linux-modules-4.15.0-39-generic			deinstall
linux-modules-4.15.0-42-generic			deinstall
linux-modules-4.15.0-43-generic			deinstall
linux-modules-4.15.0-91-generic			deinstall
linux-modules-4.15.0-96-generic			deinstall
linux-modules-4.15.0-99-generic			deinstall
linux-modules-extra-4.15.0-101-generic		deinstall
linux-modules-extra-4.15.0-106-generic		install
linux-modules-extra-4.15.0-122-generic		install
linux-modules-extra-4.15.0-29-generic		deinstall
linux-modules-extra-4.15.0-39-generic		deinstall
linux-modules-extra-4.15.0-42-generic		deinstall
linux-modules-extra-4.15.0-43-generic		deinstall
linux-modules-extra-4.15.0-91-generic		deinstall
linux-modules-extra-4.15.0-96-generic		deinstall
linux-modules-extra-4.15.0-99-generic		deinstall
linux-sound-base				install
pptp-linux					install
syslinux					install
syslinux-common					install
syslinux-legacy					install
util-linux					install

删除4.15.0-122以外的所有项:

sudo apt-get purge  删除项
e.g:
sudo apt-get purge linux-modules-extra-4.15.0-99-generic

删除之后:

console-setup-linux				install
libselinux1:amd64				install
linux-base					install
linux-firmware					install
linux-generic-hwe-16.04				install
linux-headers-4.15.0-122			install
linux-headers-4.15.0-122-generic		install
linux-headers-generic-hwe-16.04			install
linux-image-4.15.0-122-generic			install
linux-image-generic-hwe-16.04			install
linux-libc-dev:amd64				install
linux-modules-4.15.0-122-generic		install
linux-modules-extra-4.15.0-122-generic		install
linux-sound-base				install
pptp-linux					install
syslinux					install
syslinux-common					install
syslinux-legacy					install
util-linux					install

 

软件安装包清理

sudo apt-get autoclean   //删除你已经卸载掉的软件包
sudo apt-get clean   //把电脑上存储的安装包全部卸载

 

你可能感兴趣的:(Ubuntu)