do-release-upgrade fails with "Your python3 install is corrupted" if /usr/bin/python points to /etc/alternatives/python
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
ubuntu-release-upgrader (Ubuntu) |
Fix Released
|
Undecided
|
Steve Langasek | ||
Eoan |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
do-release-upgrade from 18.04 to 18.10 fails (likewise, when I upgraded with a workaround the same happened for 18.10 -> 19.04):
"
Reading cache
Checking package manager
Can not upgrade
Your python3 install is corrupted. Please fix the '/usr/bin/python3'
symlink.
=== Command terminated with exit status 1 (Sat Apr 20 17:19:49 2019) ===
"
There is nothing wrong with /usr/bin/python3
➜ ~ ls -al /usr/bin/python3
lrwxrwxrwx 1 root root 9 окт 25 14:11 /usr/bin/python3 -> python3.6
I also have python2 installed for which Debian alternatives are configured which causes the problem as far as I can see:
➜ ~ update-alternatives --display python
python - auto mode
link best version is /usr/bin/python2.7
link currently points to /usr/bin/python2.7
link python is /usr/bin/python
/usr/bin/python2.7 - priority 100
(Pdb) l
11 debian_defaults = '/usr/share/
12 if os.path.
13 config = SafeConfigParser()
14 with open(debian_
15 config.readfp(f)
16 -> try:
17 expected_default = config.
18 except NoOptionError:
19 logging.debug("no default version for %s found in '%s'" %
20 (binary, config))
21 return False
(Pdb) n
> <ipython-
-> expected_default = config.
(Pdb) n
> <ipython-
-> try:
(Pdb) expected_default
'python2.7'
> <ipython-
-> fs_default_version = os.readlink(
(Pdb) n
> <ipython-
-> if not fs_default_version in (expected_default, os.path.
(Pdb) fs_default_version
'/etc/alternati
(Pdb) os.path.
'/usr/bin/
(Pdb) not fs_default_version in (expected_default, os.path.
True
(Pdb) print("%s symlink points to: '%s', but expected is '%s' or '%s'" % (binary, fs_default_version, expected_default, os.path.
python symlink points to: '/etc/alternati
A workaround is:
sudo rm /usr/bin/python
sudo ln -s /usr/bin/python2.7 /usr/bin/python
do-release-upgrade
Related branches
- Brian Murray: Approve
- Steve Langasek: Approve
- Dmitrii Shcherbakov (community): Approve
-
Diff: 1011 lines (+194/-175)9 files modifiedDistUpgrade/DistUpgradeController.py (+3/-5)
debian/changelog (+10/-0)
po/ubuntu-release-upgrader.pot (+175/-162)
setup.py (+1/-1)
tests/patchdir/pycompile_orig (+1/-1)
tests/test_apport_crash.py (+1/-1)
tests/test_end_of_life.py (+1/-1)
utils/demotions.py (+1/-1)
utils/est_kernel_size.py (+1/-3)
description: | updated |
description: | updated |
Changed in ubuntu-release-upgrader (Ubuntu): | |
status: | Confirmed → Fix Committed |
status: | Fix Committed → In Progress |
assignee: | nobody → Steve Langasek (vorlon) |
Status changed to 'Confirmed' because the bug affects multiple users.