赞
踩
当前公司产品使用的是 Ubuntu 16.04 的系统,使用 4.4.0-208-generic 版本内核 但是由于系统会自动更新内核补丁版本
将系统内核升级为4.4.0-210-generic 导致网卡等驱动丢失,不能使用
由于设备 Ubuntu 系统未设置 禁止自动更新内核,导致会联网提示升级内核补丁版,内核升级4.4.0-210-generic 时,实际上并没有完全升级,缺少linux-header-4.4.0-210-generic 可以通过查看内核包信息
dpkg -- list | grep linux
这会导致系统 系统不识别 网卡驱动,查询 网卡设备
lshw -c network
WiFi网卡和硬件网卡 可能会 显示网卡 UNCLAIMED
查看系统其他已安装内核
grep menuentry /boot/grub/grub.cfg
- if [ x"${feature_menuentry_id}" = xy ]; then
- menuentry_id_option="--id"
- menuentry_id_option=""
- export menuentry_id_option
- menuentry 'Ubuntu' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-3a45027c-15ed-4cec-a233-7c3927e74d11' {
- submenu 'Ubuntu 高级选项' $menuentry_id_option 'gnulinux-advanced-3a45027c-15ed-4cec-a233-7c3927e74d11' {
- menuentry 'Ubuntu,Linux 4.4.0-210-generic' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.15.0-43-generic-advanced-3a45027c-15ed-4cec-a233-7c3927e74d11' {
- menuentry 'Ubuntu, with Linux 4.4.0-210-generic (upstart)' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.15.0-43-generic-init-upstart-3a45027c-15ed-4cec-a233-7c3927e74d11' {
- menuentry 'Ubuntu, with Linux 4.4.0-210-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.15.0-43-generic-recovery-3a45027c-15ed-4cec-a233-7c3927e74d11' {
- ***menuentry 'Ubuntu,Linux 4.4.0-209-generic' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.15.0-33-generic-advanced-3a45027c-15ed-4cec-a233-7c3927e74d11' {
- menuentry 'Ubuntu, with Linux 4.4.0-209-generic (upstart)' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.15.0-33-generic-init-upstart-3a45027c-15ed-4cec-a233-7c3927e74d11' {
- menuentry 'Ubuntu, with Linux 4.4.0-209-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.15.0-33-generic-recovery-3a45027c-15ed-4cec-a233-7c3927e74d11' {
- menuentry 'Ubuntu,Linux 4.4.0-208-generic' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.15.0-29-generic-advanced-3a45027c-15ed-4cec-a233-7c3927e74d11' {
- menuentry 'Ubuntu, with Linux 4.4.0-208-generic (upstart)' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.15.0-29-generic-init-upstart-3a45027c-15ed-4cec-a233-7c3927e74d11' {
- menuentry 'Ubuntu, with Linux 4.4.0-208-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.15.0-29-generic-recovery-3a45027c-15ed-4cec-a233-7c3927e74d11' {
- menuentry 'Memory test (memtest86+)' {
- menuentry 'Memory test (memtest86+, serial console 115200)' {
- menuentry 'Windows 7 (loader) (on /dev/sda1)' --class windows --class os $menuentry_id_option 'osprober-chain-246AF2746AF241DA' {
我们所需要的是 *** 这个Ubuntu,Linux 4.4.0-209-generic 这个内核版本 第一个menuentry为序号为0 我们这个序号为3
使用如下指令打开grub文件
sudo gedit /etc/default/grub
grub文件中修改的GRUB_DEFAULT="1 >3".
然后执行sudo update-grub
然后重启sudo reboot
重启之后,查看系统内核版本
uname -r
即为我们切换的版本
彻底禁止内核更新
修改/etc/apt/apt.conf.d/10periodic将所有值改为0
vim etc/apt/apt.conf.d/10periodic
APT::Periodic::Update-Package-Lists “0”;
APT::Periodic::Download-Upgradeable-Packages “0”;
APT::Periodic::AutocleanInterval “0”;
修改/etc/apt/apt.conf.d/20auto_upgrade 将所有值改为0
修改 /etc/apt/apt.conf.d/99update_notifier 注释 #Dpkg::****
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。