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空间不足的更多相关文章

  1. ubuntu18.04 lts重装VMware Tools实现主机文件共享等功能

    ubuntu18.04 lts重装VMware Tools实现主机文件共享等功能 在VMWare 14.x上安装ubunuu18.04 lts后发现,可以实现全屏显示,但是没有与主机共享文件的功能,然 ...

  2. Ubuntu-18.04 LTS UEFI 安装U盘制作

    要把U盘作为UEFI启动盘,第一个分区要为FAT32分区,EFI程序放在/EFI/Boot/bootx64.efi.为了制作Ubuntu-18.04 LTS安装U盘,可以把一个U盘格式化为FAT32格 ...

  3. Ubuntu18.04 LTS x64 构建ARM交叉编译环境(尝试,但失败了!!!估计是编译器没选对)

    [测试而已,由于需要了解编译器和处理器体系,因此先放弃该方法] 动机 入门嵌入式开发,又需要 Windows 又需要 Linux,但资料给的竟然是 Ubuntu9,导致我不能使用 VSCode Rem ...

  4. linux系统解决boot空间不足

    有时候更新Linux系统是会碰到boot空间不足的错误,原因基本上是安装时boot空间设置问题可以通过删除旧的内核来释放boot空间. ubuntu: 1.查看当前使用内核版本号       unam ...

  5. Ubuntu18.04 LTS 搭建Cassandra集群

    环境需求 jdk8 root@node01:~# java -version java version "1.8.0_202" Java(TM) SE Runtime Enviro ...

  6. ubuntu16.04 解决boot空间不足

    1. dpkg --get-selections |grep linux-image #查看已安装内核版本号 2. uname -a #查看现运行版本 3. sudo apt-get purge 版本 ...

  7. 解决boot空间不足问题

    uname -a :查看现在系统信息,内核版本 dpkg --get-selections |grep linux-image : 查看内核列表 sudo apt-get remove linux-i ...

  8. Ubuntu18.04 LTS 安装部署golang最新版本1.10

    1 步骤 //1 直接安装golang-go 目前最新版本是1.10 sudo apt-get install golang-go //2 向/etc/profile追加以下代码 sudo vim / ...

  9. ubuntu18.04+win10解决时钟不同步办法

    安装ntpdate: 执行命令: sudo apt-get install ntpdate 设置校正服务器: sudo ntpdate time.windows.com 设置硬件时间为本地时间: 执行 ...

随机推荐

  1. C语言面试题1

    1.分析下面代码有什么问题? 1 2 3 4 5 6 void test1() {  char string[10];  char* str1 = "0123456789";  s ...

  2. 从后端接口下载文件的2种方式:get方式、post方式

    从后端接口下载文件的2种方式 一.get方式 直接使用: location.href='http://www.xxx.com/getFile?params1=xxx&params2=xxxx' ...

  3. linux centos6 yum 安装lamp

    centos 6.5 1.yum安装和源代码编译在使用的时候没啥区别,但是安装的过程就大相径庭了,yum只需要3个命令就可以完成,源代码需要13个包,还得加压编译,步骤很麻烦,而且当做有时候会出错,源 ...

  4. cvsnt报错:Administrator: Switch to user failed due to configuration error. Contact your System Administrator

    在安装CVSNT一开始用Administrator登录时总是报[login aborted]Switch to user failed due to configuration error. Cont ...

  5. java中length与length()

    length是对数组而言的,指的是数组的长度. length()是对字符串而言的,指的是字符串所包含的字符个数. public class LengthDemo { public static voi ...

  6. 在free bsd上跑JMeter 的 plugin "PerfMon Server Agent"

    在free bsd上跑JMeter 的 plugin "PerfMon Server Agent" 目的: 在free bsd上跑JMeter 的 plugin "Per ...

  7. 深入理解ASP.NET MVC(7)

    系列目录 Action的定位 再次回到Controller的ExecuteCore方法,回到action调用的入口: 1 if (!ActionInvoker.InvokeAction(Control ...

  8. 基于tornado的文件上传demo

    这里,web框架是tornado的4.0版本,文件上传组件,是用的bootstrap-fileinput. 这个小demo,是给合作伙伴提供的,模拟APP上摄像头拍照,上传给后台服务进行图像识别用,识 ...

  9. SDRAM的初始化与刷新操作---看时序图写代码

    SDRAM的初始化与刷新操作---看时序图写代码 1.SDRAM的常见操作 2.初始化就是配置SDRAM 3.SDRAM初始化时序 时序解释如下: 4.刷新操作

  10. 协程实现多并发socket,跟NGINX一样

    server: #!/usr/bin/env python # -*- coding: utf-8 -*- # author aliex-hrg import gevent from gevent i ...