mintsources is missing a dependency on python-apt

Bug #1656581 reported by Przemek Wesolek
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Linux Mint
Fix Released
Undecided
Unassigned

Bug Description

After upgrade to 18.1 from 18.0 I can't add new PPA repositories with

    add-apt-repository ppa:some/repo

The reason is the error

    Traceback (most recent call last):
      File "/usr/lib/linuxmint/mintSources/mintSources.py", line 9, in <module>
        import aptsources.distro
    ImportError: No module named aptsources.distro

The mentioned module is in package python-apt (also in python3-apt, but mintsources uses Python 2), which is not installed as a dependency of mintsources.

Installing python-apt solves the problem.

Revision history for this message
MikeG (mikegriffin) wrote :

Using lmde betsy I see a similar but different problem. Perhaps this problem and the one I reported last week are related to a transition from python2 to python3? Link https://bugs.launchpad.net/linuxmint/+bug/1655210

It seems to mix python2 and python3 based on the backtrace, though apparently I do have some dependency on apt:

root@mg:~# mintsources
Traceback (most recent call last):
  File "/usr/lib/linuxmint/mintSources/mintSources.py", line 1558, in <module>
    Application().run()
  File "/usr/lib/linuxmint/mintSources/mintSources.py", line 716, in __init__
    if self.config["general"]["use_ppas"] == "false":
KeyError: 'general'

root@mg:~# which python
/usr/bin/python
root@mg:~# ls -l /usr/bin/python
lrwxrwxrwx 1 root root 9 Dec 20 04:15 /usr/bin/python -> python2.7

root@mg:~# head -1 /usr/bin/mintsources
#!/usr/bin/python3

root@mg:~# dpkg -l | grep -i apt | grep -i python
ii python-apt 1.1.0~beta5 amd64 Python interface to libapt-pkg
ii python-apt-common 1.1.0~beta5 all Python interface to libapt-pkg (locales)
ii python3-apt 1.1.0~beta5 amd64 Python 3 interface to libapt-pkg

root@mg:~# dpkg -l | grep -i mintsources
ii mintsources 1.6.3 all Software Sources configuration tool

root@mg:~# add-apt-repository ppa:some/repo
Traceback (most recent call last):
  File "/usr/lib/linuxmint/mintSources/mintSources.py", line 1551, 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'

Testing removal of deps:

root@mg:~# apt-get autoremove --purge python-apt --simulate
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be REMOVED:
  python-apt*
0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
Purg python-apt [1.1.0~beta5]

root@mg:~# apt-get autoremove --purge python3-apt --simulate
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be REMOVED:
  gdebi-core* gir1.2-appindicator3-0.1* mintupdate* python3-apt* python3-pycurl*
  unattended-upgrades*
0 upgraded, 0 newly installed, 6 to remove and 0 not upgraded.
Purg gdebi-core [0.9.5.7+nmu1]
Purg mintupdate [5.2.0]
Purg gir1.2-appindicator3-0.1 [0.4.92-4]
Purg unattended-upgrades [0.93.1]
Purg python3-apt [1.1.0~beta5]
Purg python3-pycurl [7.43.0-2]

root@mg:~# apt-get autoremove --purge $(deborphan --guess-all)
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be REMOVED:
  python3-gi*
0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
After this operation, 958 kB disk space will be freed.
Do you want to continue? [Y/n] n
Abort.

Revision history for this message
Ryba (sepatel) wrote :

Thank you so much for answering this problem for me. I had this exact same issue but your mention of

"Installing python-apt solves the problem."

was the issue. I don't know how it happened that I didn't have it but installing it fixed the problem for me as well.

Vlad Orlov (monsta)
Changed in linuxmint:
status: New → Confirmed
Revision history for this message
Vlad Orlov (monsta) wrote :

Fixed several years ago

Changed in linuxmint:
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.