4

When I try to sudo add-apt-repository <any>, I get this error:

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'

How can I fix this?

Could it have been caused by my switching python to python3?
(Now python --version is Python 3.5.1 and python2 --version is Python 2.7.6)

Bloke
  • 231
  • 3
  • 5
  • Try installing `mintsystem` which seems to solve many similar cases. – Julie Pelletier Jan 15 '17 at 03:59
  • `apt-get install` says _mintsystem is already the newest version_; Tried `--reinstall` then, which reinstalled successfully (except for "_update-rc.d: warning: default stop runlevel arguments (0 1 6) do not match mintsystem Default-Stop values (none)_"), and then restarted, but I still get the same error – Bloke Jan 15 '17 at 14:04
  • I ended up setting `python` back to `python2` instead of `python3`, and everything has been ok since then :/ I might have also reinstalled `pyenv`. So I'm not sure what *exactly* caused this nor what *exactly* fixed it. – Bloke Jun 01 '17 at 11:49

2 Answers2

1

check your lsb-release file. did you change lsb-release contents? its located on /etc/lsb-release

change content of lsb-release to match your release. something like this:

DISTRIB_ID=LinuxMint
DISTRIB_RELEASE=18
DISTRIB_CODENAME=sarah
DISTRIB_DESCRIPTION="Linux Mint 18 sarah"
haw3d
  • 163
  • 6
0

Until a better answer comes along, here is the copy of my comment about how I got around this in the end.


I ended up setting python back to python2 instead of python3, and everything has been ok since then :/ I might have also reinstalled pyenv. So I'm not sure what exactly caused this nor what exactly fixed it.

Bloke
  • 231
  • 3
  • 5