![在运行 Ubuntu 14.04 的 BeagleBone Black 上,do-release-upgrade 失败,出现编码错误](https://linux22.com/image/884038/%E5%9C%A8%E8%BF%90%E8%A1%8C%20Ubuntu%2014.04%20%E7%9A%84%20BeagleBone%20Black%20%E4%B8%8A%EF%BC%8Cdo-release-upgrade%20%E5%A4%B1%E8%B4%A5%EF%BC%8C%E5%87%BA%E7%8E%B0%E7%BC%96%E7%A0%81%E9%94%99%E8%AF%AF.png)
# do-release-upgrade
Checking for a new Ubuntu release
Get:1 Upgrade tool signature [198 B]
Get:2 Upgrade tool [1230 kB]
Fetched 1230 kB in 0s (0 B/s)
authenticate 'wily.tar.gz' against 'wily.tar.gz.gpg'
extracting 'wily.tar.gz'
Zwischenspeicher wird gelesen
Ein schwerwiegender Fehler ist aufgetreten
Error in sys.excepthook:
Traceback (most recent call last):
File "/tmp/ubuntu-release-upgrader-d3h4k3i1/DistUpgrade/DistUpgradeViewText.py", line 142, in _handleException
"\n".join(lines))
File "/tmp/ubuntu-release-upgrader-d3h4k3i1/DistUpgrade/DistUpgradeViewText.py", line 177, in error
print(twrap(msg))
UnicodeEncodeError: 'ascii' codec can't encode character '\xfc' in position 45: ordinal not in range(128)
Original exception was:
Traceback (most recent call last):
File "/tmp/ubuntu-release-upgrader-d3h4k3i1/wily", line 8, in <module>
sys.exit(main())
File "/tmp/ubuntu-release-upgrader-d3h4k3i1/DistUpgrade/DistUpgradeMain.py", line 240, in main
if app.run():
File "/tmp/ubuntu-release-upgrader-d3h4k3i1/DistUpgrade/DistUpgradeController.py", line 1837, in run
return self.fullUpgrade()
File "/tmp/ubuntu-release-upgrader-d3h4k3i1/DistUpgrade/DistUpgradeController.py", line 1652, in fullUpgrade
self._view.updateStatus(_("Checking package manager"))
File "/tmp/ubuntu-release-upgrader-d3h4k3i1/DistUpgrade/DistUpgradeViewText.py", line 156, in updateStatus
print(msg)
UnicodeEncodeError: 'ascii' codec can't encode character '\xfc' in position 21: ordinal not in range(128)
如果 LANG 设置为 de_DE.UTF-8,就会发生这种情况。
如果在升级之前设置了 export LANG=en,则不会发生这种情况。
为什么会发生这种情况?