ubuntu18关闭自动更新检查

关闭 Unattended Upgrades

关机的时候,有时提示”Unattended Upgrades in progress” ,然后很久无法关机。

再启动的时候,有提示 apt lock了:

1
2
E: Could not get lock /var/lib/dpkg/lock-frontend - open (11: Resource temporarily unavailable)
E: Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), is another process using it?
  • 方法一: 配置 Unattended Upgrades

    1
      sudo dpkg-reconfigure unattended-upgrades
    
  • 方法二: 干脆直接卸载 Unattended Upgrades

    1
      sudo apt remove unattended-upgrades
    
  • 方法三: 图形界面工具 Software Updater 中关闭

    1. 运行 Software Updater -> Settings… -> Updates
    2. Automatically check for updates : 选择 Never

不确定如下方法是否有用

方法一:

1
2
sudo systemctl disable apt-daily.service apt-daily-upgrade.service
sudo systemctl disable apt-daily.timer apt-daily-upgrade.timer

方法二:

  1. cd /etc/apt/apt.conf.d/
  2. 找到包含Update-Package-Lists的文件
    1
    2
    $ find . -type f | xargs grep -iHn --color Update-Package-Lists
    ./10periodic:1:APT::Periodic::Update-Package-Lists "1";
    
  3. 修改这个文件,将 Update-Package-Lists "1" 改为 Update-Package-Lists "0"

方法三:

1
sudo apt remove packagekit