1、解决方法
在ubuntu16.04上安装wine的过程中发现apt-add-repository有问题,网上查资料后发现需要安装python-software-properties和software-properties-common,于是用apt-get install安装。
期间遇到了这样一个问题py3compile: not found,经过搜索发现py3compile是属于python3-minimal包的,然后下载python3-minimal_3.5.1-3_amd64.deb手动进行安装,下载地址如下。
https://mirrors.edge.kernel.org/ubuntu/pool/main/p/python3-defaults/
安装命令如下
sudo dpkg -i python3-minimal_3.5.1-3_amd64.deb
到这一步应该问题就解决了,如果还没解决,可能就是下面的情况。
2、python版本导致的问题
安装过程中出现了下面的问题,令我十分困惑,py3compile是属于python3-minimal包的,那么安装python3-minimal的过程怎么会依赖于py3compile呢?
xxx@xxx:~/duan/package/deb$ sudo dpkg --configure python3-minimal
正在设置 python3-minimal (3.5.1-3) ...
/var/lib/dpkg/info/python3-minimal.postinst: 5: /var/lib/dpkg/info/python3-minimal.postinst: py3compile: not found
dpkg: 处理软件包 python3-minimal (--configure)时出错:
子进程 已安装 post-installation 脚本 返回错误状态 127
在处理时有错误发生:
实际上经过分析发现python3-minimal_3.5.1-3_amd64.deb里的3.5.1-3对应着python3.5,安装python3-minimal的时候会自动重建/usr/bin/python3链接到python3.5,如果系统中没有安装python3.5的话就会出问题,ubuntu16.04安装时自带python3.5.2,但是我卸载了,然后装了python3.6.6,问题就出在这版本不一致上。
然后我重新安装了python3.5.2,并且建立了一个软链/usr/bin/python3.5,然后重新安装python3-minimal_3.5.1-3_amd64.deb就好了。