I've written a new post that shows a bash one-liner command that will
remove the old kernels from your system in one step. You can check it
out here
.
我写了一篇文章,显示一个一行的bash命令,教你用一步删除您系统旧的内核。你可以看看这里
。
If you've been using Ubuntu Linux
for a while, then you probably have a number of Linux kernel updates
that have been installed on your system. (I've got a total of 3 kernels
in my Karmic system already.) In all likelihood, these updates get
installed and you boot into the latest kernel, never to use the older
kernels again. But these old kernels are still hanging around on your
system, cluttering up your grub boot screen and taking up space on your
hard drive.
如果你已经使用了一段时间的Ubuntu
Linux,那么您可能有在更新的时候在你的系统上安装了好几个Linux内核里(在我的Karmic版本我都有总共三个内核版本了)。有很大的可能性,
这些更新的Linux版内核自从安装到你的电脑上,你永远不会再用旧的内核了。但是这些旧内核仍然徘徊在你的系统,搞乱你的grub开机画面并且占用了您
的硬盘驱动器空间。
There have been attempts made to create an automatic tool
to clean these up for you along with much discussion on the Ubuntu Forums
, but so far there's nothing officially in the repositories.
目前在Ubuntu论坛大量讨论尝试制作一个自动的工具来清洁这些,但至今还没有什么正式的仓库。
In the past, I've gone into Synaptic and searched for the older
kernels and related packages and manually marked them for removal. This
method works fine, but the search process is a little slow in Synaptic
and you have to run a few searches to catch all of the packages to
remove. I decided to come up with a way to do this from the terminal and
hopefully save some time. The commands I'm going to use can be a bit
daunting, so just copy and paste.
在过去,我总是进入新立得搜索和手动标记为删除旧的内核和相关的包。此方法效果很好,但是搜索过程是一个漫长的过程,你必须运行少量搜索,捕捉所有的软件
包删除。我决定想出一个办法做到这一点,希望节省一些时间。我使用的这些令可能会有点吓人,所以只要复制并粘贴就可以了。
Warning
Don't
follow this process unless you're sure you don't need to boot into the
older kernels. If you're not sure, just leave things alone. Also, it is
possible to remove all of the kernels from your system and make it
unbootable. I suggest leaving the latest kernel and one version previous
to that. You can find out the kernel version that you're currently
running with
除非你确定你不需要到老内核启动,否则别这样做。如果你不太确定,最好也别接下来的操作。此外,它可以从系统中删除所有的内核,使之无法启动。我强烈建议你保留最新版本的内核和一个最新的版本的前一个版本。你可以通过下边的命令找到你电脑上的内核的版本信息
Find and remove old kernels
The first step is to figure out what kernels are installed. The following command will do the job.
第一步是配置出什么内核需要安装,运行下边的命令
ls /boot | grep vmlinuz | cut -d'-' -f2,3
Your result should look something like this.
运行之后你的结果可能是这样的
2.6.28-15
2.6.28-16
2.6.28-17
This is the list of kernels installed on your system. Now you want to
find out which packages are installed relative to the kernel you want
to remove. For my example I'm going to remove the oldest one, 2.6.28-15.
这个列表列出的是你的系统中安装的内横,现在你就应该找到你想删除的内核的关联包了,例如我想删除最老的版本2.6.28-15。
dpkg -l | grep ^ii | grep 2.6.28-15 | awk -F' ' '{ print $2 }'
On my system, (Jaunty) the resulting list is:
在我的系统上,出现这样的结果
linux-headers-2.6.28-15
linux-headers-2.6.28-15-generic
linux-image-2.6.28-15-gener
linux-restricted-modules-2.6.28-15-generic
Now that we know what packages to remove we can remove them with dpkg, apt-get or aptitude.
现在我们知道我们要上出的包了,并且用命令dpkg,apt-get或者aptitude。
sudo aptitude remove linux-headers-2.6.28-15 linux-headers-2.6.28-15-generic linux-image-2.6.28-15-generic linux-restricted-modules-2.6.28-15-generic
That's it. You've removed an old kernel and related packages. Now you
can keep your system as clean as it is right after you install Ubuntu.
The commands are a bit complex, so maybe I'll write up a bash script
when I have some time. Proceed with caution!
就是这样的,你已经删除里老的内核还有关联的包资源了,现在你就可以保持
你的
干净的系统
,因为它是
你
安装唯一的Ubuntu
。
该
命令是
有点复杂
,
所以如果
我有
时间
也许
我会写
了一个
bash脚本
时
。
谨慎行事
!
下边是我删除内核的shell文字
txlong@txlong-K40AB:~$ sudo -s
[sudo] password for txlong:
root@txlong-K40AB:~# aptitude remove linux-image-2.6.35-22-generic
下列软件包将被“删除”:
linux-image-2.6.35-22-generic
0 个软件包被升级,新安装 0 个, 1 个将被删除, 同时 0 个将不升级。
需要获取 0B 的存档。 解包后将释放 107MB。
(正在读取数据库 ... 系统当前共安装有 129056 个文件和目录。)
正在卸载 linux-image-2.6.35-22-generic ...
Examining /etc/kernel/postrm.d .
run-parts: executing /etc/kernel/postrm.d/initramfs-tools 2.6.35-22-generic /boot/vmlinuz-2.6.35-22-generic
run-parts: executing /etc/kernel/postrm.d/zz-update-grub 2.6.35-22-generic /boot/vmlinuz-2.6.35-22-generic
Generating grub.cfg ...
Found linux image: /boot/vmlinuz-2.6.35-28-generic
Found initrd image: /boot/initrd.img-2.6.35-28-generic
Found memtest86+ image: /boot/memtest86+.bin
Found Windows 7 (loader) on /dev/sda2
done
The link /vmlinuz.old is a damaged link
Removing symbolic link vmlinuz.old
you may need to re-run your boot loader[grub]
The link /initrd.img.old is a damaged link
Removing symbolic link initrd.img.old
you may need to re-run your boot loader[grub]
root@txlong-K40AB:~#
使用Ubuntu一段时间后,就会发觉由于自动升级,系统里安装了很多内核。
像我,竟然安装了下面那么多,这个造成了漫长的启动列表。必须删掉一些不用的。
首先就是使用如下命令,列出所有安装的内核,下表中,带有image的就是内核文件。
从中选择要卸载的包,用apt-get来卸载
[tc@ibm:~]$ dpkg --get-selections|grep linux
libselinux1 install
linux-386 install
linux-image-2.6.15-23-386 install
linux-image-2.6.15-27-386 install
linux-image-2.6.15-27-686 install
linux-image-2.6.15-28-386 install
linux-image-2.6.15-28-686 deinstall
linux-image-386 install
linux-kernel-headers install
linux-restricted-modules-2.6.15-23-386 install
linux-restricted-modules-2.6.15-27-386 install
linux-restricted-modules-2.6.15-27-686 install
linux-restricted-modules-2.6.15-28-386 install
linux-restricted-modules-2.6.15-28-686 deinstall
linux-restricted-modules-386 install
linux-restricted-modules-common install
linux-sound-base install
util-linux install
具体的卸载方法为
sudo apt-get remove linux-image-2.6.15-23-386
这样就可以实现自动删除内核文件了,还可以释放磁盘空间。
另外还要记录一个命令。
uname -a
使用这个命令可以查看当前系统使用的内核。
分享到:
相关推荐
Changes in 2.4.6 (February 22, 2011): Brief summary : - Support more host OS to run on: - Include win64 native binary in the release. - Fixed failures on big endian hosts. - BIOS: Support for up to...
scratch少儿编程逻辑思维游戏源码-工厂逃生.zip
房地产 -辉盛阁项目介绍.pptx
少儿编程scratch项目源代码文件案例素材-新拉力赛.zip
scratch少儿编程逻辑思维游戏源码-混乱弹球.zip
scratch少儿编程逻辑思维游戏源码-过马路.zip
少儿编程scratch项目源代码文件案例素材-侠盗地牢冒险.zip
少儿编程scratch项目源代码文件案例素材-我的领土.zip
scratch少儿编程逻辑思维游戏源码-机器人闯关.zip
少儿编程scratch项目源代码文件案例素材-天空中的英雄.zip
少儿编程scratch项目源代码文件案例素材-突击尖峰.zip
“即刻青旅”前景广阔,随着青年旅舍行业快速发展,2030年市场规模预计达650亿。创作旨在为年轻旅行者打造专属平台,填补国内专门青旅预定空白。融合微信小程序、Spring Boot等技术,实现青旅查询预定、订单管理、活动职位查看及社区分享等功能。 后端框架: 基于Java的SpringBoot快速开发框架 借助Mybatis-plus构建ORM模型进行数据库操作 第三方API:高德地图、腾讯地图
少儿编程scratch项目源代码文件案例素材-像素猫3.zip
内容概要:本文是一份详细的10bit 50MHz SAR ADC学习指南,旨在帮助新手掌握从基础理论到实际电路设计的全过程。文中详细介绍了Cadence仿真工具的应用以及SMIC 40nm工艺库的具体使用方法。重点讲解了栅压自举开关、CDAC(电荷再分配模数转换器)、比较器和SAR逻辑等核心模块的设计原理和技术要点。此外,还提供了测试电路的构建方法及其性能评估手段,如INL/DNL曲线绘制。最后提到了更高性能TI ADC的扩展接口,为后续深入研究打下基础。 适合人群:对模拟集成电路设计感兴趣的电子工程专业学生或刚入行的研发人员。 使用场景及目标:适用于希望深入了解SAR ADC架构、提高自身硬件设计能力的学习者;目标是在实践中掌握关键技术和优化技巧,能够独立完成类似项目的开发。 其他说明:文章不仅提供理论知识,还包括大量实用的操作提示和常见错误避免建议,有助于读者快速上手并减少试错成本。
scratch少儿编程逻辑思维游戏源码-防空火力 3D.zip
智慧消防安全与应急管理是现代城市安全管理的重要组成部分,随着城市化进程的加速,传统消防安全管理面临着诸多挑战,如消防安全责任制度落实不到位、消防设施日常管理不足、消防警力不足等。这些问题不仅制约了消防安全管理水平的提升,也给城市的安全运行带来了潜在风险。然而,物联网和智慧城市技术的快速发展为解决这些问题提供了新的思路和方法。智慧消防作为物联网和智慧城市技术结合的创新产物,正在成为社会消防安全管理的新趋势。 智慧消防的核心在于通过技术创新实现消防安全管理的智能化和自动化。其主要应用包括物联网消防安全监管平台、城市消防远程监控系统、智慧消防平台等,这些系统利用先进的技术手段,如GPS、GSM、GIS等,实现了对消防设施的实时监控、智能巡检和精准定位。例如,单兵定位方案通过信标点定位和微惯导加蓝牙辅助定位技术,能够精确掌握消防人员的位置信息,从而提高救援效率和安全性。智慧消防不仅提升了消防设施的管理质量,还优化了社会消防安全管理资源的配置,降低了管理成本。此外,智慧消防的应用还弥补了传统消防安全管理中数据处理方式落后、值班制度执行不彻底等问题,赋予了建筑消防设施智能化、自动化的能力。 尽管智慧消防技术在社会消防安全管理工作中的应用已经展现出巨大的潜力和优势,但目前仍处于实践探索阶段。相关职能部门和研究企业需要加大研究开发力度,进一步完善系统的功能与实效性。智慧消防的发展既面临风险,也充满机遇。当前,社会消防安全管理工作中仍存在制度执行不彻底、消防设施日常维护不到位等问题,而智慧消防理念与技术的应用可以有效弥补这些弊端,提高消防安全管理的自动化与智能化水平。随着智慧城市理念的不断发展和实践,智慧消防将成为推动社会消防安全管理工作与城市化进程同步发展的关键力量。
scratch少儿编程逻辑思维游戏源码-节奏空间.zip
scratch少儿编程逻辑思维游戏源码-黑白色.zip
scratch少儿编程逻辑思维游戏源码-简单射击游戏.zip
少儿编程scratch项目源代码文件案例素材-头头连连看.zip