web-dev-qa-db-ja.com

「apt-get update」に更新しない

Ubuntu 14.04 LTSサーバーのPHPパッケージをアップグレードしようとしていましたが、エラーが発生し続けます。/apt/archives /が動作しませんでした。

私はこれらのコマンドを実行しました:

Sudo apt-add-repository ppa:ondrej/php5
Sudo apt-get autoremove
Sudo apt-get update
Sudo apt-get -f install

それから私はこれを得ました:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
Correcting dependencies... Done
The following packages will be REMOVED:
  Apache2-mpm-prefork Apache2.2-bin Apache2.2-common php5-dev php5-Gd
The following NEW packages will be installed:
  Apache2-bin Apache2-data libjson-c2 php5-json php5-ssh2
The following packages have been kept back:
  libgd2-xpm-dev libssl-dev openssl
The following packages will be upgraded:
  Apache2 libssh2-php php-pear php5 php5-cli php5-common php5-curl php5-fpm php5-mcrypt php5-mysql
10 upgraded, 5 newly installed, 5 to remove and 3 not upgraded.
1 not fully installed or removed.
Need to get 375 kB/8007 kB of archives.
After this operation, 2457 kB disk space will be freed.
Do you want to continue [Y/n]? y
Get:1 http://ppa.launchpad.net/ondrej/php5/ubuntu/ precise/main php-pear all 5.5.30+dfsg-1+deb.sury.org~precise+1 [373 kB]
Get:2 http://ppa.launchpad.net/ondrej/php5/ubuntu/ precise/main php5 all 5.5.30+dfsg-1+deb.sury.org~precise+1 [1220 B]
Fetched 375 kB in 0s (1074 kB/s)
Perl: warning: Setting locale failed.
Perl: warning: Please check that your locale settings:
    LANGUAGE = "en_US:en",
    LC_ALL = (unset),
    LC_CTYPE = "UTF-8",
    LANG = "en_US.UTF-8"
    are supported and installed on your system.
Perl: warning: Falling back to the standard locale ("C").
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
(Reading database ... 96522 files and directories currently installed.)
Unpacking Apache2-bin (from .../Apache2-bin_2.4.16-4+deb.sury.org~precise+4_AMD64.deb) ...
dpkg: error processing /var/cache/apt/archives/Apache2-bin_2.4.16-4+deb.sury.org~precise+4_AMD64.deb (--unpack):
 trying to overwrite '/usr/share/man/man8/Apache2.8.gz', which is also in package Apache2.2-common 2.2.22-1ubuntu1.10
dpkg-deb (subprocess): subprocess data was killed by signal (Broken pipe)
dpkg-deb: error: subprocess <decompress> returned error exit status 2
Processing triggers for man-db ...
Errors were encountered while processing:
 /var/cache/apt/archives/Apache2-bin_2.4.16-4+deb.sury.org~precise+4_AMD64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
2
hpb

まず、パッケージApache2.2-commonを削除する必要があります

Sudo apt-get remove Apache2.2-common

pPA ppa:ondrej/php5を使用する前に、おそらくもう少し。


このようなエラーメッセージが表示される場合

trying to overwrite '/usr/share/man/man8/Apache2.8.gz', which is also in package Apache2.2-common 2.2.22-1ubuntu1.10

which is also in packageとバージョンの間の名前のパッケージを削除します。 2.2.22-1ubuntu1.10

1
A.B.