如何在 ubuntu 上安装 php5-gd?

Joh*_*ohn 4 ubuntu php5-gd

我正在运行 ubuntu 10.04。

我刚刚运行了命令,

sudo apt-get install php5-gd
Run Code Online (Sandbox Code Playgroud)

但它给了我这个错误

The following packages have unmet dependencies:
  php5-gd: Depends: php5-common (= 5.3.2-1ubuntu4) but 5.3.2-1ubuntu4.5 is to be installed
E: Broken packages
Run Code Online (Sandbox Code Playgroud)

在 php5-common 上尝试 apt-get 安装时,它说我已经有了最新版本。我如何安装 php5-gd?

附加信息 这是我在做一个之后看到的sudo apt-get update | grep main

Ign http://us.archive.ubuntu.com/ubuntu/ lucid/main Translation-en_US
Ign http://dl.google.com/linux/chrome/deb/ stable/main Translation-en_US
Ign http://dl.google.com/linux/talkplugin/deb/ stable/main Translation-en_US
Hit http://us.archive.ubuntu.com lucid/main Packages
Hit http://us.archive.ubuntu.com lucid/main Sources
Get:5 http://dl.google.com stable/main Packages [1,093B]
Get:6 http://dl.google.com stable/main Packages [737B]
Run Code Online (Sandbox Code Playgroud)

oos*_*hro 8

更新包索引文件(当前php5-common 5.3.2-1ubuntu4.7):

$ sudo apt-get update
$ sudo apt-get install php5-gd
Run Code Online (Sandbox Code Playgroud)

检查 /etc/apt/sources.list 中的后续字符串:

deb http://us.archive.ubuntu.com/ubuntu/ lucid main restricted
deb http://us.archive.ubuntu.com/ubuntu/ lucid-updates main restricted
deb http://security.ubuntu.com/ubuntu lucid-security main restricted
Run Code Online (Sandbox Code Playgroud)

使固定:

$ sudo -s
# echo "deb http://us.archive.ubuntu.com/ubuntu/ lucid-updates main restricted" >> /etc/apt/sources.list
# echo "deb http://security.ubuntu.com/ubuntu lucid-security main restricted" >> /etc/apt/sources.list
# apt-get update
# apt-get install php5-gd
Run Code Online (Sandbox Code Playgroud)