我正在尝试卸载 apache2 使用apt-get purge apache2
它显示这个
root@indrajit-MacBookPro:/home/indrajit# apt-get purge apache2
Reading package lists... Done
Building dependency tree
Reading state information... Done
You might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies:
apache2-suexec : Depends: apache2.2-common but it is not going to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).
尝试运行 apt-get -f install
,但也失败了。这是输出。
root@indrajit-MacBookPro:/home/indrajit# apt-get -f install
Reading package lists... Done
Building dependency tree
Reading state information... Done
Correcting dependencies... Done
The following packages were automatically installed and are no longer required:
apache2-data gstreamer0.10-gconf gstreamer0.10-plugins-good
gstreamer0.10-pulseaudio gstreamer0.10-x libcdaudio1 libdirectfb-1.2-9
libenca0 libmpcdec6 libslv2-9 linux-headers-4.4.0-31
linux-headers-4.4.0-31-generic linux-headers-4.4.0-71
linux-headers-4.4.0-71-generic linux-image-4.4.0-31-generic
linux-image-4.4.0-71-generic linux-image-extra-4.4.0-31-generic
linux-image-extra-4.4.0-71-generic snap-confine
Use 'sudo apt autoremove' to remove them.
The following additional packages will be installed:
apache2.2-bin apache2.2-common
Suggested packages:
apache2-doc
The following NEW packages will be installed:
apache2.2-bin apache2.2-common
0 upgraded, 2 newly installed, 0 to remove and 616 not upgraded.
2 not fully installed or removed.
Need to get 0 B/1,572 kB of archives.
After this operation, 4,512 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
(Reading database ... 301525 files and directories currently installed.)
Preparing to unpack .../apache2.2-bin_2.2.22-1ubuntu1.11_amd64.deb ...
Unpacking apache2.2-bin (2.2.22-1ubuntu1.11) ...
dpkg: error processing archive /var/cache/apt/archives/apache2.2-bin_2.2.22-1ubuntu1.11_amd64.deb (--unpack):
trying to overwrite '/usr/lib/apache2/modules/mod_authnz_ldap.so', which is also in package apache2-bin 2.4.18-2ubuntu3.8
dpkg-deb: error: subprocess paste was killed by signal (Broken pipe)
Preparing to unpack .../apache2.2-common_2.2.22-1ubuntu1.11_amd64.deb ...
Unpacking apache2.2-common (2.2.22-1ubuntu1.11) ...
dpkg: error processing archive /var/cache/apt/archives/apache2.2-common_2.2.22-1ubuntu1.11_amd64.deb (--unpack):
trying to overwrite '/usr/share/apport/package-hooks/apache2.py', which is also in package apache2-bin 2.4.18-2ubuntu3.8
dpkg-deb: error: subprocess paste was killed by signal (Broken pipe)
Processing triggers for systemd (229-4ubuntu17) ...
Processing triggers for ureadahead (0.100.0-19) ...
Processing triggers for ufw (0.35-0ubuntu2) ...
Errors were encountered while processing:
/var/cache/apt/archives/apache2.2-bin_2.2.22-1ubuntu1.11_amd64.deb
/var/cache/apt/archives/apache2.2-common_2.2.22-1ubuntu1.11_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
但当我尝试定位 apache2 时它显示
root@indrajit-MacBookPro:/home/indrajit# which apache2
/usr/sbin/apache2
如何卸载它。它确实需要。谢谢你的帮助
答案1
正如命令中提到的,我通过卸载解决了该问题libapache2-mod-fastcgi通过apt-get purge libapache2-mod-fastcgi
和apache2-suexec通过apt-get purge apache2-suexec
. finally
apt-get purge apache2