我想在我的 Debian squeeze 64x 上使用 gcc 4.7.2
我按照该线程中的说明进行操作:获取 debian 的最新 gcc 吗?,但我收到错误,我尝试了几个 apt-get install 命令
只要我可以使用新的 c++ 11 功能,我就会选择 4.7.1。
以下是我更新的源列表和首选项文件。更新这些文件后,我从根终端使用 apt-get update 。
/etc/apt/sources.list
#
# deb cdrom:[Debian GNU/Linux 6.0.5 _Squeeze_ - Official amd64 NETINST Binary-1 20120512-20:40]/ squeeze main
#deb cdrom:[Debian GNU/Linux 6.0.5 _Squeeze_ - Official amd64 NETINST Binary-1 20120512-20:40]/ squeeze main
deb http://ftp.belnet.be/debian/ squeeze main
deb-src http://ftp.belnet.be/debian/ squeeze main
deb http://ftp.belnet.be/debian/ wheezy main
deb http://security.debian.org/ squeeze/updates main
deb-src http://security.debian.org/ squeeze/updates main
# squeeze-updates, previously known as 'volatile'
deb http://ftp.belnet.be/debian/ squeeze-updates main
deb-src http://ftp.belnet.be/debian/ squeeze-updates main
deb http://apt.jenslody.de/stable stable main
deb-src http://apt.jenslody.de/stable stable main
deb http://apt.wxwidgets.org/ squeeze-wx main
/etc/apt/首选项
Package: *
Pin: release n=squeeze
Pin-Priority: 900
Package: *
Pin: release n=wheezy
Pin-Priority: 200
看起来这有帮助,但现在 apt-get 抱怨未满足的依赖关系
root@debianWillem:/home/willem# apt-get install gcc-4.7/testing
Reading package lists... Done
Building dependency tree
Reading state information... Done
Selected version '4.7.1-7' (Debian:testing [amd64]) for 'gcc-4.7'
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
gcc-4.7 : Depends: cpp-4.7 (= 4.7.1-7) but it is not going to be installed
Depends: binutils (>= 2.21.1) but 2.20.1-16 is to be installed
Depends: libgcc1 (>= 1:4.7.1-7) but 1:4.4.5-8 is to be installed
Depends: libgomp1 (>= 4.7.1-7) but 4.4.5-8 is to be installed
Depends: libmpfr4 (>= 3.1.0) but 3.0.0-2 is to be installed
Recommends: libc6-dev (>= 2.13-5) but 2.11.3-3 is to be installed
E: Broken packages
root@debianWillem:/home/willem# apt-get --target-release testing install gcc-4.7
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
initscripts : Breaks: console-setup (< 1.74) but 1.68+squeeze2 is to be installed
Breaks: nfs-common (< 1:1.2.5-3) but 1:1.2.2-4squeeze2 is to be installed
libglib2.0-0 : Breaks: eog (< 3.2.2-3) but 2.30.2-1 is to be installed
libgnome-keyring0 : Breaks: gnome-keyring (< 3.0) but 2.30.3-5 is to be installed
network-manager : Recommends: crda but it is not going to be installed
Breaks: network-manager-gnome (< 0.9) but 0.8.1-2 is to be installed
E: Broken packages
我如何解决这些未满足的依赖关系?
答案1
gcc-4.7.2 已于 3 天前的 9 月 20 日发布。它还不会进入 Debian 存储库(参见 update2,谢谢 derobert)。
根据发行说明它是一个错误修复版本,因此可能会使用与之前的 4.7.1 版本相同的库版本。因此,由于 4.7.1 位于存储库中,因此安装它以排序所有依赖项,然后如果您真的真的需要最新版本,请下载源代码并按照以下说明进行编译海湾合作委员会网站。
更新:
您的 source.lst 似乎有问题。作为解决方法,请尝试下载软件包这里并使用安装dkpg -i gcc_4.7.1-1_amd64.deb
。
更新2:
正如 @derobert 下面指出的,4.7.2 确实在实验性仓库中。因此,请调整来自您链接到的帖子:
你的/etc/apt/sources.list
应该看起来像这样:
德布本地.debian.镜像挤压主要 德布本地.debian.镜像主要不稳定
而你的/etc/apt/preferences
应该看起来像这样:
包裹: * 引脚:释放 n=挤压 引脚优先级:900 包裹: * 引脚:释放 n=不稳定 引脚优先级:200
然后使用安装apt-get install gcc-4.7/unstable
。
正如乔丹和您提到的原始教程一样,这不是一个好主意。完成后,请确保将您的来源恢复到稳定状态。