Can't upgrade from 17.10 to 18.04

I am running 17.10 and here is what it get in the terminal. I have searched and searched and can’t find anything relating to this error or what it even means. Please help.

===
root@MOMBOX:/# do-release-upgrade

Traceback (most recent call last):
File “/usr/lib/python3/dist-packages/apt/cache.py”, line 194, in getitem
return self._weakref[key]
File “/usr/lib/python3.6/weakref.py”, line 137, in getitem
o = self.datakey
KeyError: ‘ubuntu-desktop’

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “/tmp/ubuntu-release-upgrader-zusati2b/bionic”, line 8, in
sys.exit(main())
File “/tmp/ubuntu-release-upgrader-zusati2b/DistUpgrade/DistUpgradeMain.py”, line 238, in main
if app.run():
File “/tmp/ubuntu-release-upgrader-zusati2b/DistUpgrade/DistUpgradeController.py”, line 1949, in run
return self.fullUpgrade()
File “/tmp/ubuntu-release-upgrader-zusati2b/DistUpgrade/DistUpgradeController.py”, line 1826, in fullUpgrade
if not self.doPostInitialUpdate():
File “/tmp/ubuntu-release-upgrader-zusati2b/DistUpgrade/DistUpgradeController.py”, line 893, in doPostInitialUpdate
self.quirks.run(“PostInitialUpdate”)
File “/tmp/ubuntu-release-upgrader-zusati2b/DistUpgrade/DistUpgradeQuirks.py”, line 113, in run
func()
File “/tmp/ubuntu-release-upgrader-zusati2b/DistUpgrade/DistUpgradeQuirks.py”, line 132, in bionicPostInitialUpdate
if self.controller.cache[‘ubuntu-desktop’].is_installed:
File “/usr/lib/python3/dist-packages/apt/cache.py”, line 204, in getitem
raise KeyError(‘The cache has no package named %r’ % key)
KeyError: “The cache has no package named ‘ubuntu-desktop’”
Error in sys.excepthook:
Traceback (most recent call last):
File “/usr/lib/python3/dist-packages/problem_report.py”, line 497, in add_to_existing
self.write(f)
File “/usr/lib/python3/dist-packages/problem_report.py”, line 450, in write
block = f.read(1048576)
File “/usr/lib/python3.6/codecs.py”, line 321, in decode
(result, consumed) = self._buffer_decode(data, self.errors, final)
UnicodeDecodeError: ‘utf-8’ codec can’t decode byte 0x8b in position 1: invalid start byte

Original exception was:
Traceback (most recent call last):
File “/usr/lib/python3/dist-packages/apt/cache.py”, line 194, in getitem
return self._weakref[key]
File “/usr/lib/python3.6/weakref.py”, line 137, in getitem
o = self.datakey
KeyError: ‘ubuntu-desktop’

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “/tmp/ubuntu-release-upgrader-zusati2b/bionic”, line 8, in
sys.exit(main())
File “/tmp/ubuntu-release-upgrader-zusati2b/DistUpgrade/DistUpgradeMain.py”, line 238, in main
if app.run():
File “/tmp/ubuntu-release-upgrader-zusati2b/DistUpgrade/DistUpgradeController.py”, line 1949, in run
return self.fullUpgrade()
File “/tmp/ubuntu-release-upgrader-zusati2b/DistUpgrade/DistUpgradeController.py”, line 1826, in fullUpgrade
if not self.doPostInitialUpdate():
File “/tmp/ubuntu-release-upgrader-zusati2b/DistUpgrade/DistUpgradeController.py”, line 893, in doPostInitialUpdate
self.quirks.run(“PostInitialUpdate”)
File “/tmp/ubuntu-release-upgrader-zusati2b/DistUpgrade/DistUpgradeQuirks.py”, line 113, in run
func()
File “/tmp/ubuntu-release-upgrader-zusati2b/DistUpgrade/DistUpgradeQuirks.py”, line 132, in bionicPostInitialUpdate
if self.controller.cache[‘ubuntu-desktop’].is_installed:
File “/usr/lib/python3/dist-packages/apt/cache.py”, line 204, in getitem
raise KeyError(‘The cache has no package named %r’ % key)
KeyError: “The cache has no package named ‘ubuntu-desktop’”

Hi,

I tried that route also and it was not pretty when i got it to upgrade. In the end i was stuck between 17.10 and 18.04 without a proper way out.

So my advice.

  1. Run backups to an external folder
  2. Save a list of installed apps (use aptik or similar).
  3. Then do a clean install
  4. Run backups to restore your data.
  5. Run aptik to restore apps.

Good luck!

Seems to be locale issue. Try to force C locale:

LC_ALL=C do-release-upgrade