卸载cuda10.2 安装cuda10.0 tensorflow2.0

 

打算使用tensorflow2.0,之前的cuda10.2需要卸载掉

先使用下面这个方式卸载,但出现不完全卸载的问题,一开始没有想到使用cuda自带的卸载工具。

非cuda自带:https://blog.csdn.net/weixin_44100850/article/details/99684058

sudo apt-get remove cuda
sudo apt autoremove
sudo apt-get remove cuda*

cd /usr/local/
sudo rm -r cuda-10.2

我使用上述方法卸载10.2出错的可能原因是因为我执行了 sudo apt-get remove cuda 后提示有不少依赖库不在使用,但没有卸载,我选择了手动卸载。但并不确定是否这个操作引起的问题。

官方卸载的方法(推荐,但本次因为先使用了上面的方法,所以没试验这个):

cd /usr/local/cuda/bin
sudo ./cuda-uninstaller

之后安装10.0

sudo dpkg -i cuda-repo-ubuntu1604-10-0-local-10.0.130-410.48_1.0-1_amd64.deb
sudo apt-key add /var/cuda-repo-10-0-local-10.0.130-410.48/7fa2af80.pub
sudo apt-get update
sudo apt-get install cuda

执行 sudo apt-get update 这步的时候出现问题,发现还在尝试update cuda10.2的相关依赖包,而且报没有公钥的错误。

接着寻找彻底删除cuda10.2的方法:https://blog.csdn.net/u012074597/article/details/80317275

# --purge选项会将配置文件、数据库等删除
sudo apt-get autoremove --purge cuda

# 查看安装了哪些cuda相关的库,可以用以下指令
sudo dpkg -l |grep cuda
# 删除的包名要根据待删除的版本而定
sudo dpkg -P cuda-repo-ubuntu1604-9-1-local_9.1.85-1_amd64

# 这个key值是官网文档查到的,当然通过apt-key list也能查看
sudo apt-key list
sudo apt-key del 7fa2af80

按照这个卸载重新安装cuda10.0后又出现别的公钥的问题:

卸载cuda10.2 安装cuda10.0 tensorflow2.0_第1张图片

先搜索有人说改源,但查看我的源并没有需要改动的地方,所以不是问题的关键。

接着有搜索获得求解:https://blog.csdn.net/YangYuanhua1988/article/details/104024247

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 6494C6D6997C215E

 

重新sudo apt-get update 成功,继续cuda10.0的安装

你可能感兴趣的:(深度学习,环境配置)