/var/lib/dpkg/info/python3-minimal.postinst: py3compile: not found

在Ubuntu系统中尝试安装python3-minimal时遇到了错误,问题源于缺少/usr/bin/下的python3.6软链接。通过创建软链接到Anaconda3的python3.6路径,然后重新执行安装命令,成功解决了安装问题。安装过程涉及dpkg、postinst脚本及man-db的处理。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

python3-minimal_3.6.5-3_amd64.deb 安装失败


app@ubuntu:/mnt/app$ sudo dpkg -i python3-minimal_3.6.5-3_amd64.deb
(Reading database ... 192157 files and directories currently installed.)
Preparing to unpack python3-minimal_3.6.5-3_amd64.deb ...
Unpacking python3-minimal (3.6.5-3) over (3.6.5-3) ...
Setting up python3-minimal (3.6.5-3) ...
/var/lib/dpkg/info/python3-minimal.postinst: 5: /var/lib/dpkg/info/python3-minimal.postinst: py3compile: not found
dpkg: error processing package python3-minimal (--install):
 installed python3-minimal package post-installation script subprocess returned error exit status 127
Processing triggers for man-db (2.8.3-2ubuntu0.1) ...
Errors were encountered while processing:
 python3-minimal

原因:安装时每次会寻找 /usr/bin/ 下的python3.6 软链接。如果软链接未找到,则导致上述报错。
新建软连接:

sudo ln -snf /mnt/app/anaconda3/bin/python3.6 /usr/bin/python3.6
sudo ln -snf /mnt/app/anaconda3/bin/python3.6m /usr/bin/python3.6m

再查看:

app@ubuntu:/mnt/app$ ls -lh /usr/bin/python3*
lrwxrwxrwx 1 root root   34 Nov 24 11:43 /usr/bin/python3 -> /mnt/app/anaconda3/bin/python3.6
lrwxrwxrwx 1 root root   34 Nov 24 11:44 /usr/bin/python3.6 -> /mnt/app/anaconda3/bin/python3.6
lrwxrwxrwx 1 root root   41 Nov 24 09:26 /usr/bin/python3.6-config -> /mnt/app/anaconda3/bin/python3.6-config
lrwxrwxrwx 1 root root   35 Nov 24 11:45 /usr/bin/python3.6m -> /mnt/app/anaconda3/bin/python3.6m
lrwxrwxrwx 1 root root   42 Nov 24 09:26 /usr/bin/python3.6m-config -> /mnt/app/anaconda3/bin/python3.6m-config
lrwxrwxrwx 1 root root   39 Nov 24 09:27 /usr/bin/python3-config -> /mnt/app/anaconda3/bin/python3-config
-rwsr-xr-x 1 root root 1018 Oct 28  2017 /usr/bin/python3-jsondiff
-rwsr-xr-x 1 root root 3.6K Oct 28  2017 /usr/bin/python3-jsonpatch
-rwsr-xr-x 1 root root 1.4K May  1  2016 /usr/bin/python3-jsonpointer
-rwsr-xr-x 1 root root  398 Nov 15  2017 /usr/bin/python3-jsonschema
lrwxrwxrwx 1 root root   35 Nov 24 11:43 /usr/bin/python3m -> /mnt/app/anaconda3/bin/python3.6m
lrwxrwxrwx 1 root root   17 Oct 25  2018 /usr/bin/python3m-config -> python3.6m-config

再次安装:


app@ubuntu:/mnt/app/Movidius$ sudo dpkg -i python3-minimal_3.6.5-3_amd64.deb
(Reading database ... 192157 files and directories currently installed.)
Preparing to unpack python3-minimal_3.6.5-3_amd64.deb ...
Unpacking python3-minimal (3.6.5-3) over (3.6.5-3) ...
Setting up python3-minimal (3.6.5-3) ...
Processing triggers for man-db (2.8.3-2ubuntu0.1) ...

sudo apt-get install python3-pip 正在读取软件包列表... 完成 正在分析软件包的依赖关系树 正在读取状态信息... 完成 python3-pip 已经是最新版 (18.1-5.1.lnd.1)。 升级了 0 个软件包,新安装了 0 个软件包,要卸载 0 个软件包,有 30 个软件包未被升级。 有 6 个软件包没有被完全安装或卸载。 解压缩后会消耗 0 B 的额外空间。 您希望继续执行吗? [Y/n] y dpkg: 警告: 正在解析文件 '/var/lib/dpkg/status' 第 3582 行附近,软件包 'create.license' : missing 'Description' field 正在设置 devscripts (2.19.5+deb10u1+nmu1) ... /var/lib/dpkg/info/devscripts.postinst: 12: /var/lib/dpkg/info/devscripts.postinst: py3compile: not found dpkg: 处理软件包 devscripts (--configure)时出错: 已安装 devscripts 软件包 post-installation 脚本 子进程返回错误状态 127 正在设置 python3-gpg (1.12.0-6.lnd.2) ... /var/lib/dpkg/info/python3-gpg.postinst: 6: /var/lib/dpkg/info/python3-gpg.postinst: py3compile: not found dpkg: 处理软件包 python3-gpg (--configure)时出错: 已安装 python3-gpg 软件包 post-installation 脚本 子进程返回错误状态 127 正在设置 python3-debian (0.1.35+nmu1) ... /var/lib/dpkg/info/python3-debian.postinst: 6: /var/lib/dpkg/info/python3-debian.postinst: py3compile: not found dpkg: 处理软件包 python3-debian (--configure)时出错: 已安装 python3-debian 软件包 post-installation 脚本 子进程返回错误状态 127 正在设置 python3-unidiff (0.5.4-1.1) ... /var/lib/dpkg/info/python3-unidiff.postinst: 6: /var/lib/dpkg/info/python3-unidiff.postinst: py3compile: not found dpkg: 处理软件包 python3-unidiff (--configure)时出错: 已安装 python3-unidiff 软件包 post-installation 脚本 子进程返回错误状态 127 正在设置 python3-magic (2:0.4.15-2.1) ... /var/lib/dpkg/info/python3-magic.postinst: 6: /var/lib/dpkg/info/python3-magic.postinst: py3compile: not found dpkg: 处理软件包 python3-magic (--configure)时出错: 已安装 python3-magic 软件包 post-installation 脚本 子进程返回错误状态 127 dpkg: 依赖关系问题使得 dput 的配置工作不能继续: dput 依赖于 python3-debian;然而: 软件包 python3-debian 尚未配置。 dput 依赖于 python3-gpg;然而: 软件包 python3-gpg 尚未配置。 dpkg: 处理软件包 dput (--configure)时出错: 依赖关系问题 - 仍未被配置 在处理时有错误发生: devscripts python3-gpg python3-debian python3-unidiff python3-magic dput E: Sub-process /usr/bin/dpkg returned an error code (1)
03-23
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值