![升级软件包安全吗?](https://linux22.com/image/1032378/%E5%8D%87%E7%BA%A7%E8%BD%AF%E4%BB%B6%E5%8C%85%E5%AE%89%E5%85%A8%E5%90%97%EF%BC%9F.png)
登录我的 Ubuntu 22.04 服务器后,它告诉我有可用的升级。不过,我刚刚从源代码安装了带有 CUDA 的新 Nvidia 驱动程序。升级这些软件包安全吗?
cees_timmerman@server:~$ nvidia-smi
Thu Feb 15 14:26:06 2024
+---------------------------------------------------------------------------------------+
| NVIDIA-SMI 545.23.08 Driver Version: 545.23.08 CUDA Version: 12.3 |
|-----------------------------------------+----------------------+----------------------+
| GPU Name Persistence-M | Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap | Memory-Usage | GPU-Util Compute M. |
| | | MIG M. |
|=========================================+======================+======================|
| 0 Tesla T4 On | 00000000:4B:00.0 Off | 0 |
| N/A 39C P8 9W / 70W | 2MiB / 15360MiB | 0% Default |
| | | N/A |
+-----------------------------------------+----------------------+----------------------+
+---------------------------------------------------------------------------------------+
| Processes: |
| GPU GI CI PID Type Process name GPU Memory |
| ID ID Usage |
|=======================================================================================|
| No running processes found |
+---------------------------------------------------------------------------------------+
cees_timmerman@server:~$ apt list --upgradable
Listing... Done
coreutils/jammy-updates 8.32-4.1ubuntu1.1 amd64 [upgradable from: 8.32-4.1ubuntu1]
libegl-mesa0/jammy-updates 23.2.1-1ubuntu3.1~22.04.2 amd64 [upgradable from: 23.0.4-0ubuntu1~22.04.1]
libgbm1/jammy-updates 23.2.1-1ubuntu3.1~22.04.2 amd64 [upgradable from: 23.0.4-0ubuntu1~22.04.1]
libgl1-mesa-dev/jammy-updates 23.2.1-1ubuntu3.1~22.04.2 amd64 [upgradable from: 23.0.4-0ubuntu1~22.04.1]
libgl1-mesa-dri/jammy-updates 23.2.1-1ubuntu3.1~22.04.2 amd64 [upgradable from: 23.0.4-0ubuntu1~22.04.1]
libglapi-mesa/jammy-updates 23.2.1-1ubuntu3.1~22.04.2 amd64 [upgradable from: 23.0.4-0ubuntu1~22.04.1]
libglx-mesa0/jammy-updates 23.2.1-1ubuntu3.1~22.04.2 amd64 [upgradable from: 23.0.4-0ubuntu1~22.04.1]
libxnvctrl0/unknown 545.23.08-0ubuntu1 amd64 [upgradable from: 510.47.03-0ubuntu1]
mesa-vdpau-drivers/jammy-updates 23.2.1-1ubuntu3.1~22.04.2 amd64 [upgradable from: 23.0.4-0ubuntu1~22.04.1]
python3-distupgrade/jammy-updates 1:22.04.18 all [upgradable from: 1:22.04.17]
ubuntu-release-upgrader-core/jammy-updates 1:22.04.18 all [upgradable from: 1:22.04.17]
答案1
一般情况下,不建议混合使用来自互不兼容的专有图形驱动程序软件源的软件包,但 apt 有一个选项可以安全地模拟软件包的升级,而无需对系统进行任何实际更改。例如,要模拟升级 coreutils 软件包而不实际升级它,请以 root 身份运行以下命令,无需 sudo。
apt upgrade coreutils --simulate
您还可以使用--simulate
apt 的选项来模拟手动下载的 .deb 文件和通常可以通过 apt 安装或卸载的包的安装或卸载。
由于--simulate
apt 选项仅模拟 Ubuntu 软件包管理中 apt 命令的结果,因此它无法模拟软件包的新候选版本的性能是优于还是劣于同一软件包的现有版本。在某些情况下,您需要在虚拟机中安装 Ubuntu 才能安全地执行此操作,具体取决于已安装的软件包。