Discussion:
Upgrade ubuntu server from 16.04 to 18.04? Second part.
(too old to reply)
jp
2021-02-28 01:18:39 UTC
Permalink
Hello,

I have found that removing python (apt-get remove python) make the
do-release-upgrade working. But now I have the error that follows:

-----
***@server:/home/user# do-release-upgrade
Checking for a new Ubuntu release
WARNING:root:could not open file '/etc/apt/sources.list'

WARNING:root:could not open file '/etc/apt/sources.list'

Get:1 Upgrade tool signature [819 B]

Get:2 Upgrade tool [1248 kB]

Fetched 1248 kB in 0s (0 B/s)

authenticate 'bionic.tar.gz' against 'bionic.tar.gz.gpg'
extracting 'bionic.tar.gz'

Lecture du cache (cache reading)



Une erreur fatale est survenue (a fatal error occured)

Error in sys.excepthook:
Traceback (most recent call last):
File
"/tmp/ubuntu-release-upgrader-sw7rffhv/DistUpgrade/DistUpgradeViewText.py",
line 147, in _handleException
"\n".join(lines))
File
"/tmp/ubuntu-release-upgrader-sw7rffhv/DistUpgrade/DistUpgradeViewText.py",
line 183, in error
print(twrap(msg))
UnicodeEncodeError: 'ascii' codec can't encode character '\xe8' in
position 26: ordinal not in range(128)

Original exception was:
Traceback (most recent call last):
File "/tmp/ubuntu-release-upgrader-sw7rffhv/bionic", line 8, in <module>
sys.exit(main())
File
"/tmp/ubuntu-release-upgrader-sw7rffhv/DistUpgrade/DistUpgradeMain.py",
line 238, in main
if app.run():
File
"/tmp/ubuntu-release-upgrader-sw7rffhv/DistUpgrade/DistUpgradeController.py",
line 2072, in run
return self.fullUpgrade()
File
"/tmp/ubuntu-release-upgrader-sw7rffhv/DistUpgrade/DistUpgradeController.py",
line 1843, in fullUpgrade
self._view.updateStatus(_("Checking package manager"))
File
"/tmp/ubuntu-release-upgrader-sw7rffhv/DistUpgrade/DistUpgradeViewText.py",
line 161, in updateStatus
print(msg)
UnicodeEncodeError: 'ascii' codec can't encode character '\xe9' in
position 1: ordinal not in range(128)
***@server:/home/user#
-----

Does anyone have an idea to solve this error so I'll be able to upgrade?

Thanks
Jonathan N. Little
2021-02-28 03:10:34 UTC
Permalink
Post by jp
Hello,
I have found that removing python (apt-get remove python) make the
-----
Checking for a new Ubuntu release
WARNING:root:could not open file '/etc/apt/sources.list'
WARNING:root:could not open file '/etc/apt/sources.list'
Okay so why did you delete your /etc/apt/sources.list file?

You can use the default one

sudo cp /usr/share/doc/apt/examples/sources.list /etc/apt/sources.list

should fix your issue.
--
Take care,

Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com
jp
2021-02-28 11:27:24 UTC
Permalink
Post by Jonathan N. Little
sudo cp /usr/share/doc/apt/examples/sources.list /etc/apt/sources.list
should fix your issue.
Thank you. I haven't the warning now but I have still errors. I have
reinstalled python and it is the same thing. Here is the error:

-----
***@server:/home/user# do-release-upgrade
Checking for a new Ubuntu release
Get:1 Upgrade tool signature [819 B]

Get:2 Upgrade tool [1248 kB]

Fetched 1248 kB in 0s (0 B/s)

authenticate 'bionic.tar.gz' against 'bionic.tar.gz.gpg'
extracting 'bionic.tar.gz'

Lecture du cache (cache reading)



Une erreur fatale est survenue (a fatal error is occured)

Error in sys.excepthook:
Traceback (most recent call last):
File
"/tmp/ubuntu-release-upgrader-4xr47_qk/DistUpgrade/DistUpgradeViewText.py",
line 147, in _handleException
"\n".join(lines))
File
"/tmp/ubuntu-release-upgrader-4xr47_qk/DistUpgrade/DistUpgradeViewText.py",
line 183, in error
print(twrap(msg))
UnicodeEncodeError: 'ascii' codec can't encode character '\xe8' in
position 26: ordinal not in range(128)

Original exception was:
Traceback (most recent call last):
File "/tmp/ubuntu-release-upgrader-4xr47_qk/bionic", line 8, in <module>
sys.exit(main())
File
"/tmp/ubuntu-release-upgrader-4xr47_qk/DistUpgrade/DistUpgradeMain.py",
line 238, in main
if app.run():
File
"/tmp/ubuntu-release-upgrader-4xr47_qk/DistUpgrade/DistUpgradeController.py",
line 2072, in run
return self.fullUpgrade()
File
"/tmp/ubuntu-release-upgrader-4xr47_qk/DistUpgrade/DistUpgradeController.py",
line 1843, in fullUpgrade
self._view.updateStatus(_("Checking package manager"))
File
"/tmp/ubuntu-release-upgrader-4xr47_qk/DistUpgrade/DistUpgradeViewText.py",
line 161, in updateStatus
print(msg)
UnicodeEncodeError: 'ascii' codec can't encode character '\xe9' in
position 1: ordinal not in range(128)
***@server:/home/user#
-----

What must I reinstall to make do-release-upgrade running?

Thank you.
Andrei Z.
2021-02-28 13:28:10 UTC
Permalink
Post by jp
Post by Jonathan N. Little
sudo cp /usr/share/doc/apt/examples/sources.list /etc/apt/sources.list
should fix your issue.
Thank you. I haven't the warning now but I have still errors. I have
-----
Checking for a new Ubuntu release
Get:1 Upgrade tool signature [819 B]
Get:2 Upgrade tool [1248 kB]
Fetched 1248 kB in 0s (0 B/s)
authenticate 'bionic.tar.gz' against 'bionic.tar.gz.gpg'
extracting 'bionic.tar.gz'
Lecture du cache (cache reading)
Une erreur fatale est survenue  (a fatal error is occured)
  File
"/tmp/ubuntu-release-upgrader-4xr47_qk/DistUpgrade/DistUpgradeViewText.py",
line 147, in _handleException
    "\n".join(lines))
  File
"/tmp/ubuntu-release-upgrader-4xr47_qk/DistUpgrade/DistUpgradeViewText.py",
line 183, in error
    print(twrap(msg))
UnicodeEncodeError: 'ascii' codec can't encode character '\xe8' in
position 26: ordinal not in range(128)
  File "/tmp/ubuntu-release-upgrader-4xr47_qk/bionic", line 8, in <module>
    sys.exit(main())
  File
"/tmp/ubuntu-release-upgrader-4xr47_qk/DistUpgrade/DistUpgradeMain.py",
line 238, in main
  File
"/tmp/ubuntu-release-upgrader-4xr47_qk/DistUpgrade/DistUpgradeController.py",
line 2072, in run
    return self.fullUpgrade()
  File
"/tmp/ubuntu-release-upgrader-4xr47_qk/DistUpgrade/DistUpgradeController.py",
line 1843, in fullUpgrade
    self._view.updateStatus(_("Checking package manager"))
  File
"/tmp/ubuntu-release-upgrader-4xr47_qk/DistUpgrade/DistUpgradeViewText.py",
line 161, in updateStatus
    print(msg)
UnicodeEncodeError: 'ascii' codec can't encode character '\xe9' in
position 1: ordinal not in range(128)
-----
What must I reinstall to make do-release-upgrade running?
Thank you.
https://stackoverflow.com/questions/9942594/unicodeencodeerror-ascii-codec-cant-encode-character-u-xa0-in-position-20

https://bugs.launchpad.net/ubuntu/+source/ubuntu-release-upgrader/+bug/1278280/comments/9

Try
LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8 LANGUAGE=en_US.UTF-8 do-release-upgrade
jp
2021-02-28 20:03:44 UTC
Permalink
Post by Andrei Z.
Try
LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8 LANGUAGE=en_US.UTF-8 do-release-upgrade
It worked!!! Many thanks.

Loading...