web-dev-qa-db-ja.com

Linuxサーバーの壊れたパッケージ

そのため、Ubuntu Lucid10.04.3サーバーにPHP5cURLパッケージをインストールしようとしています。私の懸念は、このサーバーに壊れたパッケージがあり、壊れたパッケージと一緒にこのパッケージをインストールすると、PHPまたはApache)が台無しになる可能性があることです。

すでにSudo apt-get cleanSudo 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/?]
5
Alex W

さて、これが私がやったことです:

まず、apt-getの代わりにaptitudeを使用することをお勧めします。これは、デフォルトでより適切な選択ができるためです。そこで、私は先に進み、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がインストールされました。

3
Alex W