安装cuda10.0过程中遇到的问题

由于一不小心手残点了更新系统,从此踏上了Ubuntu18.04的万劫不复之路......

ubuntu18.04与cuda10.0以上的版本匹配,而我在原来的ubuntu16.04中安装的是cuda9.0,为避免程序运行出现错误,打算重装cuda10.0(本人ubuntu新手,不知为何程序仍能在TensorFlow+GPU环境中运行)。过程比较坎坷,记录一下问题及解决措施:

1. sudo apt-get update指令报错,经检查发现软件源并未跟新,还是ubuntu16.04的软件源

解决措施:网上很多教程,经过尝试N多次用此方法成功。 https://blog.csdn.net/qq_35608277/article/details/83188337

Ubuntu 18.04 (LTS)代号为bionic。更换 /etc/apt/sources.list.d文件

sudo vim /etc/apt/sources.list

deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse

deb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse

deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse

deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse

deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse

deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse

deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse

deb-src http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse

deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse

deb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse




sudo apt-get update
sudo apt-get upgrade

2. 在未完成下载的情况下将terminal close。此时 apt-get进程可能没有结束。结果,如果再次运行apt-get install 命令安装软件时,出现如下错误。即有另一个程序正在占用apt-get install进程,由于它在运行时,会占用软件源更新时的系统锁(简称‘系统更新锁’),此时资源被锁。

E: 无法获得锁 /var/lib/dpkg/lock-frontend - open (11: 资源暂时不可用)
E: Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), is another process using it?
参考博文 https://blog.csdn.net/qq_38019633/article/details/84024309

查看当前未结束的进程:ps -e|grep apt-get

显示: 6965 ?        00:00:01 apt-get

杀死当前进程: sudo kill 6965

3. 具体错误没保存,类似:libcairo2-dev : Depends: libfontconfig1-dev (>= 2.2.95) but it is not going to be installed解决办法

参考链接:https://blog.csdn.net/weixin_42343812/article/details/87619153

问题描述

The following packages have unmet dependencies:
libcairo2-dev : Depends: libfontconfig1-dev (>= 2.2.95) but it is not going to be installed
Depends: libglib2.0-dev but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
解决办法 

sudo apt-get install aptitude       

sudo aptitude install libcairo2-dev

遇到其他unmet dependencies问题可以这样做。
 

你可能感兴趣的:(安装cuda10.0过程中遇到的问题)