
我正在嘗試安裝 apache2-bin,因為我無法對遺失或損壞的配置重新啟動 apache2。我的網站已關閉,或者在 apache2 不運行的情況下無法正確重定向。所以當我嘗試安裝時出現此錯誤:
The following NEW packages will be installed:
apache2-bin
0 upgraded, 1 newly installed, 0 to remove and 12 not upgraded.
Need to get 0 B/1067 kB of archives.
After this operation, 3979 kB of additional disk space will be used.
(Reading database ... 106699 files and directories currently installed.)
Preparing to unpack .../apache2-bin_2.4.23-1+deb.sury.org~trusty+1_amd64.deb ...
Unpacking apache2-bin (2.4.23-1+deb.sury.org~trusty+1) ...
dpkg: error processing archive /var/cache/apt/archives/apache2-bin_2.4.23-1+deb.sury.org~trusty+1_amd64.deb (--unpack):
trying to overwrite '/usr/sbin/apache2', which is also in package apache2-mpm-worker 2.2.22-1ubuntu1.11
dpkg-deb: error: subprocess paste was killed by signal (Broken pipe)
Errors were encountered while processing:
/var/cache/apt/archives/apache2-bin_2.4.23-1+deb.sury.org~trusty+1_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)***
答案1
此問題已透過以下回應解決:
第一的:
sudo apt-get --purge remove apache2
sudo apt-get autoremove
然後安裝 apache2 就是這麼簡單:
sudo apt-get install apache2
sudo /etc/init.d/apache2 restart
要測試它:
山貓”http://localhost」