![无法安装 g++ (之前运行正常吗?)](https://linux22.com/image/839831/%E6%97%A0%E6%B3%95%E5%AE%89%E8%A3%85%20g%2B%2B%20(%E4%B9%8B%E5%89%8D%E8%BF%90%E8%A1%8C%E6%AD%A3%E5%B8%B8%E5%90%97%EF%BC%9F).png)
今天回到我的机器,g++ 无法从命令行运行。
输出自sudo apt-get install g++
:
The following packages have unmet dependencies:
fglrx : Depends: dkms but it is not installable
Depends: linux-headers-generic but it is not installable or
linux-headers but it is not installable
Conflicts: fglrx-driver
fglrx-amdcccle : Conflicts: fglrx-control
fglrx-amdcccle-updates : Conflicts: fglrx-control
fglrx-dev : Conflicts: fglrx-driver-dev
fglrx-updates : Depends: dkms but it is not installable
Depends: linux-headers-generic but it is not installable or
linux-headers but it is not installable
Conflicts: fglrx-driver
fglrx-updates-dev : Conflicts: fglrx-driver-dev
nvidia-settings-updates : Depends: screen-resolution-extra (>= 0.12) but it is not installable
apt 日志:
Start-Date: 2013-08-02 10:52:41
Commandline: apt-get install cpp-
Remove: x11-apps:i386 (7.6+5ubuntu1), libgnome2-0:i386 (2.32.1-2ubuntu1.1), libidl-common:i386 (0.8.14-0.2ubuntu2), x11-xserver-utils:i386 (7.6+3), g++:i386 (4.6.3-1ubuntu5), cpp:i386 (4.6.3-1ubuntu5), gcc:i386 (4.6.3-1ubuntu5), libidl0:i386 (0.8.14-0.2ubuntu2), libbonobo2-0:i386 (2.32.1-0ubuntu1.1), x11-session-utils:i386 (7.6+2), acpi-support:i386 (0.140.1), x11-xserver-utils-lts-quantal:i386 (7.7~3ubuntu1~precise1), liborbit2:i386 (2.14.19-0.1ubuntu1), xorg:i386 (7.6+12ubuntu2), libgnome2-bin:i386 (2.32.1-2ubuntu1.1)
End-Date: 2013-08-02 10:53:00
Start-Date: 2013-08-02 13:58:26
Commandline: apt-get autoremove
Remove: xorg-docs-core:i386 (1.6-1ubuntu2), g++-4.6:i386 (4.6.3-1ubuntu5), x11-xfs-utils:i386 (7.6+1), toshset:i386 (1.76-2), acpid:i386 (2.0.10-1ubuntu3), xinit:i386 (1.3.1-1), libbonobo2-common:i386 (2.32.1-0ubuntu1.1), libstdc++6-4.6-dev:i386 (4.6.3-1ubuntu5)
End-Date: 2013-08-02 13:58:38
恰当的来源:
# deb cdrom:[Ubuntu 12.04.2 LTS _Precise Pangolin_ - Release i386 (20130213)]/ precise main restricted
deb http://us.archive.ubuntu.com/ubuntu/ precise main restricted
deb-src http://us.archive.ubuntu.com/ubuntu/ precise main restricted
deb ht.tp://us.archive.ubuntu.com/ubuntu/ precise-updates main restricted
deb-src http://us.archive.ubuntu.com/ubuntu/ precise-updates main restricted
deb ht.tp://us.archive.ubuntu.com/ubuntu/ precise universe
deb-src ht.tp://us.archive.ubuntu.com/ubuntu/ precise universe
deb ht.tp://us.archive.ubuntu.com/ubuntu/ precise-updates universe
deb-src ht.tp://us.archive.ubuntu.com/ubuntu/ precise-updates universe
deb ht.tp://us.archive.ubuntu.com/ubuntu/ precise multiverse
deb-src ht.tp://us.archive.ubuntu.com/ubuntu/ precise multiverse
deb ht.tp://us.archive.ubuntu.com/ubuntu/ precise-updates multiverse
deb-src ht.tp://us.archive.ubuntu.com/ubuntu/ precise-updates multiverse
deb ht.tp://us.archive.ubuntu.com/ubuntu/ precise-backports main restricted universe multiverse
deb-src ht.tp://us.archive.ubuntu.com/ubuntu/ precise-backports main restricted universe multiverse
deb ht.tp://us.archive.ubuntu.com/ubuntu/ precise-security main restricted
deb-src ht.tp://us.archive.ubuntu.com/ubuntu/ precise-security main restricted
deb ht.tp://us.archive.ubuntu.com/ubuntu/ precise-security universe
deb-src ht.tp://us.archive.ubuntu.com/ubuntu/ precise-security universe
deb ht.tp://us.archive.ubuntu.com/ubuntu/ precise-security multiverse
deb-src ht.tp://us.archive.ubuntu.com/ubuntu/ precise-security multiverse
# deb ht.tp://archive.canonical.com/ubuntu precise partner
# deb-src ht.tp://archive.canonical.com/ubuntu precise partner
deb ht.tp://extras.ubuntu.com/ubuntu precise main
deb-src ht.tp://extras.ubuntu.com/ubuntu precise main
deb ht.tp://archive.ubuntu.com/ubuntu precise restricted main
谁能告诉我这里发生了什么事?
答案1
请不要同时安装 NVIDIA 和 ATI 驱动程序,否则会造成很多麻烦。运行:
sudo apt-get purge fglrx* nvidia* && sudo apt-get -f install
sudo rm /etc/X11/xorg.conf ## This is expected to fail in some cases.
sudo apt-get --reinstall install xserver-xorg-core-lts-quantal
修复您的安装。然后安装,build-essentials
而不仅仅是g++
,它将安装、、gcc
等。g++
make
sudo apt-get install build-essetials
关于你的sources.list
您的sources.list
文件中有错误条目,应该ht.tp://
是http://
,请编辑并运行sudo apt-get update
。