Ubuntu 16.04
software-properties-gtk 不起作用。我发现 /usr/bin/python 文件夹有一些错误。我希望自己能修复它。
我删除了 /usr/bin/ 中的文件夹 python3(是的,我知道这很愚蠢)
当我运行时,software-properties-gtk
输出是:
bash: /usr/bin/software-properties-gtk: /usr/bin/python3: bad interpreter: No such file or directory
如何修复这个错误?
更新:
当我输入时sudo apt-get install --reinstall python-minimal
,OUTUPT 是:
Reading package lists... Done Building dependency tree
Reading state information... Done 0 upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 1 not upgraded. 1 not fully installed or removed. Need to get 28,1 kB of archives. After this operation, 0 B of additional disk space will be used. Get:1 http://pl.archive.ubuntu.com/ubuntu xenial-updates/main amd64 python-minimal amd64 2.7.12-1~16.04 [28,1 kB] Fetched 28,1 kB in 0s (77,8 kB/s)
(Reading database ... 248904 files and directories currently installed.) Preparing to unpack .../python-minimal_2.7.12-1~16.04_amd64.deb ... Unpacking python-minimal (2.7.12-1~16.04) over (2.7.12-1~16.04) ... Processing triggers for man-db (2.7.5-1) ... Setting up python3-minimal (3.5.1-3) ... /var/lib/dpkg/info/python3-minimal.postinst: 5: /var/lib/dpkg/info/python3-minimal.postinst: py3compile: Permission denied dpkg: error processing package python3-minimal (--configure): subprocess installed post-installation script returned error exit status 126 Setting up python-minimal (2.7.12-1~16.04) ... Errors were encountered while processing: python3-minimal E: Sub-process /usr/bin/dpkg returned an error code (1)
答案1
在这里,我将总结为解决该问题而采取的所有措施:
照常安装软件包:
sudo apt-get install --reinstall python3-minimal sudo apt-get install --reinstall python-minimal
安装低级软件包:
sudo dpkg -i --force-all /var/cache/apt/archives/python-minimal_2.7.12-1~16.04_amd64.deb sudo dpkg -i --force-all /var/cache/apt/archives/python3-minimal_3.5.1-3_amd64.deb
将包直接提取到文件系统,然后照常继续:
sudo dpkg -x /var/cache/apt/archives/python-minimal_2.7.12-1~16.04_amd64.deb / sudo dpkg -x /var/cache/apt/archives/python3-minimal_3.5.1-3_amd64.deb / sudo apt-get install -f sudo dpkg --configure -a