当前时区为 UTC + 8 小时



发表新帖 回复这个主题  [ 4 篇帖子 ] 
作者 内容
1 楼 
 文章标题 : [求助]无法安装gcc
帖子发表于 : 2009-05-18 20:57 

注册: 2008-01-15 12:33
帖子: 11
送出感谢: 0 次
接收感谢: 0 次
用的是8.04,源服务器是main server

输入:
代码:
sudo apt-get install gcc


显示:
代码:
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.

Since you only requested a single operation it is extremely likely that
the package is simply not installable and a bug report against
that package should be filed.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
  gcc: Depends: gcc-4.2 (>= 4.2.3-1) but it is not going to be installed
E: Broken package


缺少gcc-4.2,输入
代码:
sudo apt-get install gcc-4.2


显示
代码:
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.

Since you only requested a single operation it is extremely likely that
the package is simply not installable and a bug report against
that package should be filed.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
  gcc-4.2: Depends: cpp-4.2 (= 4.2.4-1ubuntu3) but 4.2.4-1ubuntu4 is to be installed
           Depends: gcc-4.2-base (= 4.2.4-1ubuntu3) but 4.2.4-1ubuntu4 is to be installed
E: Broken packages


也就是说,gcc-4.2依赖于cpp-4.2 (= 4.2.4-1ubuntu3)和gcc-4.2-base (= 4.2.4-1ubuntu3),而源里面已经没有这两个软件包了,而用更新的包替代了。但是gcc-4.2只认那两个旧包,怎么办?


页首
 用户资料  
 
2 楼 
 文章标题 : Re: [求助]无法安装gcc
帖子发表于 : 2009-05-18 21:22 

注册: 2006-03-10 15:10
帖子: 3182
地址: xi'an China
送出感谢: 0 次
接收感谢: 2
这种问题,99%的情况下,是由于源没设置对造成的。如果方便,请先检查一下你的源列表

另外,gcc不是这么装的,请尝试
sudo apt-get install build-essential


页首
 用户资料  
 
3 楼 
 文章标题 : Re: [求助]无法安装gcc
帖子发表于 : 2009-05-19 8:34 

注册: 2008-01-15 12:33
帖子: 11
送出感谢: 0 次
接收感谢: 0 次
还是不行,输入
代码:
sudo apt-get install build-essential

显示
代码:
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.

Since you only requested a single operation it is extremely likely that
the package is simply not installable and a bug report against
that package should be filed.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
  build-essential: Depends: gcc (>= 4:4.1.1) but it is not going to be installed
                   Depends: g++ (>= 4:4.1.1) but it is not going to be installed
E: Broken packages


关于源的设置,/etc/apt/sources.list 文件如下,请诊断:
代码:
# deb cdrom:[Ubuntu 8.04.1 _Hardy Heron_ - Release i386 (20080702.1)]/ hardy main restricted
# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.

deb http://archive.ubuntu.com/ubuntu/ hardy main

## Major bug fix updates produced after the final release of the
## distribution.

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team, and may not be under a free licence. Please satisfy yourself as to
## your rights to use the software. Also, please note that software in
## universe WILL NOT receive any review or updates from the Ubuntu security
## team.
deb http://archive.ubuntu.com/ubuntu/ hardy universe

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team, and may not be under a free licence. Please satisfy yourself as to
## your rights to use the software. Also, please note that software in
## multiverse WILL NOT receive any review or updates from the Ubuntu
## security team.
deb http://archive.ubuntu.com/ubuntu/ hardy multiverse

## Uncomment the following two lines to add software from the 'backports'
## repository.
## N.B. software from this repository may not have been tested as
## extensively as that contained in the main release, although it includes
## newer versions of some applications which may provide useful features.
## Also, please note that software in backports WILL NOT receive any review
## or updates from the Ubuntu security team.
# deb http://cn.archive.ubuntu.com/ubuntu/ hardy-backports main restricted universe multiverse
# deb-src http://cn.archive.ubuntu.com/ubuntu/ hardy-backports main restricted universe multiverse

## Uncomment the following two lines to add software from Canonical's
## 'partner' repository. This software is not part of Ubuntu, but is
## offered by Canonical and the respective vendors as a service to Ubuntu
## users.
# deb http://archive.canonical.com/ubuntu hardy partner
# deb-src http://archive.canonical.com/ubuntu hardy partner

deb http://archive.ubuntu.com/ubuntu/ hardy-security main
deb http://archive.ubuntu.com/ubuntu/ hardy-security universe
deb http://archive.ubuntu.com/ubuntu/ hardy-security multiverse
deb http://archive.ubuntu.com/ubuntu/ hardy-updates main multiverse universe
# deb http://wine.budgetdedicated.com/apt hardy main


其实还有一些源在/etc/apt/sources.list.d 里面,不过只开了一个cran的。

干脆将System -> Administration -> Software Sources 截图如下,供诊断:

附件:
001.png
001.png [ 89.88 KiB | 被浏览 818 次 ]



附件:
002.png
002.png [ 153.92 KiB | 被浏览 815 次 ]



附件:
003.png
003.png [ 95.13 KiB | 被浏览 813 次 ]




请大侠指点,谢谢!


页首
 用户资料  
 
4 楼 
 文章标题 : Re: [求助]无法安装gcc
帖子发表于 : 2009-05-20 20:56 

注册: 2008-01-15 12:33
帖子: 11
送出感谢: 0 次
接收感谢: 0 次
问题已经解决了。就是源设置的问题,加上了一个新源(cn99),就一切问题解决了。

同时发现了大量的新软件包没有升级,于是升级了35个软件包。

其实我不大喜欢升级,频繁的升级有时把系统搞乱......

感谢2楼大侠的指点。


页首
 用户资料  
 
显示帖子 :  排序  
发表新帖 回复这个主题  [ 4 篇帖子 ] 

当前时区为 UTC + 8 小时


在线用户

正在浏览此版面的用户:没有注册用户 和 4 位游客


不能 在这个版面发表主题
不能 在这个版面回复主题
不能 在这个版面编辑帖子
不能 在这个版面删除帖子
不能 在这个版面提交附件

前往 :  
本站点为公益性站点,用于推广开源自由软件,由 DiaHosting VPSBudgetVM VPS 提供服务。
我们认为:软件应可免费取得,软件工具在各种语言环境下皆可使用,且不会有任何功能上的差异;
人们应有定制和修改软件的自由,且方式不受限制,只要他们自认为合适。

Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
简体中文语系由 王笑宇 翻译