升级错误

升级错误

当我执行 apt-get update // apt-get Upgrade 时,无论我做什么,我都会收到此错误:

root@debian:~# apt-get upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
You might want to run 'apt-get -f install' to correct these.
The following packages have unmet dependencies:
 curl : Depends: libcurl3 (= 7.26.0-1+wheezy3) but 7.21.0-2.1+squeeze2 is installed
 multiarch-support : Depends: libc6 (>= 2.13-5) but 2.11.3-4 is installed
E: Unmet dependencies. Try using -f.
root@debian:~#

这不是我的服务器,所以我不知道里面安装了什么,我唯一知道的是我需要将 php 从最低 5.2 升级到 5.3。告诉我 Zend Server 已安装,但我也不知道哪个版本。我尝试的第一件事就是这个,每次我都会收到这个错误。 cat /etc/issue 说:Debian GNU/Linux 6.0 \n \l

这是我的/etc/apt/sources.list:

root@debian:~# cat /etc/apt/sources.list

# deb cdrom:[Debian GNU/Linux 6.0.6 _Squeeze_ - Official i386 NETINST Binary-1 20120930-15:55]/ squeeze main

#deb cdrom:[Debian GNU/Linux 6.0.6 _Squeeze_ - Official i386 NETINST Binary-1 20120930-15:55]/ squeeze main

deb http://ftp.es.debian.org/debian/ squeeze main
deb-src http://ftp.es.debian.org/debian/ squeeze 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.es.debian.org/debian/ squeeze-updates main
deb-src http://ftp.es.debian.org/debian/ squeeze-updates main
deb http://ftp2.de.debian.org/debian squeeze main non-free
deb http://repos.zend.com/zend-server/deb server non-free
root@debian:~#

这是我使用 apt-get install -f curl 的输出:

root@debian:~# apt-get install -f curl
Reading package lists... Done
Building dependency tree
Reading state information... Done
curl is already the newest version.
You might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies:
 curl : Depends: libcurl3 (= 7.26.0-1+wheezy3) but 7.21.0-2.1+squeeze2 is to be installed
 multiarch-support : Depends: libc6 (>= 2.13-5) but 2.11.3-4 is to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).

答案1

原来的错误也给出了解决方案:

You might want to run 'apt-get -f install' to correct these.

如果你以前没有见过这个,你必须运行确切地那个命令。否则,您会得到:

Try 'apt-get -f install' with no packages (or specify a solution).

这通常可以解决问题。

答案2

迈克尔已经提供了解决方案解决依赖问题。需要进一步说明的是,apt-get upgrade将升级所有已安装的软件包。如果你想仅升级单个包, 使用apt-get install package_name。对于 PHP,它可能是apt-get install php5.

另外,如果更新软件包源时经常出现问题,您可以恢复到发行版的“官方软件包列表”。Debian 源列表生成器提供交互式界面来生成任何发行版的源列表。

相关内容