![无人值守升级 - 无法自动安装](https://linux22.com/image/938265/%E6%97%A0%E4%BA%BA%E5%80%BC%E5%AE%88%E5%8D%87%E7%BA%A7%20-%20%E6%97%A0%E6%B3%95%E8%87%AA%E5%8A%A8%E5%AE%89%E8%A3%85.png)
我刚刚安装了 Ubuntu 20.04,不记得具体安装了无人值守升级,但它似乎已启用。作为登录时 MOTD 的一部分,我看到:
16 updates could not be installed automatically. For more details, see /var/log/unattended-upgrades/unattended-upgrades.log
cat /var/log/unattended-upgrades/unattended-upgrades.log 显示这些是 nvidia-driver 包。
2021-06-06 16:49:02,358 DEBUG pkgs that look like they should be upgraded:
2021-06-06 16:49:02,382 DEBUG fetch.run() result: 0
2021-06-06 16:49:02,391 DEBUG Packages blacklist due to conffile prompts: []
2021-06-06 16:49:02,391 INFO No packages found that can be upgraded unattended and no pending auto-removals
2021-06-06 16:49:02,443 DEBUG Package libnvidia-cfg1-465 has a higher version available, checking if it is from an allowed origin and is not pinned down.
2021-06-06 16:49:02,445 INFO Package libnvidia-cfg1-465 is kept back because a related package is kept back or due to local apt_preferences(5).
2021-06-06 16:49:02,445 DEBUG Package libnvidia-common-465 has a higher version available, checking if it is from an allowed origin and is not pinned down.
2021-06-06 16:49:02,447 INFO Package libnvidia-common-465 is kept back because a related package is kept back or due to local apt_preferences(5).
...
2021-06-06 16:49:02,489 DEBUG Package nvidia-driver-465 has a higher version available, checking if it is from an allowed origin and is not pinned down.
2021-06-06 16:49:02,490 INFO Package nvidia-driver-465 is kept back because a related package is kept back or due to local apt_preferences(5).
但是,我无法更新任何这些包,但似乎它们都是最新版本。
$ sudo aptitude install nvidia-driver-465
nvidia-driver-465 is already installed at the requested version (465.19.01-0ubuntu1)
nvidia-driver-465 is already installed at the requested version (465.19.01-0ubuntu1)
No packages will be installed, upgraded, or removed.
0 packages upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B of archives. After unpacking 0 B will be used.
$ sudo aptitude full-upgrade
No packages will be installed, upgraded, or removed.
0 packages upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B of archives. After unpacking 0 B will be used.
我想保留无人值守升级,但看到这条消息让我抓狂。我怎样才能让无人值守升级识别出所有内容都是最新的,或者我怎样才能更新看起来已经是最新的软件包?
答案1
我最终在 /etc/apt/preferences.d 中找到了密码
ls /etc/apt/preferences.d
cuda-repository-pin-600
这似乎是我不需要的 cuda 安装留下的。所以我清除了 cuda 安装,并移除了 pin。
sudo apt purge cuda*
sudo rm /etc/apt/preferences.d/cuda-repository-pin-600
sudo apt autoremove
sudo apt autoclean
然后能够使用无人值守升级来更新(仍然安装的)驱动程序
sudo unattended-upgrade -d
安装驱动程序更新并重新启动后,nvidia-smi 仍然有效