系统相关
首页 > 系统相关> > linux-mint – ConfigParser.NoSectionError:没有部分:’general’在尝试添加存储库时

linux-mint – ConfigParser.NoSectionError:没有部分:’general’在尝试添加存储库时

作者:互联网

当我尝试sudo add-apt-repository< any>时,我收到此错误:

Traceback (most recent call last):
  File "/usr/lib/linuxmint/mintSources/mintSources.py", line 1387, in <module>
    codename = config_parser.get("general", "base_codename")
  File "/usr/lib/python2.7/ConfigParser.py", line 330, in get
    raise NoSectionError(section)
ConfigParser.NoSectionError: No section: 'general'

我怎样才能解决这个问题?

它可能是由我将python切换到python3引起的吗?
(现在python –version是Python 3.5.1和python2 –version是Python 2.7.6)

解决方法:

检查你的lsb-release文件.你改变了lsb-release的内容吗?它位于/ etc / lsb-release上

更改lsb-release的内容以匹配您的版本.这样的事情:

DISTRIB_ID=LinuxMint
DISTRIB_RELEASE=18
DISTRIB_CODENAME=sarah
DISTRIB_DESCRIPTION="Linux Mint 18 sarah"

标签:python,apt,ppa,linux-mint
来源: https://codeday.me/bug/20190815/1661884.html