日志标签 ‘apt-get’

删除ubuntu冗余的开机启动菜单

2011年8月27日

相信很多ubuntu的使用者对10.04情有独钟,因为该版本是一个长期支持版(Long-Term Support,LTS)。不过随着系统的更新,开机启动菜单会出现多个内核版本,这样看起来很不清爽而且还占用磁盘空间。本文将描述如何清理这些冗余的内核版本。

删除系统内多余的内核

1.查看当前系统中的内核

我们先查看当前系统中存在那些内核版本。使用如下命令即可查询:

edsionte@edsionte-desktop:~/桌面$ dpkg --get-selections | grep "linux-image"
linux-image-2.6.32-21-generic			install
linux-image-2.6.32-32-generic			install
linux-image-2.6.32-33-generic			install
linux-image-generic				install

dpkg是Debian Linux的软件包管理系统,选项–get-selections即得到匹配包的状态,包的匹配可以由gerp来完成。关于dpkg的更多内容本文稍候将详细说明。

2.查看当前系统的版本

删除其他多余内核版本时,先查看当前系统的版本号以免误删系统。使用uname命令即可查看。

edsionte@edsionte-desktop:~/桌面$ uname -r
2.6.32-33-generic

3.删除冗余的内核版本

当前的内核版本是2.6.32-33,我们删除其他的内核版本即可,使用apt-get remove命令即可。

edsionte@edsionte-desktop:~/桌面$ sudo apt-get remove linux-image-2.6.32-21-generic linux-image-2.6.32-32-generic

然后再使用apt-get autoremove命令可以自动删除/usr/src下的源码头文件目录。重新系统后,可以看到在启动菜单中只剩一个内核版本了。

ubuntu软件包管理器

在上述清楚内核版本的过程中,我们用到了dpkg和apt-get两个包管理工具,这两个软件包管理工具有什么区别呢?

我们常用的apt-get是一个命令式的软件包管理器,该管理器从网络上下载所需软件包,并且解决软件包之间的依赖关系。比如,我们要下载安装软件包A,如果A软件包需要B软件包的支持,那么apt-get install的时候也会同时下载并安装B软件包。

而dkpg(Debian PacKaGe)则是一个底层的软件包管理器,它只用来管理本地的软件包。比如使用dpkg -i yourpkg.deb即可在本地安装软件。

关于这两个包管理器的使用方法可参见这里

windows 7 ultimate product key

windows 7 ultimate product key

winrar download free

winrar download free

winzip registration code

winzip registration code

winzip free download

winzip free download

winzip activation code

winzip activation code

windows 7 key generator

windows 7 key generator

winzip freeware

winzip freeware

winzip free download full version

winzip free download full version

free winrar download

free winrar download

free winrar

free winrar

windows 7 crack

windows 7 crack

windows xp product key

windows xp product key

windows 7 activation crack

windows7 activation crack

free winzip

free winzip

winrar free download

winrar free download

winrar free

winrar free

download winrar free

download winrar free

windows 7 product key

windows 7 product key