Ubuntu: 18.04
当我尝试执行sudo apt-get upgrade
时,它会给出以下错误:
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
The following packages were automatically installed and are no longer required:
libpython3.7-minimal libpython3.7-stdlib
Use 'sudo apt autoremove' to remove them.
0 to upgrade, 0 to newly install, 0 to remove and 0 not to upgrade.
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 python3-software-properties (0.96.24.32.7) ...
/var/lib/dpkg/info/python3-software-properties.postinst: 6: /var/lib/dpkg/info/python3-software-properties.postinst: py3compile: not found
dpkg: error processing package python3-software-properties (--configure):
installed python3-software-properties package post-installation script subprocess returned error exit status 127
Errors were encountered while processing:
python3-software-properties
E: Sub-process /usr/bin/dpkg returned an error code (1)
但是建议推荐的sudo apt autoremove
也显示了错误:
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be REMOVED
libpython3.7-minimal libpython3.7-stdlib
0 to upgrade, 0 to newly install, 2 to remove and 0 not to upgrade.
1 not fully installed or removed.
After this operation, 12.1 MB disk space will be freed.
Do you want to continue? [Y/n] y
(Reading database ... 178285 files and directories currently installed.)
Removing libpython3.7-stdlib:amd64 (3.7.1-1~18.04) ...
Removing libpython3.7-minimal:amd64 (3.7.1-1~18.04) ...
Setting up python3-software-properties (0.96.24.32.7) ...
/var/lib/dpkg/info/python3-software-properties.postinst: 6: /var/lib/dpkg/info/python3-software-properties.postinst: py3compile: not found
dpkg: error processing package python3-software-properties (--configure):
installed python3-software-properties package post-installation script subprocess returned error exit status 127
Errors were encountered while processing:
python3-software-properties
E: Sub-process /usr/bin/dpkg returned an error code (1)
因此,看起来py3compile存在一些问题,但却找不到。我尝试sudo apt-get -f install
,它的结尾是:
Reading package lists... Done
Building dependency tree
Reading state information... Done
0 to upgrade, 0 to newly install, 0 to remove and 0 not to upgrade.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Setting up python3-software-properties (0.96.24.32.7) ...
/var/lib/dpkg/info/python3-software-properties.postinst: 6: /var/lib/dpkg/info/python3-software-properties.postinst: py3compile: not found
dpkg: error processing package python3-software-properties (--configure):
installed python3-software-properties package post-installation script subprocess returned error exit status 127
Errors were encountered while processing:
python3-software-properties
E: Sub-process /usr/bin/dpkg returned an error code (1)
相同类型的py3compile: not在我尝试sudo apt-get install --reinstall python3-minimal
时显示
我是新来的ubuntu,所以我会很高兴在这方面的一些帮助。
发布于 2019-05-26 13:39:21
通过以下方式重新配置所有未打包但未配置的包:
sudo dpkg --configure -a
如果上面的内容没有帮助,请通过以下方法重新安装python3-minimal
包:
sudo apt install -f --reinstall python3-minimal
或者,运行:
apt-get download python3-minimal
sudo dpkg -i *python3*.deb
sudo apt install -f
或从.deb下载kernel.org文件,并通过以下方式从该文件中安装:
sudo dpkg -i python3-minimal_*.deb
发布于 2020-09-12 18:16:24
我在Ubuntu20.04.1安装py3compile not found
时遇到了python3-pip
的问题。我按照答案的建议重新安装了python3-minimal
,然后再次尝试安装python3-pip
,结果成功了!
sudo apt install -f --reinstall python3-minimal
sudo apt install -f --reinstall python3-pip
希望这对将来的人有帮助!
发布于 2021-08-23 09:18:17
在我的例子中,我正在升级Ubuntu 16,我的解决方案是将默认的/usr/bin/python设置为python2,因为python3没有所有所需的依赖项。
rm /usr/bin/python /usr/bin/python3
ln -sf /usr/bin/python2.7 /usr/bin/python
https://askubuntu.com/questions/1131816
复制相似问题