1.问题描述
在自己Ubuntu22.04的服务器环境上存在cuda版本为11.5,按照官网教程升级为12.1运行安装命令
sudo apt-get -y install cuda
报错:sub-process /usr/bin/dpkg returned an error code (1)
官网教程:
2.问题原因
Fix ”sub-process /usr/bin/dpkg returned an error code (1)"The ”sub-process /usr/bin/dpkg returned an error code (1)" error points to a problem with the dpkg package manager. Find out how to fix it.https://phoenixnap.com/kb/fix-sub-process-usr-bin-dpkg-returned-error-code-1我的主要原因是:在尝试安装 CUDA 时,包管理器发现依赖关系问题,特别是与 NVIDIA 驱动程序包有关的版本冲突。
3.问题解决办法
运行下面的命令:
sudo apt install -f
再次尝试安装:
sudo apt-get -y install cuda
问题就可以解决!