LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 08-02-2020, 02:35 AM   #1
anon052
LQ Newbie
 
Registered: Aug 2020
Posts: 9

Rep: Reputation: Disabled
apt install broken - ConfigParser import SafeConfigParser ModuleNotFoundError: No module named 'ConfigParser'


Hi all.

First post here.
Yes, I have read the concerns around kali as a newbie , but since part of my using Linux was exactly for learning pentesting I guess the best place to start was with Kali 🙈.
Anyway , forgive me that I am not an expert , but I guess this problem is not necessarily specific to Kali and just hope to get help since my apt is now broken.
I have posted in stack exchange as well as Kali , tried googling and various ideas and still none of it seem to work. So here’s my problem and some detail.

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 ?
 
Old 08-03-2020, 02:16 AM   #2
shruggy
Senior Member
 
Registered: Mar 2020
Posts: 3,677

Rep: Reputation: Disabled
Well, /usr/bin/pycompile and /usr/share/python/debpython/version.py are part of the package python2-minimal. Dependency chain probably looks like this:

mercurial -> python2 -> python2-minimal

What packages will be removed if you purge python2-minimal? Simulate it with
Code:
apt -s purge python2-minimal

Last edited by shruggy; 08-03-2020 at 02:18 AM.
 
Old 08-03-2020, 04:50 PM   #3
anon052
LQ Newbie
 
Registered: Aug 2020
Posts: 9

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by shruggy View Post
Well, /usr/bin/pycompile and /usr/share/python/debpython/version.py are part of the package python2-minimal. Dependency chain probably looks like this:

mercurial -> python2 -> python2-minimal

What packages will be removed if you purge python2-minimal? Simulate it with
Code:
apt -s purge python2-minimal
hi @shruggy, Thanks for the reply.
The output of the simulation is too huge to post here(75K CHARACTERS), not sure what exactly I should be looking at(sorry no clue wrt python and it's setup, but if you can please give me an idea so I can post only the relevant ? or let me know how else ? ).

here is also out from the reverse dependency lists. not sure if you can note anything from this.
Code:
 ✘ ⚡ root@kali  /home/juju  apt-cache rdepends mercurial       
mercurial
Reverse Depends:
  mercurial-common
  zim
  redmine
  rebar
  python3-vcversioner
  python3-vcstools
  python3-rope
  python3-hglib
  python3-hgapi
  pepper
  opam
  myrepos
  mercurial-keyring
  mercurial-extension-utils
  mercurial-crecord
  mercurial-common
  mercurial-common
 |buildbot-worker
  mercurial-buildpackage
  libghc-filestore-dev
 |latexdiff
  kate
  kali-linux-large
 |ikiwiki
  hobbit-plugins
  golang-1.15-go
  golang-1.14-go
  gitit
  etm
 |etckeeper
  duck
  composer
 |commit-patch
 ⚡ root@kali  /home/juju 
Code:
 ⚡ root@kali  /home/juju  apt-cache rdepends python2-minimal
python2-minimal
Reverse Depends:
  python-minimal
  python2
Code:
 ⚡ root@kali  /home/juju  apt-cache rdepends python2        
python2
Reverse Depends:
  python
  python-sqlalchemy-ext
  python-sqlalchemy-ext
  python2-minimal
  python2-doc
  python2-dev
  python2-dbg
  python-yara
  python-yara
  python-tk
  python-tk
  python-pil.imagetk
  python-pil.imagetk
  python-pil
  python-pil
  python-numpy
  python-numpy
  python-markupsafe
  python-markupsafe
  python-lxml
  python-lxml
  python-lldb-6.0
  python-libxslt1
  python-libxslt1
  python-libxml2
  python-libxml2
  python-librdf
  python-librdf
  python-gobject-2
  python-gobject-2
  python-gi-cairo
  python-gi-cairo
  python-gi
  python-gi
  python-gdbm
  python-gdbm
  python-dbus
  python-dbus
  python-crypto
  python-crypto
  python-coverage
  python-coverage
  python-clang-6.0
  python-cffi-backend
  python-cffi-backend
  python-cairo
  python-cairo
  mercurial
  offsec-awae-python2
  mercurial
  clang-6.0
  llvm-6.0-tools
  flatpak-builder-tests
  clang-format-6.0
here is some parts of the simultion (just begining and end)
Code:
⚡ root@kali  /home/juju  apt -s purge python2-minimal
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages were automatically installed and are no longer required:
  blt dwarfdump libadns1 libboost-python1.67.0 libboost-system1.67.0
  libboost-thread1.67.0 libdistorm3-3 libdwarf1 libemu2 libgtksourceview2.0-0
  libgtksourceview2.0-common libpcsc-perl libpython-all-dev libpython-dev
  libpython-stdlib libpython2-dev libpython2-stdlib libpython2.7
  libpython2.7-dev libtidy5deb1 pcsc-tools python-pip-whl python-pylibemu
  python2.7-dev tk8.6-blt2.5 u3-tool volatility-tools
Use 'apt autoremove' to remove them.
The following packages will be REMOVED:
  automater* bbqsql* blindelephant* cherrytree* chirp* clusterd* creddump*
  deblaze* fimap* findmyhash* funkload* grabber* intersect* killerbee*
  maltego-teeth* mercurial* mercurial-common* miranda* nfspy* pdf-parser*
  pdgmail* powerfuzzer* pyrit* python* python-adns* python-aes* python-all*
  python-all-dev* python-atomicwrites* python-attr*
  python-backports.functools-lru-cache* python-bs4* python-cairo*
  python-certifi* python-chardet* python-colorama* python-configparser*
  python-contextlib2* python-crypto* python-dbus* python-dev* python-distorm3*
  python-easygui* python-editorconfig* python-egenix-mxdatetime*
  python-egenix-mxtools* python-enchant* python-entrypoints*
  python-et-xmlfile* python-funcsigs* python-fuse* python-future*
  python-gevent* python-gi* python-gobject* python-gobject-2* python-greenlet*
  python-gtk2* python-gtksourceview2* python-html5lib* python-httplib2*
  python-idna* python-importlib-metadata* python-ipaddress* python-jdcal*
  python-jsbeautifier* python-jsonpickle* python-keyring* python-keyrings.alt*
  python-levenshtein* python-libxml2* python-libxslt1* python-lxml*
  python-m2crypto* python-mechanize* python-metaconfig* python-minimal*
  python-more-itertools* python-msgpack* python-mysqldb* python-numpy*
  python-olefile* python-openpyxl* python-pathlib2* python-peepdf* python-pil*
  python-pil.imagetk* python-pip* python-pkg-resources* python-pluggy*
  python-psycopg2* python-py* python-pymssql* python-pyscard*
  python-pysqlite2* python-pytest* python-pyv8* python-requests*
  python-rfidiot* python-scandir* python-serial* python-setuptools*
  python-simplejson* python-six* python-socks* python-soupsieve*
  python-sqlalchemy* python-sqlalchemy-ext* python-tk* python-typing*
  python-tz* python-urllib3* python-usb* python-utidylib* python-webencodings*
  python-webunit* python-wheel* python-wxgtk3.0* python-wxtools*
  python-wxversion* python-xdg* python-yara* python-zipp* python2*
  python2-dev* python2-minimal* sslcaudit* tcpwatch-httpproxy* u3-pwn*
  ua-tester* volafox* volatility* zenmap*
0 upgraded, 0 newly installed, 133 to remove and 0 not upgraded.
3 not fully installed or removed.
Purg mercurial [5.4.1-1]
Purg mercurial-common [5.4.1-1]
Purg python-keyring [18.0.1-2]
Purg python-entrypoints [0.3-3]
Purg maltego-teeth [1.0-1kali0]
Purg python-metaconfig [0.1.4a1-5]
Purg python-configparser [3.5.0b2-3] [python-future:amd64 python-importlib-metadata:amd64 ]
Purg python-pip [20.0.2-5kali1] [python-future:amd64 python-importlib-metadata:amd64 ]
Purg automater [2.1+git20160531-0kali1] [python-future:amd64 python-importlib-metadata:amd64 ]
Purg bbqsql [1.1-4] [python-future:amd64 python-importlib-metadata:amd64 ]
Purg blindelephant [0.1-1kali4] [python-future:amd64 python-importlib-metadata:amd64 ]
Purg cherrytree [0.38.8-0kali1] [python-future:amd64 python-importlib-metadata:amd64 ]
Purg chirp [1:20190718-1] [python-future:amd64 python-importlib-metadata:amd64 ]
Purg clusterd [0.5-0kali2] [python-future:amd64 python-importlib-metadata:amd64 ]
Purg creddump [0.3-1kali2] [python-future:amd64 python-importlib-metadata:amd64 ]
Purg deblaze [0.1-1kali3] [python-future:amd64 python-importlib-metadata:amd64 ]
Purg fimap [1.00-0kali3] [python-future:amd64 python-importlib-metadata:amd64 ]
Purg findmyhash [1.1.2-1kali3] [python-future:amd64 python-importlib-metadata:amd64 ]
Purg funkload [1.17.1-2] [python-future:amd64 python-importlib-metadata:amd64 ]
Purg grabber [0.1-1kali5] [python-future:amd64 python-importlib-metadata:amd64 ]
Purg intersect [2.5-1kali1] [python-future:amd64 python-importlib-metadata:amd64 ]
Purg killerbee [1.0-1kali3] [python-future:amd64 python-importlib-metadata:amd64 ]
Purg miranda [1.0-1kali3] [python-future:amd64 python-importlib-metadata:amd64 ]
Purg nfspy [1.0-1kali1] [python-future:amd64 python-importlib-metadata:amd64 ]
Purg pdf-parser [0.7.4-0kali1] [python-future:amd64 python-importlib-metadata:amd64 ]
Purg pdgmail [0.2.0-1kali1] [python-future:amd64 python-importlib-metadata:amd64 ]
Purg powerfuzzer [1.0-1kali1] [python-future:amd64 python-importlib-metadata:amd64 ]
Purg pyrit [0.5.1+git20180801-1] [python-future:amd64 python-importlib-metadata:amd64 ]
Purg volafox [0.8-1kali0] [python-future:amd64 python-importlib-metadata:amd64 ]
Purg volatility [2.6.1-1] [python-future:amd64 python-importlib-metadata:amd64 ]
Purg python-openpyxl [2.4.9-1] [python-future:amd64 python-importlib-metadata:amd64 ]
Purg python-et-xmlfile [1.0.1-2] [python-future:amd64 python-importlib-metadata:amd64 ]
Purg ua-tester [1.06-1kali2] [python-future:amd64 python-importlib-metadata:amd64 ]
Purg zenmap [7.80+dfsg1-1kali1] [python-future:amd64 python-importlib-metadata:amd64 ]
Purg python [2.7.17-2] 

    ... lots of lines deleted here....

Purg python-webunit [1:1.3.10-2.1] [python-zipp:amd64 python-xdg:amd64 python-wxgtk3.0:amd64 python-wxtools:amd64 python-wheel:amd64 u3-pwn:amd64 python-wxversion:amd64 ]
Purg python-wheel [0.32.3-2] [python-zipp:amd64 python-xdg:amd64 python-wxgtk3.0:amd64 python-wxtools:amd64 u3-pwn:amd64 python-wxversion:amd64 ]
Purg python-wxtools [3.0.2.0+dfsg-8] [python-zipp:amd64 python-xdg:amd64 python-wxgtk3.0:amd64 u3-pwn:amd64 python-wxversion:amd64 ]
Purg python-wxgtk3.0 [3.0.2.0+dfsg-8] [python-zipp:amd64 python-xdg:amd64 u3-pwn:amd64 python-wxversion:amd64 ]
Purg python-wxversion [3.0.2.0+dfsg-8] [python-zipp:amd64 python-xdg:amd64 u3-pwn:amd64 ]
Purg python-xdg [0.25-5] [python-zipp:amd64 u3-pwn:amd64 ]
Purg python-yara [3.10.0-1+b1] [python-zipp:amd64 u3-pwn:amd64 ]
Purg python-zipp [0.5.2-2] [u3-pwn:amd64 ]
Purg python2-dev [2.7.17-2] [u3-pwn:amd64 ]
Purg python2 [2.7.17-2] [u3-pwn:amd64 ]
Purg python2-minimal [2.7.17-2] [u3-pwn:amd64 ]
Purg u3-pwn [2.0-1kali3]
 
Old 08-04-2020, 03:27 AM   #4
shruggy
Senior Member
 
Registered: Mar 2020
Posts: 3,677

Rep: Reputation: Disabled
That's interesting. I didn't realize so many things still depend on python2 in kali-rolling. To compare, this is what I get on Ubuntu 20.04 with quite a few packages installed (5140):
Code:
$ apt -s purge python2-minimal
NOTE: This is only a simulation!
      apt needs root privileges for real execution.
      Keep also in mind that locking is deactivated,
      so don't depend on the relevance to the real current situation!
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be REMOVED:
  ghi* gyp* mozilla-devscripts* node-gyp* npm* npm2deb* obs-build* pyflakes* python-chardet*
  python-is-python2* python-librdf* python-magic* python-pkg-resources* python-pyflakes*
  python-pygments* python-subversion* python2* python2-minimal* ruby-pygments.rb* syslog-summary*
  trash-cli* vim-ultisnips*
0 upgraded, 0 newly installed, 22 to remove and 0 not upgraded.
Purg ghi [1.2.0-1]
Purg npm2deb [0.3.0-3]
Purg npm [6.14.4+ds-1ubuntu2]
Purg node-gyp [6.1.0-3]
Purg gyp [0.1+20180428git4d467626-3ubuntu1]
Purg mozilla-devscripts [0.54]
Purg obs-build [20180831-3ubuntu1]
Purg pyflakes [2.1.1-2]
Purg python-chardet [3.0.4-4build1]
Purg python-is-python2 [2.7.17-4]
Purg python-librdf [1.0.17.1+dfsg-1.3ubuntu3]
Purg python-magic [2:0.4.15-3]
Purg trash-cli [0.17.1.14-2ubuntu1]
Purg python-pyflakes [2.1.1-2]
Purg python-pkg-resources [44.0.0-2]
Purg ruby-pygments.rb [1.2.0-4ubuntu2]
Purg python-pygments [2.3.1+dfsg-1ubuntu2]
Purg python-subversion [1.13.0-3]
Purg vim-ultisnips [3.1-3build1]
Purg syslog-summary [1.14-2.1ubuntu1]
Purg python2 [2.7.17-2ubuntu4]
Purg python2-minimal [2.7.17-2ubuntu4]
What makes the difference is probably this:
Quote:
Originally Posted by King_julian View Post
Code:
 ⚡ root@kali  /home/juju  apt-cache rdepends python2-minimal
python2-minimal
Reverse Depends:
  python-minimal
  python2
In Ubuntu 20.04, there's no package python-minimal, only python2-minimal and python3-minimal.
Code:
$ apt-cache rdepends python2-minimal
python2-minimal
Reverse Depends:
  python2
python2 is optional in Ubuntu 20.04, removing it completely doesn't disrupt things too much.

OTOH, in Ubuntu 18.04 there's no package python2-minimal, only python-minimal (which was renamed python2-minimal in later releases) and python3-minimal.

Last edited by shruggy; 08-04-2020 at 03:51 AM.
 
Old 08-04-2020, 09:19 AM   #5
anon052
LQ Newbie
 
Registered: Aug 2020
Posts: 9

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by shruggy View Post
That's interesting. I didn't realize so many things still depend on python2 in kali-rolling. To compare, this is what I get on Ubuntu 20.04 with quite a few packages installed (5140):
[

What makes the difference is probably this:

In Ubuntu 20.04, there's no package python-minimal, only python2-minimal and python3-minimal.

python2 is optional in Ubuntu 20.04, removing it completely doesn't disrupt things too much.

OTOH, in Ubuntu 18.04 there's no package python2-minimal, only python-minimal (which was renamed python2-minimal in later releases) and python3-minimal.
Thanks @shruggy, what do you think i should do ?
Why does it seem my stuff is duplicated(dependancy packages showing twice in redepends output)
see a few examples below.

I see even python3-minimal show this duplicates
Code:
 ⚡ root@kali  /home/juju  apt-cache rdepends python3-minimal
python3-minimal
Reverse Depends:
  python3
  python3
here is python2-minimal.
Code:
⚡ root@kali  /home/juju  apt-cache rdepends python2-minimal
python2-minimal
Reverse Depends:
  python-minimal
  python2
Here is python-minimal ,note how python2 is duplicated here
Code:
 ⚡ root@kali  /home/juju  apt-cache rdepends python-minimal 
python-minimal
Reverse Depends:
  python2-minimal
  python2-minimal
  python
Here is python, note how python2-minimal is duplicated again in this list.
Code:
⚡ root@kali  /home/juju  apt-cache rdepends python        
python
Reverse Depends:
  python-minimal
  volafox
  ua-tester
  tcpwatch-httpproxy
  sslcaudit
  sparta
  samba
  samba
  python-wxgtk3.0
  python-wxgtk3.0
 |python-sqlalchemy
  python-simplejson
  python-simplejson
  python-scandir
  python-scandir
  python-pyv8
  python-pyv8
  python-pysqlite2
  python-pysqlite2
  python-pyscard
  python-pyscard
  python-pymssql
  python-pymssql
  python-psycopg2
  python-psycopg2
  python-mysqldb
  python-mysqldb
  python-msgpack
  python-msgpack
  python-mechanize
  python-mechanize
  python-m2crypto
  python-m2crypto
  python-levenshtein
  python-levenshtein
  python-greenlet
  python-greenlet
  python-gevent
  python-gevent
  python-fuse
  python-fuse
  python-egenix-mxtools
  python-egenix-mxtools
  python-egenix-mxdatetime
  python-egenix-mxdatetime
  python-easygui
  python-easygui
  python-certifi
  python-certifi
  python-adns
  python-adns
  pyrit
  pyrit
  powerfuzzer
  pdgmail
  nfspy
  miranda
  maltego-teeth
  libboost-python1.67.0
  intersect
  grabber
  findmyhash
  fimap
  deblaze
  creddump
  clusterd
  blindelephant
 |bbqsql
  automater
  yorick-yutils
  volatility-tools
  stx2any
  skktools
  sdcc
  scid
  python2-minimal
  python2-minimal
  python2
  python2
  python-pygame-sdl2
  python-pygame-sdl2
  python-pam
  python-pam
  python-openpyxl
  python-openpyxl
  python-minimal
  python-minimal
  python-all
  python-librdf
  python-iptcdata
  python-iptcdata
  python-gtksourceview2
  python-gtksourceview2
  python-gtk2
  python-gtk2
  python-glade2
  python-glade2
  python-doc
  python-doc
  python-doc
  python-distorm3
  python-dev
  python-dbg
  python-all-dev
  python-all-dbg
  libbenchmark-tools
  prover9-doc
  passenger
  pass
  pandoc
  openvas-manager-common
  opendmarc
  obs-build
  ntpsec-ntpviz
  nfs-common
  modsecurity-crs
  mklibs-copy
  mklibs
  mc
  cfv
  libapr1-dev
  libapache2-mod-wsgi
  libapache2-mod-wsgi
  libapache2-mod-python
  libapache2-mod-python
  killerbee
  kcachegrind-converters
  kannel-extras
  john-data
  hol-light
  gridengine-common
  gimp-plugin-registry
  giella-core
  ganglia-monitor-python
  dradis
  digitemp
  cfv
  2to3
  cfengine3
  calligrasheets
  arcanist
  aqsis-examples
  2to3

Here is configparser
Code:
 ⚡ root@kali  /home/juju  apt-cache rdepends python-configparser
python-configparser
Reverse Depends:
  python-entrypoints
  python-metaconfig
  python-importlib-metadata
  python-future
This is python2
Code:
⚡ root@kali  /home/juju  apt-cache rdepends python2        
python2
Reverse Depends:
  python
  python-sqlalchemy-ext
  python-sqlalchemy-ext
  python2-minimal
  python2-doc
  python2-dev
  python2-dbg
  python-yara
  python-yara
  python-tk
  python-tk
  python-pil.imagetk
  python-pil.imagetk
  python-pil
  python-pil
  python-numpy
  python-numpy
  python-markupsafe
  python-markupsafe
  python-lxml
  python-lxml
  python-lldb-6.0
  python-libxslt1
  python-libxslt1
  python-libxml2
  python-libxml2
  python-librdf
  python-librdf
  python-gobject-2
  python-gobject-2
  python-gi-cairo
  python-gi-cairo
  python-gi
  python-gi
  python-gdbm
  python-gdbm
  python-dbus
  python-dbus
  python-crypto
  python-crypto
  python-coverage
  python-coverage
  python-clang-6.0
  python-cffi-backend
  python-cffi-backend
  python-cairo
  python-cairo
  mercurial
  offsec-awae-python2
  mercurial
  clang-6.0
  llvm-6.0-tools
  flatpak-builder-tests
  clang-format-6.0
 
Old 08-04-2020, 09:34 AM   #6
shruggy
Senior Member
 
Registered: Mar 2020
Posts: 3,677

Rep: Reputation: Disabled
I don't use Kali, so it's hard for me to say how it should be done there. I'd try to reinstall python2-minimal because the error message seems to originate there.
Code:
apt -f reinstall python2-minimal
 
Old 08-04-2020, 09:36 AM   #7
descendant_command
Senior Member
 
Registered: Mar 2012
Posts: 1,876

Rep: Reputation: 643Reputation: 643Reputation: 643Reputation: 643Reputation: 643Reputation: 643
Quote:
Originally Posted by King_julian View Post
Any ideas on how to troubleshoot or fix this please ?
Remember / describe what you did to this system between apt working and apt not working.
Presumably something python related, or adding some extremely ill-advised repo or deb.

Failing that, nuke it and re-install, or better yet, run it live as intended, and don't repeat the mistake.

Apt relies on a working python backend, and all this fussing about is just wasting everyone's time (including yours) and teaching you nothing.
 
Old 08-04-2020, 09:54 AM   #8
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,976

Rep: Reputation: 7337Reputation: 7337Reputation: 7337Reputation: 7337Reputation: 7337Reputation: 7337Reputation: 7337Reputation: 7337Reputation: 7337Reputation: 7337Reputation: 7337
Quote:
Originally Posted by King_julian View Post
Yes, I have read the concerns around kali as a newbie , but since part of my using Linux was exactly for learning pentesting I guess the best place to start was with Kali 🙈.
This is false. First you need to learn apt, python and a lot of other things. Using Kali (and trying to repair) will make it definitely hard (for you).

Additionally you did not tell us which version of that OS was installed, if it was a VM, if it was a live CD (and any other details).
Probably reinstall is the best you can do now as it was already suggested.
 
Old 08-04-2020, 10:10 AM   #9
uteck
Senior Member
 
Registered: Oct 2003
Location: Elgin,IL,USA
Distribution: Ubuntu based stuff for the most part
Posts: 1,177

Rep: Reputation: 501Reputation: 501Reputation: 501Reputation: 501Reputation: 501Reputation: 501
Kali is not meant to be updated like a normal desktop OS. It has lots of customization added to make the various pen-testing applications work. This is why they say to use it as a live USB/CD.
Your best option to wipe and start over and not treat it like a desktop.
 
Old 08-04-2020, 10:22 AM   #10
anon052
LQ Newbie
 
Registered: Aug 2020
Posts: 9

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by pan64 View Post
This is false. First you need to learn apt, python and a lot of other things. Using Kali (and trying to repair) will make it definitely hard (for you).

Additionally you did not tell us which version of that OS was installed, if it was a VM, if it was a live CD (and any other details).
Probably reinstall is the best you can do now as it was already suggested.
And this part of the learning right ? I cannot learn everything at once.
Apologies missed that version as I cut and pasted here
So after the apt full upgrade it’s 2020.3 and it’s running on vbox.

This kinda prob can pop up in any Linux distro, not so ?
So if you can Just imagine for sec that it’s Ubuntu throwing you this python error ,
how would you go about troubleshooting and fixing ?
I would really like to take it as a learning opportunity rather than just re-installing cause that way I learn nothing.
 
Old 08-04-2020, 10:27 AM   #11
anon052
LQ Newbie
 
Registered: Aug 2020
Posts: 9

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by descendant_command View Post
Remember / describe what you did to this system between apt working and apt not working.
Presumably something python related, or adding some extremely ill-advised repo or deb.

Failing that, nuke it and re-install, or better yet, run it live as intended, and don't repeat the mistake.

Apt relies on a working python backend, and all this fussing about is just wasting everyone's time (including yours) and teaching you nothing.
Hi , yes that was my concern , it was working until after the full upgrade command I posted in the OP.
The only entry in my kali debs is the std kali.org rolling

Oops 🙊, mods may close did not want to waste anyone’s time.
 
Old 08-04-2020, 10:28 AM   #12
anon052
LQ Newbie
 
Registered: Aug 2020
Posts: 9

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by uteck View Post
Kali is not meant to be updated like a normal desktop OS. It has lots of customization added to make the various pen-testing applications work. This is why they say to use it as a live USB/CD.
Your best option to wipe and start over and not treat it like a desktop.
Hi noted , thanks for reply , have asked mods to close thread.
 
Old 08-04-2020, 10:39 AM   #13
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,976

Rep: Reputation: 7337Reputation: 7337Reputation: 7337Reputation: 7337Reputation: 7337Reputation: 7337Reputation: 7337Reputation: 7337Reputation: 7337Reputation: 7337Reputation: 7337
Quote:
Originally Posted by King_julian View Post
And this part of the learning right ? I cannot learn everything at once.
You are right. That's why you need to start at the beginning.

Quote:
Originally Posted by King_julian View Post
So if you can Just imagine for sec that it’s Ubuntu throwing you this python error ,
Using ubuntu you have much more possibilities than in Kali, because the latter is a specialized distro.
Quote:
Originally Posted by King_julian View Post
how would you go about troubleshooting and fixing ?
I would really like to take it as a learning opportunity rather than just re-installing cause that way I learn nothing.
apt full upgrade means you have just installed a new release without troubleshooting. And again you are right, you learned nothing.
 
Old 08-04-2020, 10:53 AM   #14
anon052
LQ Newbie
 
Registered: Aug 2020
Posts: 9

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by pan64 View Post
You are right. That's why you need to start at the beginning.


Using ubuntu you have much more possibilities than in Kali, because the latter is a specialized distro.

apt full upgrade means you have just installed a new release without troubleshooting. And again you are right, you learned nothing.
Ok 👍🏽
 
Old 08-05-2020, 04:14 PM   #15
anon052
LQ Newbie
 
Registered: Aug 2020
Posts: 9

Original Poster
Rep: Reputation: Disabled
Thumbs up solved

Mods, apologies upfront as I do not want to waste more of peoples time here, but 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.

So, as per above 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.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Python ConfigParser not saving comments EricTRA Programming 3 06-17-2011 03:15 AM
Import Error: No module named apsw PhilipRH Linux - Newbie 2 03-20-2011 04:50 AM
(bind) named: couldn't open pid file '/var/run/named/named.pid' - any help? samengr Linux - Server 6 04-01-2009 06:22 AM
file /var/lib/named/var/named/reverse/named.zero failed: file not found Toadman Linux - Software 15 03-18-2009 07:01 PM
chown -R named:named /var/named crash the system? joangopan Fedora 2 09-09-2007 02:46 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 10:42 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration