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 设置硬件时间为本地时间: 执行 ...
随机推荐
- C# to il 9 Properties and Indexers(属性和索引器)
A field is simply a memory location, whereas, a property is a collection of methods. Aproperty is re ...
- SUPERSOCKET 客户端
SUPERSOCKET.CLIENTENGINE 简单使用 2015年5月27日 HYJIACAN 发表回复 阅读 11,105 次 江大没有给ClientEngine的Demo,一直没有找到其它的. ...
- splitChunks. cacheGroups 里面的 maxInitialRequests 含义
entry文件请求的chunks不应该超过此值(请求过多,耗时) 出处:https://ymbo.github.io/2018/05/21/webpack%E9%85%8D%E7%BD%AE%E4%B ...
- apt-get update 与 apt-get upgrade 的区别
总而言之,update是更新软件列表,upgrade是更新软件:所以,这两命令都是一块用,update后再upgrade. update 是更新 /etc/apt/sources.list 和 /et ...
- create-react-app 搭建的项目中,引入 webpack-bundle-analyzer 打包分析
安装npm intall webpack-bundle-analyzer --save-dev 在 config/webpack.config.prod.js 文件(推荐)或 config/webpa ...
- centos 虚拟机中最小化安装,无法上网的解决方法
无法上网原因:因为最小化安装以后,centos 默认未开启网卡 解决方法进入 /etc/sysconfig/network-scripts/ifcfg-enp0s3 文件中 进入编辑模式,将 ONBO ...
- C166-变量和函数指定物理地址之二
按照<RENAMECLASS Compiler Directive>http://www.keil.com/support/man/docs/c166/c166_renameclass.h ...
- SQL 中的 IFNULL和NULLIF
sql 中的IFNULL和NULLIF很容易混淆,在此记录一下. IFNULL IFNULL(expression1, expression2) 如果expression1为null, 在函数返回ex ...
- Apache Tika
Tika入门 Tika是一个内容抽取的工具集合(a toolkit for text extracting).它集成了POI, Pdfbox 并且为文本抽取工作提供了一个统一的界面.其次,Tika也提 ...
- MMU理解
MMU,全称Memory Manage Unit, 中文名——存储器管理单元. 许多年以前,当人们还在使用DOS或是更古老的操作系统的时候,计算机的内存还非常小,一般都是以K为单位进行计算,相应的,当 ...