ubuntu18.04 LTS解决/boot空间不足
1. 查看磁盘占用情况
df -h Filesystem Size Used Avail Use% Mounted on
/dev/nvme0n1p5 181M 141M 27M 85% /boot
/dev/nvme0n1p8 71G 26G 41G 39% /home
/dev/nvme0n1p1 96M 48M 49M 50% /boot/efi
tmpfs 1.6G 16K 1.6G 1% /run/user/121
tmpfs 1.6G 44K 1.6G 1% /run/user/1000
发现/boot确实占用率很高。
2. uname -a (查看当前使用的内核版本)
lenmom@M1701:~$ uname -a
Linux M1701 4.15.--generic #-Ubuntu SMP Thu Dec :: UTC x86_64
3.查看已安装的内核版本
lenmom@M1701:~$ dpkg --get-selections |grep linux
binutils-x86--linux-gnu install
console-setup-linux install
libselinux1:amd64 install
linux-base install
linux-firmware install
linux-generic install
linux-headers-4.15.- install
linux-headers-4.15.--generic install
linux-headers-4.15.- install
linux-headers-4.15.--generic install
linux-headers-generic install
linux-image-4.15.--generic deinstall
linux-image-4.15.--generic install
linux-image-4.15.--generic install
linux-image-generic install
linux-libc-dev:amd64 install
linux-modules-4.15.--generic deinstall
linux-modules-4.15.--generic install
linux-modules-4.15.--generic install
linux-modules-extra-4.15.--generic deinstall
linux-modules-extra-4.15.--generic install
linux-modules-extra-4.15.--generic install
linux-signed-generic install
linux-sound-base install
pptp-linux install
syslinux install
syslinux-common install
syslinux-legacy install
util-linux install
能看到已经安装的版本,其中带image的一般就是旧版本,其中
a)deinstall代表是已经删除的旧版本
b) install是还没有删除的旧版本内核
4. 删除多余的内核文件
通过uname -a可以查看到当前正在使用的内核版本,把不是当前版本的处于install状态的image-xxx-generic文件卸载掉,对于本例中linux-modules-extra-4.15.0-39-generic是多余的内核文件,正在使用的是linux-modules-extra-4.15.0-43-generic,开始卸载。
卸载命令为sudo apt-get remove linux-modules-xxx-generic,其中xxx为要卸载的内核版本号
lenmom@M1701:~$ sudo apt-get remove linux-modules-4.15.--generic
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be REMOVED:
linux-image-4.15.--generic linux-modules-4.15.--generic
upgraded, newly installed, to remove and not upgraded.
not fully installed or removed.
After this operation, 74.6 MB disk space will be freed.
Do you want to continue? [Y/n] y
(Reading database ... files and directories currently installed.)
Removing linux-image-4.15.--generic (4.15.-39.42) ...
I: /vmlinuz.old is now a symlink to boot/vmlinuz-4.15.--generic
I: /initrd.img.old is now a symlink to boot/initrd.img-4.15.--generic
/etc/kernel/postrm.d/initramfs-tools:
update-initramfs: Deleting /boot/initrd.img-4.15.--generic
/etc/kernel/postrm.d/zz-update-grub:
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-4.15.--generic
Found initrd image: /boot/initrd.img-4.15.--generic
Found Windows Boot Manager on /dev/nvme0n1p1@/EFI/Microsoft/Boot/bootmgfw.efi
Adding boot menu entry for EFI firmware configuration
done
Removing linux-modules-4.15.--generic (4.15.-39.42) ...
Setting up initramfs-tools (.130ubuntu3.) ...
update-initramfs: deferring update (trigger activated)
Processing triggers for initramfs-tools (.130ubuntu3.) ...
update-initramfs: Generating /boot/initrd.img-4.15.--generic
W: APT had planned for dpkg to do more than it reported back ( vs ).
Affected packages: initramfs-tools:amd64
u can execute the following command to ensure all useless files are deleted:
sudo dpkg -P linux-modules-4.15.0-46-generic -- the kernel name depend to your concret condition
5. 使用du -h再次查看/boot空间
lenmom@M1701:~$ df -h
Filesystem Size Used Avail Use% Mounted on
/dev/nvme0n1p5 181M 75M 94M % /boot
/dev/nvme0n1p8 71G 26G 41G % /home
/dev/nvme0n1p1 96M 48M 49M % /boot/efi
tmpfs .6G 16K .6G % /run/user/
tmpfs .6G 44K .6G % /run/user/
我们发现,/boot空间的确已经释放出来了。
ubuntu18.04 LTS解决/boot空间不足的更多相关文章
- ubuntu18.04 lts重装VMware Tools实现主机文件共享等功能
ubuntu18.04 lts重装VMware Tools实现主机文件共享等功能 在VMWare 14.x上安装ubunuu18.04 lts后发现,可以实现全屏显示,但是没有与主机共享文件的功能,然 ...
- Ubuntu-18.04 LTS UEFI 安装U盘制作
要把U盘作为UEFI启动盘,第一个分区要为FAT32分区,EFI程序放在/EFI/Boot/bootx64.efi.为了制作Ubuntu-18.04 LTS安装U盘,可以把一个U盘格式化为FAT32格 ...
- Ubuntu18.04 LTS x64 构建ARM交叉编译环境(尝试,但失败了!!!估计是编译器没选对)
[测试而已,由于需要了解编译器和处理器体系,因此先放弃该方法] 动机 入门嵌入式开发,又需要 Windows 又需要 Linux,但资料给的竟然是 Ubuntu9,导致我不能使用 VSCode Rem ...
- linux系统解决boot空间不足
有时候更新Linux系统是会碰到boot空间不足的错误,原因基本上是安装时boot空间设置问题可以通过删除旧的内核来释放boot空间. ubuntu: 1.查看当前使用内核版本号 unam ...
- Ubuntu18.04 LTS 搭建Cassandra集群
环境需求 jdk8 root@node01:~# java -version java version "1.8.0_202" Java(TM) SE Runtime Enviro ...
- ubuntu16.04 解决boot空间不足
1. dpkg --get-selections |grep linux-image #查看已安装内核版本号 2. uname -a #查看现运行版本 3. sudo apt-get purge 版本 ...
- 解决boot空间不足问题
uname -a :查看现在系统信息,内核版本 dpkg --get-selections |grep linux-image : 查看内核列表 sudo apt-get remove linux-i ...
- Ubuntu18.04 LTS 安装部署golang最新版本1.10
1 步骤 //1 直接安装golang-go 目前最新版本是1.10 sudo apt-get install golang-go //2 向/etc/profile追加以下代码 sudo vim / ...
- ubuntu18.04+win10解决时钟不同步办法
安装ntpdate: 执行命令: sudo apt-get install ntpdate 设置校正服务器: sudo ntpdate time.windows.com 设置硬件时间为本地时间: 执行 ...
随机推荐
- how to use Eclipse for kernel development
http://wiki.eclipse.org/HowTo_use_the_CDT_to_navigate_Linux_kernel_source Here are some steps that I ...
- leetcode第一刷_Insert Interval
这道题的难度跟微软的那道面试题相当. 要在集合中插入一段新的集合,相当于求两个集合的并了.对于新增加一段集合的情况,分为以下几种: 1. 增加段跟原来的全然相交,也即他的起点和终点都在被包括在原来的段 ...
- wpf学习
http://www.jikexueyuan.com/course/1231_3.html?ss=1 WPF入门教程系列二——Application介绍 http://www.cnblogs.com/ ...
- gulp 压缩 js 和 css 代码
我们在写出来的代码都是非常规范的,改换行的时候就换行,改tab 的时候就有tab,还有这样做是为了后期维护方便,但是这也导致了内存占用量的增大,当把把代码发到线上,如果网速慢一点,可能很久都加载不出来 ...
- webpack 4 学习资料
webpack 4 学习资料 资料 网址 webpack 中文版 https://webpack.docschina.org/configuration/ webpack 4 教程 https://s ...
- python 术语
python 术语 术语英文 术语中文 说明 PyPI(Python Package Index) 搜索python包的网站:https://pypi.org/ pip.easy_install 包管 ...
- windows系统如何设置域名解析
C:\Windows\System32\drivers\etc
- Hystrix 使用入门
在很多系统架构中都需要考虑横向扩.单点故障等问题,对于一个庞大的应用集群,部分服务或者机器出现问题不可避免,在出现故障时,如何减少故障的影响.保障集群的高可用,成为一个重要的工作,Hystrix 是一 ...
- redis常用客户端命令
sentinel操作: 1.查询主节点:redis-cli -h 172.16.4.220 -p 46379 SENTINEL get-master-addr-by-name mymaster 2.查 ...
- python doc
http://blog.51cto.com/lizhenliang/category16.html