In trying to upgrade my Ubuntu virtual server from 17.10 to 18.04.2 LTS:
sudo do-release-upgrade
Results in this output:
Traceback (most recent call last):
File "/usr/bin/do-release-upgrade", line 8, in <module>
from DistUpgrade.DistUpgradeVersion import VERSION
ImportError: No module named DistUpgrade.DistUpgradeVersion
This is the first import in that python script so I'm nervous that I've overlooked something fairly obvious about my python install. I checked the python link used in the do-resease-upgrade verison with:
head -n1 /usr/bin/do-release-upgrade
#!/usr/bin/python3
Verifying that the do-release-upgrade point to the correct link:
sudo which do-release-upgrade
/usr/bin/do-release-upgrade
I have verified that I have a symbolic link in /usr/bin/ to python3
lrwxrwxrwx 1 root root 18 Mar 22 12:34 python3 -> /usr/bin/python3.6
-rwxr-xr-x 2 root root 4568920 Oct 3 2017 python3.6
And should note that reinstalling python3 does not change the result. I've made no other changes to python recently.
If I run the command in python /usr/bin/python3.6
the error generated changes from ImportError to ModuleNotFound as shown below:
>>> from DistUpgrade.DistUpgradeVersion import VERSION
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'DistUpgrade'
I'm not familiar enough with this to know whether I should be searching for the DistUpgrade module to install or if there is another issue at play.
Reconfiguring the packages with sudo dpkg --configure -a
also does not fix the problem.
I did take a look at askubuntu.com/q/565107/301745 but was experiencing none of the other issues that the user was experiencing. Furthermore, I also have not attempted to remove any versions of python, as this user had. (Though, in my troubleshooting I did reinstall python3 and saw no change in behavior.)
Thank you in advance.
head -n1 /usr/bin/do-release-upgrade
? Have you made any changes to your Python setup?/usr/bin/python3.6
and dofrom DistUpgrade.DistUpgradeVersion import VERSION
, does it succeed?ImportError
vsModuleNotFoundError
. That might indicate thatsudo do-release-upgrade
is using Python 3.5 or lower. But just to confirm, did you run/usr/bin/python3.6
exactly like I said?sudo which do-release-upgrade