症状:
内核更新可能会由于内核与驱动不匹配,导致系统无限重启
方式一(apt命令):
#查看已安装的内核
sudo dpkg --get-selections | grep linux
#查看正在使用的内核
uname -r
#使用apt命令禁止内核更新
sudo apt-mark hold linux-image-4.4.0-21-generic
sudo apt-mark hold linux-image-extra-4.4.0-21-generic
#重启内核更新
sudo apt-mark unhold linux-image-4.4.0-21-generic
sudo apt-mark unhold linux-image-extra-4.4.0-21-generic
方式二(修改配置文件):
# 修改以下文件
sudo vim /etc/apt/apt.conf.d/10periodic
sudo vim /etc/apt/apt.conf.d/20auto-upgrades
#关闭自动更新
APT::Periodic::Update-Package-Lists "0";
APT::Periodic::Download-Upgradeable-Packages "0";
APT::Periodic::AutocleanInterval "0";
APT::Periodic::Unattended-Upgrade "0";
#开启自动更新
APT::Periodic::Update-Package-Lists "2";
APT::Periodic::Download-Upgradeable-Packages "1";
APT::Periodic::AutocleanInterval "0";
APT::Periodic::Unattended-Upgrade "1";