Errors were encountered while processing:
/tmp/apt-dpkg-install-UHrEYm/30-nvidia-compute-utils-550_550.127.08-0ubuntu1_amd64.deb
/tmp/apt-dpkg-install-UHrEYm/35-nvidia-utils-550_550.127.08-0ubuntu1_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
这个错误怎么修改哇
谢谢,但是我去看了一下,因为可能我不是很懂所以有点看不懂,其次我看问题好像有点不是很一样
@檀檀爱吃糖: 我之前在 ubunbu 22.04 上安装过 nvidia 驱动,可以看一下当时记录的博文 阿里云轻量级 GPU 实例安装 NVIDIA 驱动
@dudu: 好滴,谢谢!我先去试试
@dudu: 你好我去看了一下,这个是靠阿里云,但是我的虚拟机是学校的,我是通过学校接口连接的,所以好像不太能适配
@檀檀爱吃糖: 那只是参考,建议先确定一下驱动版本,如果驱动版本没有问题,只是 linux 系统的问题,可以试试这个回答中的方法 https://unix.stackexchange.com/a/688302
@dudu: 谢谢!我试了一下还是不行,和之前报错一样
在 Ubuntu 22.04 上安装 NVIDIA 驱动时遇到 E: Sub-process /usr/bin/dpkg returned an error code (1)
的错误,通常表示安装过程中出现了问题。以下是一些步骤和解决方法,您可以尝试解决该错误:
首先,确保您的包管理器是最新的,您可以通过以下命令更新:
sudo apt update
sudo apt upgrade
执行以下命令以清理未完全安装的软件包:
sudo apt --fix-broken install
如果您从 PPA 或通过普通的 APT 安装驱动程序,可以手动安装 NVIDIA 驱动。
添加 NVIDIA PPA(如果尚未添加):
sudo add-apt-repository ppa:graphics-drivers/ppa
sudo apt update
查找可用的驱动版本:
查看可用的驱动版本:
ubuntu-drivers devices
手动安装推荐的驱动:
使用以下命令安装推荐的驱动(例如 nvidia-driver-xxx
,您在上一步看到的):
sudo apt install nvidia-driver-xxx
如果某些包在安装时被锁定,可以使用以下命令查看:
sudo dpkg --get-selections | grep -v deinstall
如果发现某些 NVIDIA 相关的包被锁定,使用以下命令解锁:
sudo apt-mark unhold package-name
如果某些包仍然引起问题,可以尝试手动删除它们:
sudo dpkg --remove --force-remove-reinstreq nvidia-compute-utils-550
sudo dpkg --remove --force-remove-reinstreq nvidia-utils-550
在删除问题包后,再次尝试安装 NVIDIA 驱动:
sudo apt install nvidia-driver-xxx
如果错误依然存在,可以查看相关日志输出以获取更多信息:
cat /var/log/dpkg.log | grep nvidia
完成上述步骤后,重启计算机,检查 NVIDIA 驱动是否正确安装:
sudo reboot
重新启动后,您可以使用以下命令检查 NVIDIA 驱动是否正常工作:
nvidia-smi
通过以上步骤,您应该能够解决安装 NVIDIA 驱动时遇到的问题。如果仍然遇到麻烦,请提供更多错误信息,以便进一步诊断和帮助。
还是报错,麻烦可以帮忙看看怎么回事吗
执行sudo apt install nvidia-driver-565报错:
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
nvidia-driver-565 : Depends: nvidia-compute-utils-565 (= 565.57.01-0ubuntu1) but it is not going to be installed
Depends: nvidia-utils-565 (= 565.57.01-0ubuntu1) but it is not going to be installed
Recommends: libnvidia-compute-565:i386 (= 565.57.01-0ubuntu1)
Recommends: libnvidia-decode-565:i386 (= 565.57.01-0ubuntu1)
Recommends: libnvidia-encode-565:i386 (= 565.57.01-0ubuntu1)
Recommends: libnvidia-fbc1-565:i386 (= 565.57.01-0ubuntu1)
Recommends: libnvidia-gl-565:i386 (= 565.57.01-0ubuntu1)
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).
这是日志的输出(大体全是这样):
2025-01-14 01:14:17 install nvidia-compute-utils-565:amd64 <none> 565.57.01-0ubuntu1
2025-01-14 01:14:17 status half-installed nvidia-compute-utils-565:amd64 565.57.01-0ubuntu1
2025-01-14 01:14:17 status not-installed nvidia-compute-utils-565:amd64 <none>
2025-01-14 01:14:17 install nvidia-utils-565:amd64 <none> 565.57.01-0ubuntu1
2025-01-14 01:14:17 status half-installed nvidia-utils-565:amd64 565.57.01-0ubuntu1
2025-01-14 01:14:17 status not-installed nvidia-utils-565:amd64 <none>
不知道是不是更新问题,执行sudo apt update会有些红色
Reading package lists... Done
W: GPG error: http://mirrors.aliyun.com/ubuntu bionic InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 3B4FE6ACC0B21F32
E: The repository 'http://mirrors.aliyun.com/ubuntu bionic InRelease' is not signed.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
W: GPG error: http://mirrors.aliyun.com/ubuntu bionic-security InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 3B4FE6ACC0B21F32
E: The repository 'http://mirrors.aliyun.com/ubuntu bionic-security InRelease' is not signed.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
W: GPG error: http://mirrors.aliyun.com/ubuntu bionic-updates InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 3B4FE6ACC0B21F32
E: The repository 'http://mirrors.aliyun.com/ubuntu bionic-updates InRelease' is not signed.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
W: GPG error: http://mirrors.aliyun.com/ubuntu bionic-backports InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 3B4FE6ACC0B21F32
E: The repository 'http://mirrors.aliyun.com/ubuntu bionic-backports InRelease' is not signed.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
W: GPG error: http://mirrors.aliyun.com/ubuntu bionic-proposed InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 3B4FE6ACC0B21F32
E: The repository 'http://mirrors.aliyun.com/ubuntu bionic-proposed InRelease' is not signed.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
执行sudo apt upgrade,报错:
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
nvidia-driver-565 : Depends: nvidia-compute-utils-565 (= 565.57.01-0ubuntu1) but it is not installed
Depends: nvidia-utils-565 (= 565.57.01-0ubuntu1) but it is not installed
Recommends: libnvidia-compute-565:i386 (= 565.57.01-0ubuntu1)
Recommends: libnvidia-decode-565:i386 (= 565.57.01-0ubuntu1)
Recommends: libnvidia-encode-565:i386 (= 565.57.01-0ubuntu1)
Recommends: libnvidia-fbc1-565:i386 (= 565.57.01-0ubuntu1)
Recommends: libnvidia-gl-565:i386 (= 565.57.01-0ubuntu1)
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).
对,查看包锁定时,我sudo apt-mark unhold package-name后,再次看哪些包锁定时,发现还是被锁定的。
其次dpkg -l | grep -i nvidia会返回
ii cuda-nvtx-12-0 12.0.140-1 amd64 NVIDIA Tools Extension
hi libnccl-dev 2.16.2-1+cuda12.0 amd64 NVIDIA Collective Communication Library (NCCL) Development Files
hi libnccl2 2.16.2-1+cuda12.0 amd64 NVIDIA Collective Communication Library (NCCL) Runtime
ii libnvidia-cfg1-565:amd64 565.57.01-0ubuntu1 amd64 NVIDIA binary OpenGL/GLX configuration library
ii libnvidia-common-565 565.57.01-0ubuntu1 all Shared files used by the NVIDIA libraries
ii libnvidia-compute-565:amd64 565.57.01-0ubuntu1 amd64 NVIDIA libcompute package
ii libnvidia-decode-565:amd64 565.57.01-0ubuntu1 amd64 NVIDIA Video Decoding runtime libraries
ii libnvidia-encode-565:amd64 565.57.01-0ubuntu1 amd64 NVENC Video Encoding runtime library
ii libnvidia-extra-565:amd64 565.57.01-0ubuntu1 amd64 Extra libraries for the NVIDIA driver
ii libnvidia-fbc1-565:amd64 565.57.01-0ubuntu1 amd64 NVIDIA OpenGL-based Framebuffer Capture runtime library
ii libnvidia-gl-565:amd64 565.57.01-0ubuntu1 amd64 NVIDIA OpenGL/GLX/EGL/GLES GLVND libraries and Vulkan ICD
iU nvidia-dkms-565 565.57.01-0ubuntu1 amd64 NVIDIA DKMS package
iU nvidia-driver-565 565.57.01-0ubuntu1 amd64 NVIDIA driver metapackage
iU nvidia-firmware-565-565.57.01 565.57.01-0ubuntu1 amd64 Firmware files used by the kernel module
iU nvidia-kernel-common-565 565.57.01-0ubuntu1 amd64 Shared files used with the kernel module
iU nvidia-kernel-source-565 565.57.01-0ubuntu1 amd64 NVIDIA kernel source package
iU nvidia-modprobe 565.57.01-0ubuntu1 amd64 Load the NVIDIA kernel driver and create device files
iU nvidia-prime 0.8.17.1 all Tools to enable NVIDIA's Prime
iU nvidia-settings 565.57.01-0ubuntu1 amd64 Tool for configuring the NVIDIA graphics driver
ii screen-resolution-extra 0.18.2 all Extension for the nvidia-settings control panel
ii xserver-xorg-video-nvidia-565 565.57.01-0ubuntu1 amd64 NVIDIA binary Xorg driver
执行nvcc -V也会返回
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2023 NVIDIA Corporation
Built on Fri_Jan__6_16:45:21_PST_2023
Cuda compilation tools, release 12.0, V12.0.140
Build cuda_12.0.r12.0/compiler.32267302_0
你的apt源不对. bionic是18.04的. 22.04是jammy
参考 https://developer.aliyun.com/article/1430362
谢谢!我已经将这里修改,sudo apt update已经没有问题了,但是,其他错误还是存在,可以麻烦您帮我看看吗
@檀檀爱吃糖: 好像是版本不对. 你的nvdia源是什么,确认下是不是ubuntu 22.04的
@www378660084: 是Ubuntu22.04滴,下面是返回的结果
cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=22.04
DISTRIB_CODENAME=jammy
DISTRIB_DESCRIPTION="Ubuntu 22.04.5 LTS"
@檀檀爱吃糖: 这是ubuntu版本,不是nvdia源的版本
@www378660084:应该是没有问题的,前面提示后边修改了的
deb http://archive.ubuntu.com/ubuntu/ jammy multiverse
deb http://archive.ubuntu.com/ubuntu/ jammy-updates multiverse
deb http://archive.ubuntu.com/ubuntu/ jammy-backports main restricted universe multiverse
deb http://security.ubuntu.com/ubuntu/ jammy-security main restricted
deb http://archive.ubuntu.com/ubuntu/ jammy multiverse
deb http://archive.ubuntu.com/ubuntu/ jammy-updates multiverse
deb http://archive.ubuntu.com/ubuntu/ jammy-backports main restricted universe multiverse
deb http://security.ubuntu.com/ubuntu/ jammy-security main restricted
deb http://security.ubuntu.com/ubuntu/ jammy-security universe
deb http://security.ubuntu.com/ubuntu/ jammy-security multiverse