嗨,我是Ubuntu的新手,我已经很喜欢它了。我刚刚检查了Ubuntu(Ubuntu18.04.4LTS)上的更新,在更新期间遇到了以下错误。
下面是scneraio,我尝试了这个命令- sudo apt upgrade并得到了以下输出
正在读取包列表...创建依赖树读取状态信息..。计算升级..。完成以下软件包的升级:python 1升级,0新安装,0要删除,0未升级。1未完全安装或拆卸。需要获得0,B/1,919 kB的档案。在此操作之后,将使用0 B的额外磁盘空间。要继续吗?Y/n y(读取数据库.当前已安装的365163文件和目录)。准备解压缩.../python-samba_2%3a4.7.6+dfsg~ubuntu-0ubuntu2.16_amd64.deb . /var/lib/ dpkg/info/python-samba.prem: 6: /var/lib/dpkg/info/python-samba.presm: pyclean:警告:旧python包预删除脚本子进程返回错误退出状态127 dpkg:尝试从新包中的脚本./var/lib/dpkg/tmp.ci/tmp.ci/m: 6: /var/lib/lib/dpkg/tmp.ci/prerm: py洁净:未找到dpkg:错误处理存档/var/cache/apt/archives/python-samba_2%3a4.7.6+dfsg~ubuntu-0ubuntu2.16_amd64.deb (-unpack):新python包预移除脚本子进程返回错误退出状态127 /var/lib/dpkg/info/python-samba.postinst: 6: /var/lib/dpkg/info/python-samba.postinst:脚本子进程返回错误退出状态127错误在处理时遇到: /var/cache/apt/archives/python-samba_2%3a4.7.6+dfsg~ubuntu-0ubuntu2.16_amd64.deb E: subprocess /usr/bin/dpkg返回一个错误代码(1)
我尝试了以下命令,并基于google搜索修复了这个问题
sudo apt autoremove
sudo apt clean
sudo apt autoclean
sudo apt remove python-samba
sudo apt install --reinstall python-samba
sudo dpkg --configure -a
sudo apt --fix-broken install但我的坏,没有什么工作,但我得到了同样的输出,请您帮助我理解和解决这个问题。谢谢。
根据注释尝试了以下命令- sudo apt install python-minimal和我得到了以下错误
Reading package lists... Done
Building dependency tree
Reading state information... Done
python-minimal is already the newest version (2.7.15~rc1-1).
python-minimal set to manually installed.
Suggested packages:
python-gpgme
The following packages will be upgraded:
python-samba
1 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
1 not fully installed or removed.
Need to get 0 B/1,919 kB of archives.
After this operation, 0 B of additional disk space will be used.
(Reading database ... 365163 files and directories currently installed.)
Preparing to unpack .../python-samba_2%3a4.7.6+dfsg~ubuntu-0ubuntu2.16_amd64.deb ...
/var/lib/dpkg/info/python-samba.prerm: 6: /var/lib/dpkg/info/python-samba.prerm: pyclean: not found
dpkg: warning: old python-samba package pre-removal script subprocess 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-samba_2%3a4.7.6+dfsg~ubuntu-0ubuntu2.16_amd64.deb (--unpack):
new python-samba package pre-removal script subprocess returned error exit status 127
/var/lib/dpkg/info/python-samba.postinst: 6: /var/lib/dpkg/info/python-samba.postinst: pycompile: not found
dpkg: error while cleaning up:
installed python-samba package post-installation script subprocess returned error exit status 127
Errors were encountered while processing:
/var/cache/apt/archives/python-samba_2%3a4.7.6+dfsg~ubuntu-0ubuntu2.16_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)我尝试了以下命令,并且基于提供的解决方案对我起了作用。
sudo apt-get -m --reinstall install python python-minimal dh-python
sudo apt-get -f install
sudo apt install --reinstall python-minimal发布于 2020-04-30 11:31:38
您有关于缺少pyclean & pycompile的错误
/var/lib/dpkg/info/python-samba.prem: 6: /var/lib/dpkg/info/python-samba.prem:pylean: not . /var/lib/dpkg/tmp.ci/prerm: 6: /var/lib/dpkg/tmp.ci/prerm: pyclean: not /var/lib/dpkg/info/python-samba.postinst: 6: /var/lib/dpkg/info/python-samba.postinst:
这两者都包含在python-minimum包中。可能是你手动移走的。
尝试重新安装它:
sudo apt install --reinstall python-minimalhttps://askubuntu.com/questions/1233364
复制相似问题