[问题]安装build-essential的问题

系统安装、升级讨论
版面规则
我们都知道新人的确很菜,也喜欢抱怨,并且带有浓厚的Windows习惯,但既然在这里询问,我们就应该有责任帮助他们解决问题,而不是直接泼冷水、简单的否定或发表对解决问题没有任何帮助的帖子。乐于分享,以人为本,这正是Ubuntu的精神所在。
回复
yanxizhen
帖子: 28
注册时间: 2005-06-23 20:25

[问题]安装build-essential的问题

#1

帖子 yanxizhen » 2006-06-16 19:50

想在机子装 build-essential这个东东,
sudo apt-get install build-essential却提示
下列的软件包有不能满足的依赖关系:
build-essential: 依赖: gcc (>= 4:4.0) 但是它将不会被安装
依赖: g++ (>= 4:4.0) 但是它将不会被安装
E: 无法安装的软件包

系统是ubuntu 6。06。
头像
karron
帖子: 6226
注册时间: 2005-06-11 14:03
来自: 不明真相的群众
联系:

#2

帖子 karron » 2006-06-17 8:10

先执行
sudo apt-get update
sudo apt-get dist-upgrade
试试。我还没有遇到过这个问题。
我的blog,关于技术,软件,linux,vim <---- 所有博客均被河蟹.
yanxizhen
帖子: 28
注册时间: 2005-06-23 20:25

#3

帖子 yanxizhen » 2006-06-17 8:27

试过,不行啊
55~~~~~~~~~~~
头像
oneleaf
论坛管理员
帖子: 10441
注册时间: 2005-03-27 0:06
系统: Ubuntu 12.04

#4

帖子 oneleaf » 2006-06-17 8:57

检查一下源,应该是源的设置有问题吧?
yanxizhen
帖子: 28
注册时间: 2005-06-23 20:25

#5

帖子 yanxizhen » 2006-06-17 9:27

oneleaf 写了:检查一下源,应该是源的设置有问题吧?
源是用网站上推荐的cn99的源:

代码: 全选

deb http://ubuntu.cn99.com/ubuntu/ dapper main restricted universe multiverse
deb http://ubuntu.cn99.com/ubuntu/ dapper-updates main restricted universe multiverse
deb http://ubuntu.cn99.com/ubuntu/ dapper-security main restricted universe multiverse
deb http://ubuntu.cn99.com/ubuntu/ dapper-backports main restricted universe multiverse
deb http://ubuntu.cn99.com/ubuntu-cn/ dapper main restricted universe multiverse
yanxizhen
帖子: 28
注册时间: 2005-06-23 20:25

#6

帖子 yanxizhen » 2006-06-17 13:14

找了个半死,在http://ubuntuforums.org/showthread.php? ... ential+gcc这里找到了貌似解决方案的帖子.....................

另外一个: http://www.ubuntuforums.org/showthread.php?t=186672
yanxizhen
帖子: 28
注册时间: 2005-06-23 20:25

#7

帖子 yanxizhen » 2006-06-17 13:30

Hi ubuntu forum - thanks for being my rubber duckling. I found the solution myself. As it might be of use in another equal but different situation, ill post it here.

I am not sure of the cause of my problem but i had some new 4.0.2-5 versions of gcc-4.0-base installed. All standar apt-get tricks for resolving broken packages did not work, because i did not have broken packages installed, Apt just dit not want to install g++-4.0 due to dependency problems with gcc-4.0 and gcc-4.0-base.

Appearently i installed a newer version of gcc (and possibly other packages) using a faulty (i.e. non standard ubuntu) apt-source.

I got very scared when, in an attempt to downgrade gcc-4.0-base to gcc-4.0-base=4.0.1-4ubuntu9 apt showed my a huge list of packages to uninstall including apt itself. That was where i stopped and posted the message above..

The solution
The solution was to carefully downgrade a collection of dependent packages (so not only gcc-4.0-base). Appearently apt is clever but not clever enough to understand that if i say


Code:
apt-get install gcc-4.0-base=4.0.1-4ubuntu9
it guesses that all dependent packages should download to the same kind of version level.

So i typed:


Code:
apt-get install gcc-4.0-base=4.0.1-4ubuntu9 gcc-4.0=4.0.1-4ubuntu9 libstdc++6-4.0-dev=4.0.1-4ubuntu9 cpp-4.0=4.0.1-4ubuntu9 libstdc++6=4.0.1-4ubuntu9
now i got a shorter list of packages (not including apt) to remove.

Then i tried pasting all the packages in the remove list in the apt-get install command line. This is where i found the troublemaker. The cpp and gcc showed dependency problems. And an apt-cache show of both packages showed that two versions where available. Step by step i changed the (huge) apt-get install commandline to explicitly include the older (corrent breezy-) versions of packages that had dependency problems and after some time it just worked.

the troublemakers (in my case) where:
cpp downgraded to 4:4.0.1-3
gcc downgraded to 4:4.0.1-3
libgcj6 downgraded to 4.0.1-4ubuntu9
gij-4.0 downgraded to 4.0.1-4ubuntu9

I still don't know where i got the wrong cpp and gcc versions from. (and i still don't know if i have posted this on the right list).

Cheers
Rob
yanxizhen
帖子: 28
注册时间: 2005-06-23 20:25

#8

帖子 yanxizhen » 2006-06-17 13:31

找到解决方法了,哈哈,可能是我用apt升级的时候用了非官方的源............
回复