无法更新 Python 和其他软件

无法更新 Python 和其他软件

我正在更新我的 Python,但无法通过。系统建议使用 sudo apt-get -f install,但它也不起作用。我该如何解决这个问题?

$sudo apt-get -f install
Reading package lists... Done
Building dependency tree      
Reading state information... Done
Correcting dependencies... Done
The following additional packages will be installed:
  python3-update-manager update-manager
The following packages will be upgraded:
  python3-update-manager update-manager
2 upgraded, 0 newly installed, 0 to remove and 59 not upgraded.
11 not fully installed or removed.
Need to get 0 B/574 kB of archives.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] y
(Reading database ... 405655 files and directories currently installed.)
Preparing to unpack .../python3-update-manager_1%3a16.04.4_all.deb ...
/var/lib/dpkg/info/python3-update-manager.prerm: 6: /var/lib/dpkg/info/python3-update-manager.prerm: py3clean: not found
dpkg: warning: subprocess old pre-removal script returned error exit status 127
dpkg: trying script from the new package instead ...
/var/lib/dpkg/tmp.ci/prerm: 6: /var/lib/dpkg/tmp.ci/prerm: py3clean: not found
dpkg: error processing archive /var/cache/apt/archives/python3-update-manager_1%3a16.04.4_all.deb (--unpack):
 subprocess new pre-removal script returned error exit status 127
/var/lib/dpkg/info/python3-update-manager.postinst: 6: /var/lib/dpkg/info/python3-update-manager.postinst: py3compile: not found
dpkg: error while cleaning up:
 subprocess installed post-installation script returned error exit status 127
Preparing to unpack .../update-manager_1%3a16.04.4_all.deb ...
/var/lib/dpkg/info/update-manager.prerm: 6: /var/lib/dpkg/info/update-manager.prerm: py3clean: not found
dpkg: warning: subprocess old pre-removal script returned error exit status 127
dpkg: trying script from the new package instead ...
/var/lib/dpkg/tmp.ci/prerm: 6: /var/lib/dpkg/tmp.ci/prerm: py3clean: not found
dpkg: error processing archive /var/cache/apt/archives/update-manager_1%3a16.04.4_all.deb (--unpack):
 subprocess new pre-removal script returned error exit status 127
/var/lib/dpkg/info/update-manager.postinst: 6: /var/lib/dpkg/info/update-manager.postinst: py3compile: not found
dpkg: error while cleaning up:
 subprocess installed post-installation script returned error exit status 127
Errors were encountered while processing:
 /var/cache/apt/archives/python3-update-manager_1%3a16.04.4_all.deb
 /var/cache/apt/archives/update-manager_1%3a16.04.4_all.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

答案1

确保更新您的存储库,然后更新系统文件。然后执行reinstall of python3

$代表您在终端屏幕上看到的命令提示符。命令是$提示符后面的内容。):

$ sudo apt update
$ sudo apt upgrade
$ sudo apt install python3-minimal
$ sudo apt install --reinstall python3

然后从那里添加您可能需要的存储库中的其他一些包。您可以使用以下命令获取默认存储库包的列表:

$ apt-cache search "^python3" | less

相关内容