Ubuntu18.04自動內核版本升級為5需要降級為4
查看內核版本

編輯在尾部增加一行
/etc/apt/sources.list
deb http://security.ubuntu.com/ubuntu trusty-security main

更新
apt-get update
查看可更新的內核
apt-cache search linux-image
本次我們更新4.15
apt install -y linux-image-4.15.0-72-generic
也可以在其他主機查看需要安裝的內核版本
dpkg --get-selections |grep linux-image

編輯
vim /etc/default/grub
Advanced options for Ubuntu>Ubuntu, with Linux linux-image-4.15.0-72-generic

更新
update-grub

把以下5內核的文件刪除

rm -rf /boot/vmlinuz-5.3.0-56-generic rm -rf /boot/vmlinuz-5.0.0-34-generic rm -rf /boot/initrd.img-5.0.0-34-generic rm -rf /boot/vmlinuz-5.0.0-32-generic
再次更新就只4.15內核的文件了

刪除5的內核軟件包
使用以下命令列出內核軟件包,把不需要的刪除
dpkg --get-selections |grep linux-image
apt remove linux-image-5.3.0-56-generic
重啟服務器后再查看內核版本

設置禁止更新內核
apt-mark hold linux-image-4.15.0-72-generic
禁用自動更新
/etc/apt/apt.conf.d/10periodic
1改成0

