Ubuntu下更新内核版本

Ubuntu下更新内核版本

可以解决关机重启时间漫长的问题

  1. 一般内核有更新时会在终端显示有软件包可更新,执行命令更新软件包
apt-get full-upgrade
  1. 更新后,更新grub系统引导文件,重启电脑
sudo update-grub
sudo reboot
  1. 重启后,输入以下命令查看当前使用的内核
uname -r

4.15.0-29-generic
  1. 输入一下命令查看当前系统中安装的内核
sudo dpkg --get-selections |grep linux                                                                                            xiaoming@xiaoming-X542UN
[sudo] xiaoming 的密码: 
console-setup-linux				install
libselinux1:amd64				install
linux-base					install
linux-firmware					install
linux-generic-hwe-16.04				install
linux-headers-4.13.0-45				install
linux-headers-4.13.0-45-generic			install
linux-headers-4.15.0-29				install
linux-headers-4.15.0-29-generic			install
linux-headers-generic-hwe-16.04			install
linux-image-4.13.0-45-generic			install
linux-image-4.15.0-29-generic			install
linux-image-extra-4.13.0-45-generic		install
linux-image-generic-hwe-16.04			install
linux-libc-dev:amd64				install
linux-modules-4.15.0-29-generic			install
linux-modules-extra-4.15.0-29-generic		install
linux-signed-generic-hwe-16.04			install
linux-signed-image-4.13.0-45-generic		install
linux-sound-base				install
pptp-linux					install
syslinux					install
syslinux-common					install
syslinux-legacy					install
util-linux					install
  1. 可以把不需要的低版本内核删除掉,执行以下两个命令
sudo apt-get purge linux-image-x.xx.x-xx
sudo apt-get purge linux-headers-x.xx.x-xx
  1. 更新grub:
sudo update-grub
  1. 再执行命令查看内核版本列表
sudo dpkg --get-selections |grep linux                                                                                            xiaoming@xiaoming-X542UN
console-setup-linux				install
libselinux1:amd64				install
linux-base					install
linux-firmware					install
linux-generic-hwe-16.04				install
linux-headers-4.15.0-29				install
linux-headers-4.15.0-29-generic			install
linux-headers-generic-hwe-16.04			install
linux-image-4.13.0-45-generic			deinstall
linux-image-4.15.0-29-generic			install
linux-image-extra-4.13.0-45-generic		deinstall
linux-image-generic-hwe-16.04			install
linux-libc-dev:amd64				install
linux-modules-4.15.0-29-generic			install
linux-modules-extra-4.15.0-29-generic		install
linux-signed-generic-hwe-16.04			install
linux-signed-image-4.13.0-45-generic		deinstall
linux-sound-base				install
pptp-linux					install
syslinux					install
syslinux-common					install
syslinux-legacy					install
util-linux					install
  1. 把显示deinstall的文件删除掉
sudo dpkg -P 文件名

这就完成了!