0

After a Python 3.8 installation several problems arose with pip3. Since there was some conflict with a broken Anaconda, I reinstalled Anaconda and then I managed to fix it. But now apt-get seems to get broken and there is some problem with apt-listchanges:

eric@debian:~$ sudo apt-get install liblzma-dev
Reading package lists... Done
Building dependency tree       
Reading state information... Done
liblzma-dev is already the newest version (5.2.2-1.2+b1).
0 upgraded, 0 newly installed, 0 to remove and 118 not upgraded.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] y
Setting up apt-listchanges (3.10) ...
Deferring configuration of apt-listchanges until python3 is available
/var/lib/dpkg/info/apt-listchanges.postinst: 161: /var/lib/dpkg/info/apt-listchanges.postinst: python3: not found
dpkg: error processing package apt-listchanges (--configure):
 subprocess installed post-installation script returned error exit status 127
Errors were encountered while processing:
 apt-listchanges

E: Sub-process /usr/bin/dpkg returned an error code (1)

I tried to reinstall it, but it failed:

eric@debian:~$ sudo dpkg --purge apt-listchanges
(Reading database ... 305278 files and directories currently installed.)
Removing apt-listchanges (3.10) ...
/var/lib/dpkg/info/apt-listchanges.prerm: 6: /var/lib/dpkg/info/apt-listchanges.prerm: py3clean: not found
dpkg: error processing package apt-listchanges (--purge):
 subprocess installed pre-removal script returned error exit status 127
Deferring configuration of apt-listchanges until python3 is available
/var/lib/dpkg/info/apt-listchanges.postinst: 186: /var/lib/dpkg/info/apt-listchanges.postinst: py3compile: not found
dpkg: error while cleaning up:
 subprocess installed post-installation script returned error exit status 127
Errors were encountered while processing:
 apt-listchanges

I had a similar error with sudo apt install apt-listchanges. I can't use apt or apt-get, it fails. By the way:

eric@debian:/usr/bin$ which python
/usr/bin/python
eric@debian:/usr/bin$ python --version
Python 2.7.13
eric@debian:/usr/bin$ which python3
eric@debian:/usr/bin$ which python3.8
/usr/local/bin/python3.8
eric@debian:/usr/bin$ python3.8 --version
Python 3.8.3

(I've tried lots of answers proposed in related questions, but I prefer to summarize the problem for readability reasons; I don't want my question to be as messy as my python installation)

Thanks in advance!

(System: Debian Stretch w/KDE Plasma. I7 8500U 16Gb)

EDIT: I don't have a python3 symlink. Everything is fine with python 2.7:

eric@debian:~$ ls -l $(which python)
lrwxrwxrwx 1 root root 9 Jan 24  2017 /usr/bin/python -> python2.7

But with python3:

eric@debian:~$ ls -l $(which python3)
total 1508792
-rw-r--r--   1 eric eric       8358 Oct  4  2019 041019
-rw-r--r--   1 eric eric   26411849 Aug 12  2018 95681f94e7e4471b583d11b0c4cab198
drwxr-xr-x  26 eric eric       4096 May 18 22:33 anaconda3
drwxr-xr-x  11 eric eric       4096 Mar  3 01:34 Arduino
-rw-r--r--   1 eric eric    2729653 May 13  2019 c17_hill.pdf
-rw-r--r--   1 eric eric    1252901 Apr  8  2018 chromium-browser_56.0.2924.84-0ubuntu0.14.04.1.1011.deb
-rw-r--r--   1 eric eric    5187109 Apr  8  2018 chromium-browser_56.0.2924.84-0ubuntu0.14.04.1.1011.deb.1
-rw-r--r--   1 eric eric      34341 Apr  8  2018 chromium-browser_56.0.2924.84-0ubuntu0.14.04.1.1011.deb.2
-rw-r--r--   1 eric eric   58968590 May 25  2017 chromium-browser_56.0.2924.84-0ubuntu0.14.04.1.1011.deb.3
-rw-r--r--   1 eric eric    1231294 Jul 22  2019 default22.pdf
-rw-r--r--   1 eric eric    1694387 Feb 13  2019 default.pdf
drwxr-xrwx   2 eric eric       4096 Jul 30 15:31 Desktop
drwxr-xrwx 109 eric eric      20480 Jul 30 15:17 Documents
drwxr-xrwx   7 eric eric      20480 Jul 30 20:06 Downloads
drwxr-xrwx  22 eric eric       4096 Jul 29 11:40 Dropbox
-rw-r--r--   1 eric eric       2422 Apr 13  2018 equivs-dummy_1.0_all.deb
-rw-r--r--   1 eric eric     141149 Feb 24 14:25 Figure_2.png
-rw-r--r--   1 eric eric    1662625 Mar 27  2019 ganancias19.pdf
drwxr-xr-x  16 eric eric       4096 Feb 23  2018 hdf5-1.10.1
-rw-r--r--   1 eric eric   15052127 Apr 27  2017 hdf5-1.10.1.tar.gz
-rw-r--r--   1 eric eric    1508692 Jun 18  2018 IC-215-780-User-and-Operation-Manual-Manual.pdf
drwxr-xr-x   2 eric eric       4096 Sep 21  2019 King Crimson - Beat (40th Anniversary Series)
drwxr-xr-x   2 eric eric       4096 Sep 21  2019 King Crimson - Discipline - 2011 [flac]
drwxr-xr-x   2 eric eric       4096 Sep  7  2019 King Crimson    {Three Of A Perfect Pair}
-rw-r--r--   1 root root          0 Feb 28  2019 minicom.cap
-rw-r--r--   1 eric eric    4592839 May 14  2019 muscle_hill.pdf
drwxr-xrwx 127 eric eric       4096 Sep  6  2019 Music
drwxr-xr-x  22 eric eric       4096 Feb 23  2018 netcdf-4.3.3
-rw-r--r--   1 eric eric 1357215611 Apr  4  2018 NOOBS_v2_7_0.zip
-rw-r--r--   1 eric eric        758 Dec 11  2019 nuevo13.kmz
drwxr-xr-x   3 eric eric       4096 Feb 23  2018 OceanColorProject
drwxr-xrwx 153 eric eric      20480 Jul  7 18:11 Pictures
drwxr-xrwx   2 eric eric       4096 Dec 28  2017 Public
-rw-r--r--   1 root root      15229 Mar  1  2019 putty.log
drwxr-xr-x  18 eric eric       4096 May 15 22:10 Python-3.8.3
-rw-r--r--   1 eric eric   17912964 May 13 18:48 Python-3.8.3.tar.xz
-rw-r--r--   1 root root       1475 Apr 13  2018 python-pypdf
drwxr-xr-x   9 eric eric       4096 Feb 23  2018 seadas-7.4
-rw-r--r--   1 root root    2340303 Apr 14  2018 status.bckup
-rw-r--r--   1 root root   46846864 Dec  6  2017 teamviewer_i386.deb
drwxr-xrwx   2 eric eric       4096 Dec 28  2017 Templates
drwxr-xr-x   2 eric eric       4096 May 18 20:06 tmp
drwxr-xrwx  35 eric eric       4096 Jun  5 12:42 Videos

eric@debian:~$ ls -l $(which python3.8)
-rwxr-xr-x 1 root staff 17303968 May 15 22:11 /usr/local/bin/python3.8

I don't know if this is important, but it may help.

1 Answer 1

0

After countless tries I finally solved the problem that was driving me crazy. Since it arose with an apparently faulty installation of Python 3 , I tried to reinstall it but it was no possible due to errors with apt-get or corrupted python packages. I followed the steps of a post and a related question but python3 installation failed again, although the number of errors decreased:

dpkg: error processing package python3-software-properties (--configure):
 package is in a very bad inconsistent state; you should
 reinstall it before attempting configuration
dpkg: dependency problems prevent configuration of software-properties-common:
 software-properties-common depends on python3-software-properties (= 0.96.20.2-1); however:
  Package python3-software-properties is not configured yet.

dpkg: error processing package software-properties-common (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of software-properties-kde:
 software-properties-kde depends on python3-software-properties (= 0.96.20.2-1); however:
  Package python3-software-properties is not configured yet.
 software-properties-kde depends on software-properties-common; however:
  Package software-properties-common is not configured yet.
dpkg: error processing package software-properties-kde (--configure):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 python3-software-properties
 software-properties-common
 software-properties-kde
E: Sub-process /usr/bin/dpkg returned an error code (1)

So I reinstalled python3-software-properties:

sudo apt-get --reinstall install python3-software-properties

then:

sudo dpkg -C

And no more errors, everything seem to be OK

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .