sudo apt-get remove --purge mysql-server mysql-client mysql-common
Run Code Online (Sandbox Code Playgroud)
我在尝试使用上述命令删除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)
Run Code Online (Sandbox Code Playgroud)
我该如何解决?
Joh*_*ene 23
啊哈,是的。Debian 软件包管理的古老“Catch-22”情况。它归结为 Debian,具体取决于py3compile该libpython3.x软件包何时提供该软件包py3compile;这是不行的,那里。
我也被这个无法py3compile再次工作所困扰,因为我已经删除了整个 /usr/[/local]/lib/python3* 目录。
完成后,Debian 包管理工具中的任何内容都无法帮助您恢复到可工作的 Python3 环境。你必须做肉丸手术。
在 Debian 中重建 Python3 需要三个关键的事情:
py3compile脚本(对于你们大多数人来说,你已经有了这个)可以从另一个工作的 Debian 主机/系统重新复制 /usr[/local]/lib 目录。但是这一次,我将详细说明有关损坏主机中的步骤(就好像您没有其他工作主机一样)。
下载受影响的 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
Run Code Online (Sandbox Code Playgroud)
清理旧物
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
Run Code Online (Sandbox Code Playgroud)
让我们提取缺失的 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
Run Code Online (Sandbox Code Playgroud)
在您的根文件系统上手动安装
cd /tmp/missing
ls -lR /tmp/missing # if you are curious about overwriting your HD
sudo cp -rpfv /tmp/missing/* /
Run Code Online (Sandbox Code Playgroud)
启动 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.
>>>
Run Code Online (Sandbox Code Playgroud)
测试导入并显示版本
>>> import sys
>>> print(sys.version_info)
sys.version_info(major=3, minor=7, micro=3, releaselevel='final', serial=0)
>>>
>>> quit()
Run Code Online (Sandbox Code Playgroud)
rm -rf /tmp/missing
Run Code Online (Sandbox Code Playgroud)
dpkg -s -a | grep reinstreq
# Any listing also needs to be reinstalled along with python3
apt-get install --reinstall python3
Run Code Online (Sandbox Code Playgroud)
最有可能的是,您得到了许多处于“reinstreq”状态的卡住状态的软件包。
apt-get autoclean
apt-get autoremove
# (MANY PACKAGES FAILED TO BE INSTALLED)
Run Code Online (Sandbox Code Playgroud)
此时,您必须手动重新安装apt-get autoremove...
apt-get install --fix-broken --reinstall <list-of-many-failed-packages>
Run Code Online (Sandbox Code Playgroud)
让我猜猜,您收到以下错误:
E: Internal Error, No file name for XXXXXX
Run Code Online (Sandbox Code Playgroud)
我会告诉你,你可能有/etc/apt/sources.list一段时间有一个更新的 Debian 发行版,它完全向南(坏),并从sources.list文件中删除了那个新发行版(努力恢复到“稳定”版本):那是对我来说,这不是不可恢复的事情,只是你在那里猛拉了 Debian 软件包数据库……相当粗暴。
最后一步的解决方案需要通过重新安装几乎所有内容来恢复和稳定 Debian 软件包管理数据库。我稍后会详细介绍,但此处提供了要遵循的链接。
ken*_*orb 10
py3compile:找不到
该py3compile命令是python3-minimal软件包的一部分,似乎已损坏。
要解决此问题,请尝试以下操作:
通过以下方法更正依赖项已损坏的系统:
sudo apt-get -f install
Run Code Online (Sandbox Code Playgroud)通过以下方式重新配置所有未包装但未配置的软件包:
sudo dpkg --configure -a
Run Code Online (Sandbox Code Playgroud)如果上述方法不能解决问题,请尝试python3-minimal通过以下方式重新安装软件包:
sudo apt install -f --reinstall python3-minimal
Run Code Online (Sandbox Code Playgroud)
或者运行:
apt-get download python3-minimal
sudo dpkg -i *python3*.deb
sudo apt install -f
Run Code Online (Sandbox Code Playgroud)
或.pkg从kernel.org下载文件并通过以下方式从文件安装:
sudo dpkg -i python3-minimal_*.deb
Run Code Online (Sandbox Code Playgroud)然后确保py3compileand py3clean命令可运行并且可以从您的PATH变量访问。
尝试这个:
首先删除不再需要的包:
sudo apt-get autoremove
Run Code Online (Sandbox Code Playgroud)
清除检索到的包文件的本地存储库
sudo apt-get autoclean
Run Code Online (Sandbox Code Playgroud)
删除软件包(未安装mysql-client):
sudo apt-get remove mysql-server mysql-common
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
8877 次 |
| 最近记录: |