如何告诉 dpkg 根据名称模式保存软件包

如何告诉 dpkg 根据名称模式保存软件包

无人值守的升级破坏了我的 nvidia 驱动程序,我不得不删除并重新安装正确的驱动程序。我想防止这种情况在未来再次发生。这是根据/var/log/apt/history.log

Commandline: /usr/bin/unattended-upgrade
Install: libnvidia-egl-wayland1:amd64 (1:1.1.9-1.1, automatic)
Upgrade: libnvidia-fbc1-515:amd64 (515.65.01-0ubuntu1, 515.76-0ubuntu0.22.04.1), libnvidia-fbc1-515:i386 (515.65.01-0ubuntu1, 515.76-0ubuntu0.22.04.1), libnvidia-gl-515:amd64 (515.65.01-0ubuntu1, 515.76-0ubuntu0.22.04.1), libnvidia-gl-515:i386 (515.65.01-0ubuntu1, 515.76-0ubuntu0.22.04.1), libnvidia-extra-515:amd64 (515.65.01-0ubuntu1, 515.76-0ubuntu0.22.04.1), nvidia-compute-utils-515:amd64 (515.65.01-0ubuntu1, 515.76-0ubuntu0.22.04.1), nvidia-dkms-515:amd64 (515.65.01-0ubuntu1, 515.76-0ubuntu0.22.04.1), nvidia-driver-515:amd64 (515.65.01-0ubuntu1, 515.76-0ubuntu0.22.04.1), libnvidia-encode-515:amd64 (515.65.01-0ubuntu1, 515.76-0ubuntu0.22.04.1), libnvidia-encode-515:i386 (515.65.01-0ubuntu1, 515.76-0ubuntu0.22.04.1), nvidia-utils-515:amd64 (515.65.01-0ubuntu1, 515.76-0ubuntu0.22.04.1), xserver-xorg-video-nvidia-515:amd64 (515.65.01-0ubuntu1, 515.76-0ubuntu0.22.04.1), libnvidia-decode-515:amd64 (515.65.01-0ubuntu1, 515.76-0ubuntu0.22.04.1), libnvidia-decode-515:i386 (515.65.01-0ubuntu1, 515.76-0ubuntu0.22.04.1), nvidia-kernel-common-515:amd64 (515.65.01-0ubuntu1, 515.76-0ubuntu0.22.04.1), libnvidia-cfg1-515:amd64 (515.65.01-0ubuntu1, 515.76-0ubuntu0.22.04.1), nvidia-kernel-source-515:amd64 (515.65.01-0ubuntu1, 515.76-0ubuntu0.22.04.1), libnvidia-compute-515:amd64 (515.65.01-0ubuntu1, 515.76-0ubuntu0.22.04.1), libnvidia-compute-515:i386 (515.65.01-0ubuntu1, 515.76-0ubuntu0.22.04.1)

我想告诉 dpkg 保留所有与 nvidia 相关的升级,但我能找到的所有内容仅显示了如何针对一个特定软件包(例如echo "<package-name> hold" | sudo dpkg --set-selections)执行此操作。我如何对包含模式的软件包(例如 nvidia)执行此操作?

相关内容