在 Ubuntu 16上,16.04安装 CUDA 8: 无法定位软件包 cuda

分享于 

3分钟阅读

ubuntu

  繁體

问题

以下官方说明:


michael@Pascal:~/temp$ ll


total 1.8G


-rw-r--r-- 1 root 1.8G Feb 1 2017 cuda-repo-ubuntu1604-8-0-local-ga2_8.0.61-1_amd64.deb



michael@Pascal:~/temp$ sudo dpkg -i cuda-repo-ubuntu1604-8-0-local-ga2_8.0.61-1_amd64.deb


(Reading database ... 92745 files and directories currently installed.)


Preparing to unpack cuda-repo-ubuntu1604-8-0-local-ga2_8.0.61-1_amd64.deb ...


Unpacking cuda-repo-ubuntu1604-8-0-local-ga2 (8.0.61-1) over (8.0.61-1) ...


Setting up cuda-repo-ubuntu1604-8-0-local-ga2 (8.0.61-1) ...


OK



michael@Pascal:~/temp$ sudo apt-get update


Hit:1 http://archive.canonical.com/ubuntu xenial InRelease


Hit:2 http://us.archive.ubuntu.com/ubuntu xenial InRelease


Get:3 http://us.archive.ubuntu.com/ubuntu xenial-updates InRelease [102 kB]


Hit:4 http://security.ubuntu.com/ubuntu xenial-security InRelease


Hit:5 http://archive.ubuntu.com/ubuntu xenial InRelease


Hit:6 http://archive.ubuntu.com/ubuntu xenial-updates InRelease


Get:7 http://us.archive.ubuntu.com/ubuntu xenial-backports InRelease [102 kB]


Hit:8 http://archive.ubuntu.com/ubuntu xenial-backports InRelease


Hit:9 http://archive.ubuntu.com/ubuntu xenial-security InRelease


Fetched 204 kB in 0s (267 kB/s)


Reading package lists... Done



michael@Pascal:~/temp$ sudo apt-get install cuda


Reading package lists... Done


Building dependency tree


Reading state information... Done


E: Unable to locate package cuda



我尝试手动将.deb文件复制到/var/cuda-repo-8-0-local-ga2,但得到相同的错误。


答案1

我试图在Ubuntu 17.10上安装CUDA 9.0,遇到了这个问题,通过取消注释 /etc/apt/sources.list.d/cuda-9-0-local.list


# deb file:///var/cuda-repo-9-0-local / # disabled on upgrade to artful



> >


deb file:///var/cuda-repo-9-0-local /




答案2

解决方案是在尝试重新安装之前清除这些残余:


dpkg -l | grep '^rc' | awk '{print $2}' | sudo xargs dpkg --purge





PAC  PACK  LOC  Ubuntu  installing  CUDA