UnicodeDecodeError: 'utf-8' 编解码器无法解码位置 17 处的字节 0xfc: 无效的起始字节

UnicodeDecodeError: 'utf-8' 编解码器无法解码位置 17 处的字节 0xfc: 无效的起始字节

我想在 Ubuntu 18.04 上与 Let's Encrypt 一起安装 Nginx,并且已经安装了此包:

software-properties-common

当我尝试使用该命令时:

sudo add-apt-repository ppa:certbot/certbot

添加 certbot 的存储库时,我收到以下错误消息:

Traceback (most recent call last):
  File "/usr/bin/add-apt-repository", line 107, in <module>
    sp = SoftwareProperties(options=options)
  File "/usr/lib/python3/dist-packages/softwareproperties/SoftwareProperties.py", line 122, in __init__
    self.sourceslist = SourcesList()
  File "/usr/lib/python3/dist-packages/aptsources/sourceslist.py", line 273, in __init__
    self.matcher = SourceEntryMatcher(matcherPath)
  File "/usr/lib/python3/dist-packages/aptsources/sourceslist.py", line 457, in __init__
    dist = DistInfo(f, base_dir=matcherPath)
  File "/usr/lib/python3/dist-packages/aptsources/distinfo.py", line 261, in __init__
    component.set_description(_(value))

UnicodeDecodeError: 'utf-8' codec can't decode byte 0xfc in position 17: invalid start byte

我该如何修复这个错误?

答案1

答案发布于一条评论经过罗兰·弗吕豪夫

我的语言环境存在问题,使用此命令可以解决问题:

LC_ALL=C.UTF-8

相关内容