python 升级后 apt-listchanges 出现问题 (Debian)

python 升级后 apt-listchanges 出现问题 (Debian)

安装 Python 3.8 后,pip3 出现了几个问题。由于与损坏的 Anaconda 存在一些冲突,我重新安装了 Anaconda,然后设法修复了它。但现在apt-get似乎被打破了,并且存在一些问题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)

我尝试重新安装它,但是失败了:

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

我也遇到了类似的错误sudo apt install apt-listchanges。我无法使用 apt 或 apt-get,它失败了。顺便一提:

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

(我已经尝试了相关问题中提出的很多答案,但出于可读性原因,我更喜欢总结问题;我不希望我的问题像我的python安装一样混乱)

提前致谢!

(系统:Debian Stretch w/KDE Plasma。I7 8500U 16Gb)

编辑:我没有 python3 符号链接。 python 2.7 一切都很好:

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

但对于 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

我不知道这是否重要,但可能会有所帮助。

答案1

经过无数次的尝试,我终于解决了这个让我抓狂的问题。由于它是由于 Python 3 安装明显错误而引起的,我尝试重新安装它,但由于 apt-get 错误或 python 包损坏而无法成功。我按照a的步骤邮政以及一个相关的问题但是python3安装再次失败,尽管错误数量减少了:

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)

所以我重新安装了 python3-software-properties:

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

然后:

sudo dpkg -C

并且不再出现错误,一切似乎都正常

相关内容