嗨,我是 Ubuntu 新手,我已经爱上它了。我刚刚检查了 Ubuntu-Budgie(Ubuntu 18.04.4 LTS)的更新,在更新过程中我遇到了以下错误。
这是场景,我尝试了这个命令 -sudo apt upgrade
我得到了以下输出
Reading package lists... Done Building dependency tree Reading state information... Done Calculating upgrade... Done 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. Do you want to continue? [Y/n] y (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 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
但我的电脑什么都没用,输出结果还是一样,你能帮我理解并解决这个问题吗?谢谢。
更新 1
根据评论尝试了这个命令-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)
更新 2 和解决方案
我尝试了以下命令,并且根据提供的解决方案,它对我有用。
sudo apt-get -m --reinstall install python python-minimal dh-python
sudo apt-get -f install
sudo apt install --reinstall python-minimal
答案1
您有关于缺失pyclean
& 的错误pycompile
/var/lib/dpkg/info/python-samba.prerm: 6: /var/lib/dpkg/info/python-samba.prerm: pyclean: not found ... /var/lib/dpkg/tmp.ci/prerm: 6: /var/lib/dpkg/tmp.ci/prerm: pyclean: not found /var/lib/dpkg/info/python-samba.postinst: 6: /var/lib/dpkg/info/python-samba.postinst: pycompile: not found
两者都包含在python-minimum
软件包中。可能您手动将其删除。
尝试重新安装:
sudo apt install --reinstall python-minimal