今さらながらUbuntu 16.04→18.04へのアプデをしたらエラーが出た【ValueError: unknown locale: UTF-8】

Oct. 28, 2022, 1:42 a.m. edited Oct. 28, 2022, 2:19 a.m.

#Linux 

アプデ開始・・・!

$ sudo do-release-upgrade -d
Checking for a new Ubuntu release
ERROR:root:gedefaultlocale() failed
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/UpdateManager/Core/utils.py", line 406, in get_lang
    (locale_s, encoding) = locale.getdefaultlocale()
  File "/usr/lib/python3.5/locale.py", line 558, in getdefaultlocale
    return _parse_localename(localename)
  File "/usr/lib/python3.5/locale.py", line 486, in _parse_localename
    raise ValueError('unknown locale: %s' % localename)
ValueError: unknown locale: UTF-8
ERROR:root:gedefaultlocale() failed
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/UpdateManager/Core/utils.py", line 406, in get_lang
    (locale_s, encoding) = locale.getdefaultlocale()
  File "/usr/lib/python3.5/locale.py", line 558, in getdefaultlocale
    return _parse_localename(localename)
  File "/usr/lib/python3.5/locale.py", line 486, in _parse_localename
    raise ValueError('unknown locale: %s' % localename)
ValueError: unknown locale: UTF-8
ERROR:root:gedefaultlocale() failed
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/UpdateManager/Core/utils.py", line 406, in get_lang
    (locale_s, encoding) = locale.getdefaultlocale()
  File "/usr/lib/python3.5/locale.py", line 558, in getdefaultlocale
    return _parse_localename(localename)
  File "/usr/lib/python3.5/locale.py", line 486, in _parse_localename
    raise ValueError('unknown locale: %s' % localename)
ValueError: unknown locale: UTF-8
ERROR:root:gedefaultlocale() failed
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/UpdateManager/Core/utils.py", line 406, in get_lang
    (locale_s, encoding) = locale.getdefaultlocale()
  File "/usr/lib/python3.5/locale.py", line 558, in getdefaultlocale
    return _parse_localename(localename)
  File "/usr/lib/python3.5/locale.py", line 486, in _parse_localename
    raise ValueError('unknown locale: %s' % localename)
ValueError: unknown locale: UTF-8
Upgrades to the development release are only
available from the latest supported release.

エラー・・・?!

locale error running sudo do-release-upgradeを参考に

$ export LC_ALL="en_US.utf8"
$ sudo do-release-upgrade -d
Checking for a new Ubuntu release
Upgrades to the development release are only
available from the latest supported release.

???

$ sudo do-release-upgrade -c
Checking for a new Ubuntu release
New release '18.04.6 LTS' available.
Run 'do-release-upgrade' to upgrade to it.

真面目に do-release-upgrade を読む。なるほど、 -d は the latest devel release へ上げるものなのか。それなら LTS から LTS したい自分は特にオプションつける必要ないんだ(ちゃんとドキュメント読んでから実行しましょう)

ということで、

$ sudo do-release-upgrade

から時々 y や Enter 押してたら

Welcome to Ubuntu 18.04.6 LTS (GNU/Linux 4.15.0-194-generic x86_64)

よかったよかった。