Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/iphone/35.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ubuntu dpkg错误:pycompile:未找到_Ubuntu_Apt_Dpkg - Fatal编程技术网

Ubuntu dpkg错误:pycompile:未找到

Ubuntu dpkg错误:pycompile:未找到,ubuntu,apt,dpkg,Ubuntu,Apt,Dpkg,当我尝试使用上述命令删除mysql时,出现以下错误: sudo apt-get remove --purge mysql-server mysql-client mysql-common 如何解决此问题?尝试以下方法: 首先删除不需要的包: Reading package lists... Done Building dependency tree Reading state information... Done Package 'mysql-client' is not in

当我尝试使用上述命令删除mysql时,出现以下错误:

sudo apt-get remove --purge mysql-server mysql-client mysql-common
如何解决此问题?

尝试以下方法:

首先删除不需要的包:

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)
清除检索到的包文件的本地存储库

sudo apt-get autoremove
删除包(未安装mysql客户端):

py3compile:未找到

py3compile
命令是
python3minimal
包的一部分,该包似乎已损坏

要解决此问题,请尝试以下操作:

  • 通过以下方式更正已断开依赖关系的系统:

    sudo apt-get remove mysql-server mysql-common
    
  • 通过以下方式重新配置所有未打包但未配置的包:

    sudo apt-get  -f install
    
  • 如果上述方法无效,请尝试通过以下方式重新安装
    python3 minimal
    软件包:

    sudo dpkg --configure -a
    
    或者运行:

    sudo apt install -f --reinstall python3-minimal
    
    或通过以下方式从文件下载并安装:

    apt-get download python3-minimal
    sudo dpkg -i *python3*.deb
    sudo apt install -f
    

然后确保
py3compile
py3clean
命令可以运行,并且可以从
PATH
变量访问这些命令。

尽管py3compile和py3clean存在于/usr/bin/中,但我的Lubunutu 16.10 shell(tcsh)一直抱怨py3compile不存在。经过数小时的挫折,我发现pycompile中的第一行是:

/usr/bin/env python

或者类似的东西,在我的系统中引用了Python2.7。使用以下命令将其更改为指向Python 3:

/usr/local/bin/python3

突然使py3compile可见

事实证明,shell所说的py3compile即使在其路径中也不存在,或者在py3compile引用Python2.7时直接使用“/usr/bin/py3compile”执行。shell甚至没有抱怨Python版本或任何东西,它只是声称py3compile本身并不存在


我陷入这种混乱是因为我想删除并重新安装Python3.5,在这样做之后,我发现仍然有一个Python3,然后我发现它来自一个Pythonminimal,我试图删除并重新安装它。pythonmiminal不会重新安装,即使在我尝试了在网络上找到的所有东西和每个包管理器之后。他们都会抱怨Py3文件丢失。现在我发现了py3compile的这个补丁。

啊,是的。Debian软件包管理的古老“第22条军规”。它归结为Debian,这取决于
py3compile
作为
libpython3.x
包的一部分,而该包也提供了
py3compile
;这是不可能的

我也被这件事折磨了,因为我也删除了整个/usr/[/local]/lib/python3*目录,所以无法让
py3compile
再次工作

一旦完成,Debian软件包管理工具中的任何内容都不能帮助您回到一个正常工作的Python3环境。你必须做肉丸手术

在Debian中重建Python3需要三件关键的事情:

  • 还原
    py3compile
    script(对于大多数人来说,您已经有了这个)
  • 恢复libpython3.7
  • 还原python二进制文件
可以从另一个正在工作的Debian主机/系统重新复制/usr[/local]/lib目录。但这一次,我将详细说明在所讨论的坏主机中的步骤(好像您没有另一个工作主机)

步骤1-下载软件包 下载受影响的Debian软件包:

cd/tmp
apt获取下载libpython3.7-minimal
apt获取下载python3.7-minimal
apt get下载python3 minimal(这很重要)
apt获取下载libpython3.7-stdlib
apt获取下载python3.7
步骤2-清理 清理旧东西

rm-rf/usr[/local]/lib/python3.7*
rm-rf/usr[/local]/bin/python3.7*
更新备选方案--删除python3/usr[/local]/bin/python3.7
hash-r#删除缓存的python3二进制路径
步骤3-从包中提取文件 让我们提取缺少的
py3compile

cd/tmp
dpkg deb-x蟒蛇3-minimal_3.7.3-1_amd64.deb缺失
dpkg deb-x蟒蛇3.7-minimal_3.7.3-2_amd64.deb缺失
dpkg deb-x libpython3.7-minimal_3.7.3-2_amd64.deb缺失
dpkg deb-x libpython3.7-stdlib_3.7.3-2_amd64.deb缺失
dpkg deb-x蟒蛇3.7_3.7.3-2_amd64.deb缺失
步骤3 在根文件系统上手动安装

cd/tmp/缺失
ls-lR/tmp/missing#如果你想覆盖你的硬盘
sudo cp-rpfv/tmp/missing/*/
步骤4-核查 启动Python3

python3
Python 3.7.3(默认值,2019年4月3日,05:39:12)
linux上的[GCC 8.3.0]
有关详细信息,请键入“帮助”、“版权”、“信用证”或“许可证”。
>>>
测试导入和显示版本

导入系统 >>>打印(系统版本信息) 系统版本信息(主版本=3,次版本=7,微版本=3,版本级别=final,序列号=0) >>> >>>退出 第五步-清洁自己
rm-rf/tmp/缺失
步骤6-通过Debian APT正式重新安装Python
dpkg-s-a | grep reinstreq
#任何清单也需要与python3一起重新安装
apt get安装--重新安装python3
最有可能的是,您得到了许多处于“reinstreq”状态的软件包

apt获取自动清理
自动记忆
#(许多软件包未能安装)
此时,您必须手动重新安装
apt get autoremove
中列出的每一项

apt获取安装--修复损坏--重新安装
最后一步-重新安装受影响的半状态Debian软件包 让我猜猜,您得到了以下错误:

sudo dpkg -i python3-minimal_*.deb
我会告诉你,你的
/etc/apt/sources.list中可能有一个较新的Debian版本。有一段时间,它完全失败了(糟糕),并从
sources.list
文件中删除了这个较新的版本(努力恢复到“稳定”的版本):这对我来说不是一件不可恢复的事情,只是你把Debian软件包数据库弄得有点乱。。。相当粗鲁

最后一步的解决需要
sudo dpkg -i python3-minimal_*.deb
E: Internal Error, No file name for XXXXXX