Results 1 to 3 of 3

Thread: 2020.3 kali apt update now giving module not found error

  1. #1
    Join Date
    2020-Jun
    Posts
    9

    2020.3 kali apt update now giving module not found error

    Pls help APT now broken.

    Posted on stack exchange as well.

    I did a sudo apt update && sudo apt full-upgrade -y and received the following error:

    >>>>>>>>>>>>>>>>>>>>>>>>>>>>
    File "/usr/bin/pycompile", line 35, in <module>
    from debpython.version import SUPPORTED, debsorted, vrepr, \

    File "/usr/share/python/debpython/version.py", line 24, in <module>
    from ConfigParser import SafeConfigParser
    ModuleNotFoundError: No module named 'ConfigParser'
    >>>>>>>>>>>>>>>>>>>>>>>>>>>>>

    After reading, I think this is related to either a manual fiddling somewhere in /usr/bin (Now I have read never to do that, but I can't recall if ever I did in the past...), or something related to the default python version the distro requires.

    This is what I can see in terms of the python on the system: /usr/bin/python is a link to python2 and python2 is a link to python2.7.
    Not sure if this is pointing to the correct version or even related to the error above?

    Python -V shows : 2.7.18

    After some advise received , I tried :

    >>>>>>>>>>>>>>>>>>>>>>>>>>>>
    sudo apt -f --reinstall install python-configparser
    & This is what I got :

    Reading package lists... Done
    Building dependency tree
    Reading state information... Done
    0 upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 0 not upgraded.
    2 not fully installed or removed.
    Need to get 62.6 kB of archives.
    After this operation, 0 B of additional disk space will be used.
    Get:1 http://kali.download/kali kali-rolling/main amd64 python-configparser all 3.5.0b2-3 [62.6 kB]
    Fetched 62.6 kB in 1s (57.7 kB/s)
    (Reading database ... 402234 files and directories currently installed.)
    Preparing to unpack .../python-configparser_3.5.0b2-3_all.deb ...
    Unpacking python-configparser (3.5.0b2-3) over (3.5.0b2-3) ...
    Setting up mercurial-common (5.4.1-1) ...
    Traceback (most recent call last):
    File "/usr/bin/pycompile", line 35, in <module>
    from debpython.version import SUPPORTED, debsorted, vrepr, \
    File "/usr/share/python/debpython/version.py", line 24, in <module>
    from ConfigParser import SafeConfigParser
    ModuleNotFoundError: No module named 'ConfigParser'
    dpkg: error processing package mercurial-common (--configure):
    installed mercurial-common package post-installation script subprocess returned error exit status 1
    Setting up python-configparser (3.5.0b2-3) ...
    Traceback (most recent call last):
    File "/usr/bin/pycompile", line 35, in <module>
    from debpython.version import SUPPORTED, debsorted, vrepr, \
    File "/usr/share/python/debpython/version.py", line 24, in <module>
    from ConfigParser import SafeConfigParser
    ModuleNotFoundError: No module named 'ConfigParser'
    dpkg: error processing package python-configparser (--configure):
    installed python-configparser package post-installation script subprocess returned error exit status 1
    dpkg: dependency problems prevent configuration of mercurial:
    mercurial depends on mercurial-common (= 5.4.1-1); however:
    Package mercurial-common is not configured yet.

    dpkg: error processing package mercurial (--configure):
    dependency problems - leaving unconfigured
    Errors were encountered while processing:
    mercurial-common
    python-configparser
    mercurial
    >>>>>>>>>>>>>>>>>>>>>>>>>>>>>
    I still get the error.

    Also noticed that ConfigParser is present in /usr/lib/python2.7 :
    >>>>>>>>>>>>>>>>>>>>>>>>>>>>>
    ⚡ ls /usr/lib/python2.7 | grep Con

    & this is what I get :
    ConfigParser.py
    ConfigParser.pyc

    >>>>>>>>>>>>>>>>>>>>>>>>>>>>>

    I now get this message even when trying to install posix man pages package as example. So everything on APT is then broken ?

    Any ideas on how to troubleshoot or fix this please ?

  2. #2
    Join Date
    2020-Jun
    Posts
    9
    Still no working solution ��

  3. #3
    Join Date
    2020-Jun
    Posts
    9
    just in-case someone search I want to document what I did to solve this :

    After various other forums etc etc.... and doing a lot of experimenting :-). nothing worked.

    Tried the #apt-cache rdepends commands again on all python,python2,python3 and the

    python#-minimal packages and noticed that python2.7 was often showing duplicates in the outputs.

    Then tried
    #dpkg -V (package)
    on the various different python packages and python2-minimal basically gave me a weird output with some "?" on the left and mentioned pycompile(sorry I did not screenshot that at the time) but it was the only one showing any output and at that time i decided python2.7 was perhaps broken. So proceeded as follows :

    Linked my /usr/bin/ python to python3
    #sudo ln -s /usr/bin/python3 /usr/bin/python
    and then, verified the version to make sure it's pointing somewhere
    #python --version.
    Then, did an autoremove :
    #apt autoremove
    and,finally i purged 2.7 minimal
    #sudo apt purge -y python2.7-minimal.

    Finallly I could use apt without any issues. and , did a :
    #apt clean
    #sudo dpkg --force-all --configure -a
    and so far everything seems fine. So I immediately powered off and took a vm snapshot and could start up pretty normal after all that.

    I have since also managed to do another
    #sudo apt update && sudo apt full-upgrade -y
    and all went smooth.

Similar Threads

  1. Kali Nethunter on Nokia 6.1 giving errors when running apt update
    By Fukai The Demon King in forum Installing NetHunter
    Replies: 0
    Last Post: 2023-06-02, 18:13
  2. Update 2020.3 ConfigParser module not found error
    By king_julian in forum TroubleShooting Archive
    Replies: 1
    Last Post: 2020-07-31, 20:23
  3. Replies: 0
    Last Post: 2020-05-23, 13:48
  4. Replies: 0
    Last Post: 2020-03-31, 10:58

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •