sudo apt-get remove --purge mysql-server mysql-client mysql-common当我尝试使用上面的命令删除mysql时,我得到了以下错误:
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package 'mysql-client' is not installed, so not removed
The following package was automatically installed and is no longer required:
php5-mysqlnd
Use 'apt-get autoremove' to remove it.
The following extra packages will be installed:
mysql-server-core-5.5 php5-mysqlnd python-aptdaemon
python-aptdaemon.gtk3widgets python3-aptdaemon python3-aptdaemon.gtk3widgets
python3-aptdaemon.pkcompat python3-uno python3-update-manager
ubuntu-drivers-common update-manager
The following packages will be REMOVED:
libdbd-mysql-perl* libmysqlclient18* mysql-client-5.5* mysql-common*
mysql-server* mysql-server-5.5* php5-mysql* phpmyadmin*
The following NEW packages will be installed:
php5-mysqlnd
The following packages will be upgraded:
mysql-server-core-5.5 python-aptdaemon python-aptdaemon.gtk3widgets
python3-aptdaemon python3-aptdaemon.gtk3widgets python3-aptdaemon.pkcompat
python3-uno python3-update-manager ubuntu-drivers-common update-manager
10 upgraded, 1 newly installed, 8 to remove and 115 not upgraded.
170 not fully installed or removed.
Need to get 0 B/4,388 kB of archives.
After this operation, 89.9 MB disk space will be freed.
Do you want to continue? [Y/n] Y
Preconfiguring packages ...
(Reading database ... 354910 files and directories currently installed.)
Preparing to unpack .../ubuntu-drivers-common_1%3a0.2.91.9_amd64.deb ...
/var/lib/dpkg/info/ubuntu-drivers-common.prerm: 12: /var/lib/dpkg/info/ubuntu-drivers-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: 12: /var/lib/dpkg/tmp.ci/prerm: py3clean: not found
dpkg: error processing archive /var/cache/apt/archives/ubuntu-drivers-common_1%3a0.2.91.9_amd64.deb (--unpack):
subprocess new pre-removal script returned error exit status 127
/var/lib/dpkg/info/ubuntu-drivers-common.postinst: 6:
/var/lib/dpkg/info/ubuntu-drivers-common.postinst: py3compile: not found
dpkg: error while cleaning up:
subprocess installed post-installation script returned error exit status 127
Preparing to unpack .../python3-update-manager_1%3a0.196.13_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%3a0.196.13_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 .../python3-aptdaemon.pkcompat_1.1.1-1ubuntu5.2_all.deb ...
/var/lib/dpkg/info/python3-aptdaemon.pkcompat.prerm: 6:
/var/lib/dpkg/info/python3-aptdaemon.pkcompat.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-aptdaemon.pkcompat_1.1.1-1ubuntu5.2_all.deb (--unpack):
subprocess new pre-removal script returned error exit status 127
/var/lib/dpkg/info/python3-aptdaemon.pkcompat.postinst: 6:
/var/lib/dpkg/info/python3-aptdaemon.pkcompat.postinst: py3compile: not found
dpkg: error while cleaning up:
subprocess installed post-installation script returned error exit status 127
Preparing to unpack .../python3-aptdaemon.gtk3widgets_1.1.1-1ubuntu5.2_all.deb ...
/var/lib/dpkg/info/python3-aptdaemon.gtk3widgets.prerm: 6:
/var/lib/dpkg/info/python3-aptdaemon.gtk3widgets.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-aptdaemon.gtk3widgets_1.1.1-1ubuntu5.2_all.deb (--unpack):
subprocess new pre-removal script returned error exit status 127
No apport report written because MaxReports is reached already
/var/lib/dpkg/info/python3-aptdaemon.gtk3widgets.postinst: 6:
/var/lib/dpkg/info/python3-aptdaemon.gtk3widgets.postinst: py3compile: not found
dpkg: error while cleaning up:
subprocess installed post-installation script returned error exit status 127
Preparing to unpack .../python3-aptdaemon_1.1.1-1ubuntu5.2_all.deb ...
/var/lib/dpkg/info/python3-aptdaemon.prerm: 6: /var/lib/dpkg/info/python3-aptdaemon.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-aptdaemon_1.1.1-1ubuntu5.2_all.deb (--unpack):
subprocess new pre-removal script returned error exit status 127
No apport report written because MaxReports is reached already
/var/lib/dpkg/info/python3-aptdaemon.postinst: 6:
/var/lib/dpkg/info/python3-aptdaemon.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%3a0.196.13_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%3a0.196.13_all.deb (--unpack):
subprocess new pre-removal script returned error exit status 127
No apport report written because MaxReports is reached already
/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
Preparing to unpack .../python-aptdaemon.gtk3widgets_1.1.1-1ubuntu5.2_all.deb ...
/var/lib/dpkg/info/python-aptdaemon.gtk3widgets.prerm: 6:
/var/lib/dpkg/info/python-aptdaemon.gtk3widgets.prerm: pyclean: 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: pyclean: not found
dpkg: error processing archive /var/cache/apt/archives/python-aptdaemon.gtk3widgets_1.1.1-1ubuntu5.2_all.deb (--unpack):
subprocess new pre-removal script returned error exit status 127
No apport report written because MaxReports is reached already
/var/lib/dpkg/info/python-aptdaemon.gtk3widgets.postinst: 6:
/var/lib/dpkg/info/python-aptdaemon.gtk3widgets.postinst: pycompile: not found
dpkg: error while cleaning up:
subprocess installed post-installation script returned error exit status 127
Preparing to unpack .../python-aptdaemon_1.1.1-1ubuntu5.2_all.deb ...
/var/lib/dpkg/info/python-aptdaemon.prerm: 6: /var/lib/dpkg/info/python-aptdaemon.prerm: pyclean: 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: pyclean: not found
dpkg: error processing archive /var/cache/apt/archives/python-aptdaemon_1.1.1-1ubuntu5.2_all.deb (--unpack):
subprocess new pre-removal script returned error exit status 127
No apport report written because MaxReports is reached already
/var/lib/dpkg/info/python-aptdaemon.postinst: 6:
/var/lib/dpkg/info/python-aptdaemon.postinst: pycompile: not found
dpkg: error while cleaning up:
subprocess installed post-installation script returned error exit status 127
Preparing to unpack .../python3-uno_1%3a4.2.8-0ubuntu2_amd64.deb ...
/var/lib/dpkg/info/python3-uno.prerm: 6: /var/lib/dpkg/info/python3-uno.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-uno_1%3a4.2.8-0ubuntu2_amd64.deb (--unpack):
subprocess new pre-removal script returned error exit status 127
No apport report written because MaxReports is reached already
/var/lib/dpkg/info/python3-uno.postinst: 6: /var/lib/dpkg/info/python3-uno.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/ubuntu-drivers-common_1%3a0.2.91.9_amd64.deb
/var/cache/apt/archives/python3-update-manager_1%3a0.196.13_all.deb
/var/cache/apt/archives/python3-aptdaemon.pkcompat_1.1.1-1ubuntu5.2_all.deb
/var/cache/apt/archives/python3-aptdaemon.gtk3widgets_1.1.1-1ubuntu5.2_all.deb
/var/cache/apt/archives/python3-aptdaemon_1.1.1-1ubuntu5.2_all.deb
/var/cache/apt/archives/update-manager_1%3a0.196.13_all.deb
/var/cache/apt/archives/python-aptdaemon.gtk3widgets_1.1.1-1ubuntu5.2_all.deb
/var/cache/apt/archives/python-aptdaemon_1.1.1-1ubuntu5.2_all.deb
/var/cache/apt/archives/python3-uno_1%3a4.2.8-0ubuntu2_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)我该如何解决这个问题?
发布于 2019-11-22 01:19:23
啊哈,是的。Debian包管理的古老的“22条军规”情况。归根结底就是依赖于py3compile作为libpython3.x包的一部分,而这个包也提供了py3compile;这是行不通的。
我也被这个问题刺痛了,无法让py3compile再次工作,因为我也删除了整个/usr//local/lib/python3*目录。
一旦完成,Debian包管理工具中的任何东西都不能帮助您返回到工作的Python3环境。你必须做肉丸手术。
在Debian中重建Python3需要三件关键的事情:
python二进制恢复py3compile脚本(对于大多数用户来说,您已经拥有this)
py3compile可以从另一个正常运行的Debian主机/系统重新复制/usr/local/lib目录。但这一次,我将详细介绍所讨论的损坏主机中的步骤(就好像您没有另一台工作主机一样)。
第1步-下载软件包
下载受影响的Debian包:
cd /tmp
apt-get download libpython3.7-minimal
apt-get download python3.7-minimal
apt-get download python3-minimal # (this is important)
apt-get download libpython3.7-stdlib
apt-get download python3.7第2步-清理
清理旧东西
rm -rf /usr[/local]/lib/python3.7*
rm -rf /usr[/local]/bin/python3.7*
update-alternatives --remove python3 /usr[/local]/bin/python3.7
hash -r # removes cached python3 binary path第3步-从包中提取文件
让我们提取缺少的py3compile
cd /tmp
dpkg-deb -x python3-minimal_3.7.3-1_amd64.deb missing
dpkg-deb -x python3.7-minimal_3.7.3-2_amd64.deb missing
dpkg-deb -x libpython3.7-minimal_3.7.3-2_amd64.deb missing
dpkg-deb -x libpython3.7-stdlib_3.7.3-2_amd64.deb missing
dpkg-deb -x python3.7_3.7.3-2_amd64.deb missing第三步
在根文件系统上手动安装
cd /tmp/missing
ls -lR /tmp/missing # if you are curious about overwriting your HD
sudo cp -rpfv /tmp/missing/* /第4步-验证
启动Python3
python3
Python 3.7.3 (default, Apr 3 2019, 05:39:12)
[GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>>测试导入和显示版本
>>> import sys
>>> print(sys.version_info)
sys.version_info(major=3, minor=7, micro=3, releaselevel='final', serial=0)
>>>
>>> quit()第五步--清理一下自己
rm -rf /tmp/missing第6步-通过Debian APT正式重新安装Python
dpkg -s -a | grep reinstreq
# Any listing also needs to be reinstalled along with python3
apt-get install --reinstall python3最有可能的是,你得到了许多处于"reinstreq“状态的包。
apt-get autoclean
apt-get autoremove
# (MANY PACKAGES FAILED TO BE INSTALLED)在这一点上,您将不得不手动重新安装apt-get autoremove列出的每一个...
apt-get install --fix-broken --reinstall <list-of-many-failed-packages>最后一步-重新安装受影响的半状态Debian包
让我猜猜,你得到了以下错误:
E: Internal Error, No file name for XXXXXX我要告诉你,你的/etc/apt/sources.list中可能有一段时间有一个更新的Debian版本,它变得一团糟(坏了),并从sources.list文件中删除了新的版本(努力恢复到一个“稳定”的版本):这对我来说不是一个不可恢复的事情,只是你在那里稍微动了一下Debian包数据库……相当粗鲁。
最后一步的解决需要通过重新安装几乎所有的东西来恢复和稳定Debian包管理数据库。我将在稍后详细介绍它,但是下面的链接是here。
发布于 2017-11-01 23:07:24
py3compile:未找到
py3compile命令是似乎已损坏的python3-minimal包的一部分。
要解决此问题,请尝试以下操作:
sudo apt-通过以下方式获取所有未打包但未配置的-f install
sudo dpkg --配置-a
python3-minimal包:sudo apt install -f --reinstall python3-minimal
或者运行:
apt-get下载python3 3-minimal sudo dpkg -i *python3*.deb sudo apt install -f
或者通过以下方式下载.pkg file from kernel.org并从该文件安装:
sudo dpkg -i python3-minimal_*.deb
然后确保py3compile和py3clean命令是可运行的,并且可以从PATH变量访问它们。
发布于 2018-01-09 19:12:05
尽管/usr/bin/中有py3compile和py3clean,但我的Lubunutu16.10shell (tcsh)一直抱怨py3compile不在那里。在经历了几个小时的挫折之后,我发现pycompile中的第一行是:
! /usr/bin/env python
或者类似的东西,在我的系统上引用Python2.7。使用以下命令将其更改为指向Python 3:
! /usr/local/bin/python3
突然让py3compile变得可见了!
原来,当py3compile引用Python2.7时,外壳程序说py3compile不存在,即使它在它的路径中,或者直接使用"/usr/bin/py3compile“执行。shell甚至没有抱怨Python版本或其他任何东西,它只是声称py3compile本身并不存在!
我陷入这种混乱是因为我想删除并重新安装Python3.5,在这样做时,我发现仍然有一个Python3,然后我发现它来自一个python-minimal,我试图删除并重新安装它。即使我在网上和每个包管理器上尝试了所有我能找到的东西,python-minimal也不会重新安装。他们都会抱怨py3compile失踪了。现在我发现了py3compile的这个修复。
https://stackoverflow.com/questions/30962402
复制相似问题