我无法在 Ubuntu 16.04 上安装或升级任何东西。我缺少软件包 python3-software-properties,无论如何都无法安装它。我已发布各种回溯。我尝试安装这些软件包,但出现这些错误。
sarfraz@sarfraz:~$ sudo apt-get install --reinstall dpkg
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
language-selector-common language-selector-gnome python3-distupgrade
python3-software-properties software-properties-common software- properties-gtk
Recommended packages:
unattended-upgrades
The following packages will be upgraded:language-selector-common
language-selector-gnome python3-distupgrade python3-software-
properties software-properties-common software-properties-gtk
6 upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 30 not upgraded.
141 not fully installed or removed.
Need to get 2,083 kB/2,496 kB of archives.
After this operation, 1,024 B of additional disk space will be used.
Do you want to continue? [Y/n] Y
Get:1 http://in.archive.ubuntu.com/ubuntu xenial-updates/main amd64 dpkg amd64 1.18.4ubuntu1.1 [2,083 kB]
Fetched 2,083 kB in 3s (617 kB/s)
(Reading database ... 220260 files and directories currently installed.)
Preparing to unpack .../language-selector-gnome_0.165.4_all.deb ...
/var/lib/dpkg/info/language-selector-gnome.prerm: 6: /var/lib/dpkg/info/language-selector-gnome.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/language-selector-gnome_0.165.4_all.deb (--unpack):
subprocess new pre-removal script returned error exit status 127
/var/lib/dpkg/info/language-selector-gnome.postinst: 6: /var/lib/dpkg/info/language-selector-gnome.postinst: py3compile: not found
dpkg: error while cleaning up:
subprocess installed post-installation script returned error exit status 127
Preparing to unpack .../dpkg_1.18.4ubuntu1.1_amd64.deb ...
Unpacking dpkg (1.18.4ubuntu1.1) over (1.18.4ubuntu1.1) ...
Errors were encountered while processing:
/var/cache/apt/archives/language-selector-gnome_0.165.4_all.deb
sarfraz@sarfraz:~$ sudo apt-get install python3-minimal
Reading package lists... Done
Building dependency tree
Reading state information... Done
python3-minimal is already the newest version (3.5.1-3).
The following additional packages will be installed:
language-selector-common language-selector-gnome python3-distupgrade
python3-software-properties software-properties-common software- properties-gtk
Recommended packages:
unattended-upgrades
The following packages will be upgraded:
language-selector-common language-selector-gnome python3-distupgrade python3-software-properties software-properties-common software- properties-gtk
6 upgraded, 0 newly installed, 0 to remove and 30 not upgraded.
141 not fully installed or removed.
Need to get 0 B/413 kB of archives.
After this operation, 1,024 B of additional disk space will be used.
Do you want to continue? [Y/n] Y
(Reading database ... 220260 files and directories currently installed.)
Preparing to unpack .../language-selector-gnome_0.165.4_all.deb ...
/var/lib/dpkg/info/language-selector-gnome.prerm: 6: /var/lib/dpkg/info/language-selector-gnome.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/language- selector-gnome_0.165.4_all.deb (--unpack):
subprocess new pre-removal script returned error exit status 127
/var/lib/dpkg/info/language-selector-gnome.postinst: 6: /var/lib/dpkg/info/language-selector-gnome.postinst: py3compile: not found
dpkg: error while cleaning up:
subprocess installed post-installation script returned error exit status 127
Preparing to unpack .../language-selector-common_0.165.4_all.deb ...
/var/lib/dpkg/info/language-selector-common.prerm: 21: /var/lib/dpkg/info/language-selector-common.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: 21: /var/lib/dpkg/tmp.ci/prerm: py3clean: not found
dpkg: error processing archive /var/cache/apt/archives/language- selector-common_0.165.4_all.deb (--unpack):
subprocess new pre-removal script returned error exit status 127
/var/lib/dpkg/info/language-selector-common.postinst: 23: /var/lib/dpkg/info/language-selector-common.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/language-selector-gnome_0.165.4_all.deb
/var/cache/apt/archives/language-selector-common_0.165.4_all.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
sarfraz@sarfraz:~$ sudo apt-get install libssl-dev openssl
Reading package lists... Done
Building dependency tree
Reading state information... Done
libssl-dev is already the newest version (1.0.2g-1ubuntu4.1).
openssl is already the newest version (1.0.2g-1ubuntu4.1).
The following additional packages will be installed:
language-selector-common language-selector-gnome python3-distupgrade python3-software-properties software-properties-common software- properties-gtk
Recommended packages:
unattended-upgrades
The following packages will be upgraded:
language-selector-common language-selector-gnome python3-distupgrade python3-software-properties software-properties-common software- properties-gtk
6 upgraded, 0 newly installed, 0 to remove and 30 not upgraded.
141 not fully installed or removed.
Need to get 0 B/413 kB of archives.
After this operation, 1,024 B of additional disk space will be used.
Do you want to continue? [Y/n] Y
(Reading database ... 220260 files and directories currently installed.)
Preparing to unpack .../language-selector-gnome_0.165.4_all.deb ...
/var/lib/dpkg/info/language-selector-gnome.prerm: 6: /var/lib/dpkg/info/language-selector-gnome.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/language- selector-gnome_0.165.4_all.deb (--unpack):
subprocess new pre-removal script returned error exit status 127
/var/lib/dpkg/info/language-selector-gnome.postinst: 6: /var/lib/dpkg/info/language-selector-gnome.postinst: py3compile: not found
dpkg: error while cleaning up:
subprocess installed post-installation script returned error exit status 127
Preparing to unpack .../language-selector-common_0.165.4_all.deb ...
/var/lib/dpkg/info/language-selector-common.prerm: 21: /var/lib/dpkg/info/language-selector-common.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: 21: /var/lib/dpkg/tmp.ci/prerm: py3clean: not found
dpkg: error processing archive /var/cache/apt/archives/language-selector-common_0.165.4_all.deb (--unpack):
subprocess new pre-removal script returned error exit status 127
/var/lib/dpkg/info/language-selector-common.postinst: 23: /var/lib/dpkg/info/language-selector-common.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/language-selector-gnome_0.165.4_all.deb
/var/cache/apt/archives/language-selector-common_0.165.4_all.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
sarfraz@sarfraz:~$ sudo apt-get update && sudo apt-get dist-upgrade -y
Ign:1 http://dl.google.com/linux/chrome/deb stable InRelease
Hit:2 http://dl.google.com/linux/chrome/deb stable Release
Hit:4 http://ppa.launchpad.net/mystic-mirage/pycharm/ubuntu xenial InRelease
Hit:5 http://ppa.launchpad.net/webupd8team/sublime-text-3/ubuntu xenial InRelease
Reading package lists... Done
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: The package python3-software-properties needs to be reinstalled, but I can't find an archive for it.
sarfraz@sarfraz:~$ sudo apt-get install --reinstall python-software-properties
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: The package python3-software-properties needs to be reinstalled, but I can't find an archive for it.
sarfraz@sarfraz:~$ sudo apt-get install --reinstall python-software-properties
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: The package python3-software-properties needs to be reinstalled, but I can't find an archive for it.
sarfraz@sarfraz:~$ sudo apt-get install software-properties-common
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: The package python3-software-properties needs to be reinstalled, but I can't find an archive for it.
sarfraz@sarfraz:~$ sudo apt-get install --reinstall python3-software-properties
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: The package python3-software-properties needs to be reinstalled, but I can't find an archive for it.
sarfraz@sarfraz:~$ sudo dpkg -i Downloads/python3-software-properties_0.92.36_all.deb
(Reading database ... 220260 files and directories currently installed.)
Preparing to unpack .../python3-software-properties_0.92.36_all.deb ...
/var/lib/dpkg/info/python3-software-properties.prerm: 6: /var/lib/dpkg/info/python3-software-properties.prerm: py3clean: not found
dpkg: error processing archive Downloads/python3-software- properties_0.92.36_all.deb (--install):
subprocess installed pre-removal script returned error exit status 127
/var/lib/dpkg/info/python3-software-properties.postinst: 6: /var/lib/dpkg/info/python3-software-properties.postinst: py3compile: not found
dpkg: error while cleaning up:
subprocess installed post-installation script returned error exit status 127
Errors were encountered while processing:
Downloads/python3-software-properties_0.92.36_all.deb
sarfraz@sarfraz:~$ sudo apt-get update
Ign:1 http://dl.google.com/linux/chrome/deb stable InRelease
Hit:2 http://dl.google.com/linux/chrome/deb stable Release
Hit:4 http://ppa.launchpad.net/mystic-mirage/pycharm/ubuntu xenial InRelease
Hit:5 http://ppa.launchpad.net/webupd8team/sublime-text-3/ubuntu xenial InRelease
Reading package lists... Done
sarfraz@sarfraz:~$ sudo apt-get install --reinstall python3
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: The package python3-software-properties needs to be reinstalled, but I can't find an archive for it.
非常感谢您的帮助。
答案1
尝试运行以下命令:
apt-get -f install
纠正存在破坏依赖关系的系统。
也尝试:dpkg --configure -a
。
如果上述方法无效,请尝试重新安装核心 Python 安装,因为py3compile
文件是软件包的一部分python3-minimal
,因此如果问题仍然存在,请尝试重新安装该软件包。如果无法使用重新安装apt-get
,请尝试.pkg
从 kernel.org下载文件并手动安装(python3-minimal*)。例如
dpkg -i python3-minimal_*.deb
还要确保可以py3compile
根据当前PATH
变量进行访问。
答案2
我知道这是一个老话题,但我能够解决我损坏的 Python3 系统安装sudo apt install python3-minimal python3 --reinstall
答案3
这对我有用:
首先,我安装了 python3-all 来重新安装 Python 以及按照以下答案缺少的其他内容:https://askubuntu.com/a/810914/640078
sudo apt install python3-all
这样安装了大部分内容,但存在一些问题;我按照以下步骤进行操作:
我这样做了sudo apt -f install
,并得到了几个如下错误:
Need to get 0 B/183 kB of archives.
After this operation, 0 B of additional disk space will be used.
dpkg: error processing package python3-yaml (--configure):
package is in a very bad inconsistent state; you should
reinstall it before attempting configuration
No apport report written because the error message indicates its a followup error from a previous failure.
.
.
.
.
dpkg: error processing package update-notifier (--configure):
dependency problems - leaving unconfigured
Errors were encountered while processing:
python3-yaml
netplan.io
ubuntu-advantage-tools
update-manager
ubuntu-release-upgrader-gtk
update-notifier
E: Sub-process /usr/bin/dpkg returned an error code (1)
因此我首先安装了 python3-yaml,然后安装了 ubuntu-advantage-tools:
sudo apt install python3-yaml
sudo apt install ubuntu-advantage-tools
然后我照做了,sudo apt install -f
问题sudo apt autoremove
就解决了。
答案4
最好的答案是重新安装。但我设法解决了这个问题--
在任何其他机器上安装 python,即 VPS apt install python python3 python-all python-minimal python3-minimal
一旦您在 VPS 或另一台 PC 上安装了 pythone。
cd /var/lib zip -r fix.zip dpkg
现在将此文件(从 VPS 下载)复制到您的系统的 /var/lib unzip fiz.zip 按 A 覆盖全部
现在在你的机器上 apt install python3-all python3-minimal --reinstall apt autoremove
固定的