这是我的命令:
hanlu@hanlu-VirtualBox:~/Desktop/test$ sudo apt-get install gcc
[sudo] password for hanlu:
Reading package lists... Done
Building dependency tree
Reading state information... Done
gcc is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 185 not upgraded.
3 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue [Y/n]? y
Setting up update-notifier-common (0.134) ...
/var/lib/dpkg/info/update-notifier-common.postinst: 25: /var/lib/dpkg/info/update-notifier-common.postinst: /usr/lib/update-notifier/package-data-downloader: not found
dpkg: error processing update-notifier-common (--configure):
subprocess installed post-installation script returned error exit status 127
dpkg: dependency problems prevent configuration of ttf-mscorefonts-installer:
ttf-mscorefonts-installer depends on update-notifier-common (>= 0.119ubuntu2); however:
Package update-notifier-common is not configured yet.
dpkg: error processing ttf-mscorefonts-installer (--configure):
dependency problems - leaving unconfigured
Setting up software-center (5.6.0-0ubuntu2) ...
No apport report written because the error message indicates its a followup error from a previous failure.
/var/lib/dpkg/info/software-center.postinst: 8: /var/lib/dpkg/info/software-center.postinst: pycompile: not found
dpkg: error processing software-center (--configure):
subprocess installed post-installation script returned error exit status 127
Errors were encountered while processing:
update-notifier-common
ttf-mscorefonts-installer
software-center
W: Duplicate sources.list entry http://ppa.launchpad.net/tualatrix/ppa/ubuntu/ maverick/main amd64 Packages (/var/lib/apt/lists/ppa.launchpad.net_tualatrix_ppa_ubuntu_dists_maverick_main_binary-amd64_Packages)
W: Duplicate sources.list entry http://ppa.launchpad.net/tualatrix/ppa/ubuntu/ maverick/main i386 Packages (/var/lib/apt/lists/ppa.launchpad.net_tualatrix_ppa_ubuntu_dists_maverick_main_binary-i386_Packages)
W: You may want to run apt-get update to correct these problems
E: Sub-process /usr/bin/dpkg returned an error code (1)
hanlu@hanlu-VirtualBox:~/Desktop/test$ ./project1
bash: ./project1: No such file or directory
hanlu@hanlu-VirtualBox:~/Desktop/test$ ./project1.o
bash: ./project1.o: cannot execute binary file
hanlu@hanlu-VirtualBox:~/Desktop/test$ gcc
gcc: fatal error: no input files
compilation terminated.
hanlu@hanlu-VirtualBox:~/Desktop/test$ sudo apt-get install gcc
Reading package lists... Done
Building dependency tree
Reading state information... Done
gcc is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 185 not upgraded.
3 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue [Y/n]? y
Setting up update-notifier-common (0.134) ...
/var/lib/dpkg/info/update-notifier-common.postinst: 25: /var/lib/dpkg/info/update-notifier-common.postinst: /usr/lib/update-notifier/package-data-downloader: not found
dpkg: error processing update-notifier-common (--configure):
subprocess installed post-installation script returned error exit status 127
dpkg: dependency problems prevent configuration of ttf-mscorefonts-installer:
ttf-mscorefonts-installer depends on update-notifier-common (>= 0.119ubuntu2); however:
Package update-notifier-common is not configured yet.
dpkg: error processing ttf-mscorefonts-installer (--configure):
dependency problems - leaving unconfigured
Setting up software-center (5.6.0-0ubuntu2) ...No apport report written because the error message indicates its a followup error from a previous failure.
/var/lib/dpkg/info/software-center.postinst: 8: /var/lib/dpkg/info/software-center.postinst: pycompile: not found
dpkg: error processing software-center (--configure):
subprocess installed post-installation script returned error exit status 127
Errors were encountered while processing:
update-notifier-common
ttf-mscorefonts-installer
software-center
E: Sub-process /usr/bin/dpkg returned an error code (1)
hanlu@hanlu-VirtualBox:~/Desktop/test$ sudo apt-get install build-essential
Reading package lists... Done
Building dependency tree
Reading state information... Done
build-essential is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 185 not upgraded.
3 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue [Y/n]? y
Setting up update-notifier-common (0.134) ...
/var/lib/dpkg/info/update-notifier-common.postinst: 25: /var/lib/dpkg/info/update-notifier-common.postinst: /usr/lib/update-notifier/package-data-downloader: not found
dpkg: error processing update-notifier-common (--configure):
subprocess installed post-installation script returned error exit status 127
dpkg: dependency problems prevent configuration of ttf-mscorefonts-installer:
ttf-mscorefonts-installer depends on update-notifier-common (>= 0.119ubuntu2); however:
Package update-notifier-common is not configured yet.
dpkg: error processing ttf-mscorefonts-installer (--configure):
dependency problems - leaving unconfigured
No apport report written because the error message indicates its a followup error from a previous failure.
Setting up software-center (5.6.0-0ubuntu2) ...
/var/lib/dpkg/info/software-center.postinst: 8: /var/lib/dpkg/info/software-center.postinst: pycompile: not found
dpkg: error processing software-center (--configure):
subprocess installed post-installation script returned error exit status 127
Errors were encountered while processing:
update-notifier-common
ttf-mscorefonts-installer
software-center
E: Sub-process /usr/bin/dpkg returned an error code (1)
答案1
我得到了一个错误,你在输出中得到了这个错误
pycompile: not found
我发现我的 Python 安装坏了
$ which python
/usr/bin/python # in red, as a broken link
$ ls -la /usr/bin/python
lrwxrwxrwx 1 root root 9 oct 5 20:55 /usr/bin/python -> python2.6 # in red as well
我的系统中没有安装 python-2.6(而是安装了 python-2.7),因此我修复了这个问题
$ sudo ln -sf python2.7 /usr/bin/python
现在我最初尝试的命令(sudo dpkg --configure -a
)又可以起作用了。
不确定这是否是同样的问题但也许有帮助。