一开始装Ubuntu时装的是16.04,后来装cuda时,发现核是4.15的,需要升级到18.04,于是输入sudo do-release-upgrade
更新时,发现错误:
no module named DistUpgrade
google后发现帖子:
https://askubuntu.com/questions/1127896/failed-upgrade-from-17-10-to-18-04-no-module-named-distupgrade-distupgradever
想到先前曾经装过python3.7,代替了原装的python3.5,可能是这里导致了问题。
解决办法
head -n1 /usr/bin/do-release-upgrade # 找到指向的python sudo rm -rf /usr/bin/python3 # 上面找到的python链接 ln -s /usr/bin/python3.5 /usr/bin/python3 # 用原始链接替换
然后再运行 sudo do-release-upgrade 就可以更新了。