用apt-get安装任何软件都出错!

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

用apt-get安装任何软件都出错!

#1

帖子 fatalerr » 2007-11-28 0:31

今天发现在运行apt-get upgrade是出错如下。请教各位该如何解决?根据系统的提示,要用命令:apt-get -f install来解决,但我运行该命令后,系统提示我将会删除一大堆软件,我没敢试,先问一下大家,是应该这样处理吗?

我记得问题是在前几天我装一个deb包后发生的,当时装这个deb包因为缺少其他包的原因没有装成功,提示要求的包虽然系统上有,但版本不对。后来我就没再装,再后来用apt-get的时候就出问题了。

刚才又试了一下,不但upgrade会出下面的错,安装别的软件也会出同样的提示!

junl@szsrv01:~$ sudo apt-get upgrade
Reading package lists... Done
Building dependency tree... Done
You might want to run `apt-get -f install' to correct these.
The following packages have unmet dependencies:
libc6-dev: Depends: libc6 (= 2.3.6-0ubuntu20.5) but 2.5-0ubuntu14 is installed
libc6-i686: PreDepends: libc6 (= 2.3.6-0ubuntu20.5) but 2.5-0ubuntu14 is installed
libgcc1: Depends: gcc-4.1-base (= 4.1.2-0ubuntu4) but it is not installable
E: Unmet dependencies. Try using -f.
junl@szsrv01:~$
junl@szsrv01:~$
junl@szsrv01:~$ sudo apt-get -f install
Reading package lists... Done
Building dependency tree... Done
Correcting dependencies... Done
The following packages will be REMOVED:
apache2 apache2-common apache2-mpm-prefork apt apt-utils aptitude build-essential dselect
g++ g++-4.0 gcc gcc-4.0 groff-base libapache2-mod-php5 libc6-dev libc6-i686 libgc1c2
libgcc1 libsigc++-2.0-0c2a libstdc++6 libstdc++6-4.0-dev lshw man-db mysql-client-5.0
mysql-server mysql-server-5.0 nmap php5-mysql php5-mysqli telnet ubuntu-minimal
ubuntu-standard w3m
WARNING: The following essential packages will be removed.
This should NOT be done unless you know exactly what you are doing!
apt libgcc1 (due to apt) libstdc++6 (due to apt)
0 upgraded, 0 newly installed, 33 to remove and 1 not upgraded.
1 not fully installed or removed.
Need to get 0B of archives.
After unpacking 125MB disk space will be freed.
You are about to do something potentially harmful.
To continue type in the phrase 'Yes, do as I say!'
?]
上次由 fatalerr 在 2007-11-28 9:34,总共编辑 1 次。
fatalerr
帖子: 49
注册时间: 2007-09-06 17:54

#2

帖子 fatalerr » 2007-11-28 9:24

搜索了一下,看来遇到类似的问题挺多的,但要么就没任何信息,要么就是只在论坛上留个“已解决”,没一个说出解决方法来的!郁闷!

有人说可能是apt源的问题,我用的是官方的源啊。详细信息如下:
junl@szsrv01:~$ cat /etc/issue
Ubuntu 6.06.1 LTS \n \l

junl@szsrv01:~$ cat /etc/apt/sources.list
#
# deb cdrom:[Ubuntu-Server 6.06.1 _Dapper Drake_ - Release i386 (20060807.1)]/ dapper main restricted


deb cdrom:[Ubuntu-Server 6.06.1 _Dapper Drake_ - Release i386 (20060807.1)]/ dapper main restricted

deb http://us.archive.ubuntu.com/ubuntu/ dapper main restricted
deb-src http://us.archive.ubuntu.com/ubuntu/ dapper main restricted

## Major bug fix updates produced after the final release of the
## distribution.
deb http://us.archive.ubuntu.com/ubuntu/ dapper-updates main restricted
deb-src http://us.archive.ubuntu.com/ubuntu/ dapper-updates main restricted

## Uncomment the following two lines to add software from the 'universe'
## repository.
## 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://us.archive.ubuntu.com/ubuntu/ dapper universe
# deb-src http://us.archive.ubuntu.com/ubuntu/ dapper universe

## 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://us.archive.ubuntu.com/ubuntu/ dapper-backports main restricted universe multiverse
# deb-src http://us.archive.ubuntu.com/ubuntu/ dapper-backports main restricted universe multiverse


deb http://security.ubuntu.com/ubuntu dapper-security main restricted
deb-src http://security.ubuntu.com/ubuntu dapper-security main restricted
# deb http://security.ubuntu.com/ubuntu dapper-security universe
# deb-src http://security.ubuntu.com/ubuntu dapper-security universe
junl@szsrv01:~$
头像
baoshaojing
帖子: 85
注册时间: 2007-05-30 9:23

Re: 用apt-get安装任何软件都出错!

#3

帖子 baoshaojing » 2007-11-28 11:05

fatalerr 写了:今天发现在运行apt-get upgrade是出错如下。请教各位该如何解决?根据系统的提示,要用命令:apt-get -f install来解决,但我运行该命令后,系统提示我将会删除一大堆软件,我没敢试,先问一下大家,是应该这样处理吗?

我记得问题是在前几天我装一个deb包后发生的,当时装这个deb包因为缺少其他包的原因没有装成功,提示要求的包虽然系统上有,但版本不对。后来我就没再装,再后来用apt-get的时候就出问题了。

刚才又试了一下,不但upgrade会出下面的错,安装别的软件也会出同样的提示!

junl@szsrv01:~$ sudo apt-get upgrade
Reading package lists... Done
Building dependency tree... Done
You might want to run `apt-get -f install' to correct these.
The following packages have unmet dependencies:
libc6-dev: Depends: libc6 (= 2.3.6-0ubuntu20.5) but 2.5-0ubuntu14 is installed
libc6-i686: PreDepends: libc6 (= 2.3.6-0ubuntu20.5) but 2.5-0ubuntu14 is installed
libgcc1: Depends: gcc-4.1-base (= 4.1.2-0ubuntu4) but it is not installable
E: Unmet dependencies. Try using -f.
junl@szsrv01:~$
junl@szsrv01:~$
junl@szsrv01:~$ sudo apt-get -f install
Reading package lists... Done
Building dependency tree... Done
Correcting dependencies... Done
The following packages will be REMOVED:
apache2 apache2-common apache2-mpm-prefork apt apt-utils aptitude build-essential dselect
g++ g++-4.0 gcc gcc-4.0 groff-base libapache2-mod-php5 libc6-dev libc6-i686 libgc1c2
libgcc1 libsigc++-2.0-0c2a libstdc++6 libstdc++6-4.0-dev lshw man-db mysql-client-5.0
mysql-server mysql-server-5.0 nmap php5-mysql php5-mysqli telnet ubuntu-minimal
ubuntu-standard w3m
WARNING: The following essential packages will be removed.
This should NOT be done unless you know exactly what you are doing!
apt libgcc1 (due to apt) libstdc++6 (due to apt)
0 upgraded, 0 newly installed, 33 to remove and 1 not upgraded.
1 not fully installed or removed.
Need to get 0B of archives.
After unpacking 125MB disk space will be freed.
You are about to do something potentially harmful.
To continue type in the phrase 'Yes, do as I say!'
?]
一个字,删……

把系统提示的要删除的删除掉
fatalerr
帖子: 49
注册时间: 2007-09-06 17:54

#4

帖子 fatalerr » 2007-12-11 14:42

搞定了。
是因为手动安装了一些库文件,版本不兼容引起的。后来使用了aptitude来将这些库文件降级。降级后恢复正常。
回复