Ale*_*x W 5 linux apache-http-server package-management php aptitude
所以,我正在尝试在 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 install 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/?]
Run Code Online (Sandbox Code Playgroud)
好吧,这就是我最终所做的:
首先,我建议使用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
Run Code Online (Sandbox Code Playgroud)
然后当然要重新启动 Apache
$ sudo /etc/init.d/apache2 restart
Run Code Online (Sandbox Code Playgroud)
瞧!cURL 已安装。