因此,我尝试在 Ubuntu Lucid 10.04.3 服务器上安装 PHP5 cURL 包。我担心的是包裹破损在此服务器上,如果我将这个包与损坏的包一起安装,它可能会搞乱 PHP 或 Apache。
我已经尝试过了sudo apt-get clean
,sudo dpkg --configure -a; sudo apt-get -f install
但是破损的包裹仍然在那里。
如果只是这样做,sudo aptitude install php5-curl
您认为这会影响 MySQL 或其他使用 PHP5 的东西吗?
输出sudo aptitude 安装 php5-curl:
Reading package lists... Done
Building dependency tree
Reading state information... Done
Reading extended state information
Initializing package states... Done
The following packages are BROKEN:
php5-cli php5-gd php5-mysql php5-xmlrpc
The following NEW packages will be installed:
php5-curl
The following packages will be upgraded:
libapache2-mod-php5 php5-common
2 packages upgraded, 1 newly installed, 0 to remove and 101 not upgraded.
Need to get 3571kB of archives. After unpacking 2621kB will be used.
The following packages have unmet dependencies:
php5-gd: Depends: php5-common (= 5.2.10.dfsg.1-2ubuntu6) but 5.3.2-1ubuntu4.18 is to be installed.
php5-xmlrpc: Depends: php5-common (= 5.2.10.dfsg.1-2ubuntu6) but 5.3.2-1ubuntu4.18 is to be installed.
php5-mysql: Depends: php5-common (= 5.2.10.dfsg.1-2ubuntu6) but 5.3.2-1ubuntu4.18 is to be installed.
php5-cli: Depends: php5-common (= 5.2.10.dfsg.1-2ubuntu6) but 5.3.2-1ubuntu4.18 is to be installed.
The following actions will resolve these dependencies:
Install the following packages:
php5-curl [5.2.10.dfsg.1-2ubuntu6 (karmic)]
Keep the following packages at their current version:
libapache2-mod-php5 [5.2.10.dfsg.1-2ubuntu6 (karmic, now)]
php5-common [5.2.10.dfsg.1-2ubuntu6 (karmic, now)]
Score is -9900
Accept this solution? [Y/n/q/?]
答案1
好的,这就是我最终做的事情:
首先,我建议使用aptitude
而不是 ,apt-get
因为它默认会做出更好的选择。因此,我继续并接受了 aptitude 的第一个解决方案,即除了要php5-curl
安装的版本之外,其他所有版本都保持不变。相信我,您不想在关键任务服务器上更新php5-common
或libapache2-mod-php5
包,因为它们有上百万个依赖项。然后服务器无法下载包,因为此服务器上的存储库已过时(记得是 10.04),并且找不到 .deb 文件。因此,我复制了名称php5-curl-5.2.10.dfsg.1-2ubuntu6_amd_64.deb
并在 Google 上搜索并找到了托管 .deb 文件的网站。然后我执行以下命令来安装此包,而不会导致依赖性问题:
$ wget http://www.thesitewhereyoufounditongoogle.com/php5-curl-5.2.10.dfsg.1-2ubuntu6_amd_64.deb
$ sudo dpkg -i php5-curl-5.2.10.dfsg.1-2ubuntu6_amd_64.deb
然后当然重启 Apache
$ sudo /etc/init.d/apache2 restart
瞧! cURL 已安装。