1

i am trying to uninstall apache2 using apt-get purge apache2 it is showing this

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).

Tried to run apt-get -f install and it is also failing.here is the output.

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)

but when i try locate apache2 it is showing

root@indrajit-MacBookPro:/home/indrajit# which apache2
/usr/sbin/apache2

how to uninstall that.its really needed.Thanks for your help

muru
  • 197,895
  • 55
  • 485
  • 740
  • you try to uninstall apache2 which includes removing apache2.2-common, but which itself is necessary for another package (apache2-suexec). So maybe try to remove that first: sudo apt remove apache2-suexec. Does that help? – pLumo May 23 '18 at 12:11
  • I guess you did some step before, otherwise, apache2 would have been removed without removing parts on which other packages depend. – pLumo May 23 '18 at 12:16
  • Related question here --> sudo dpkg --purge apache2-suexec apache2.2-bin apache2.2-common apache2 – pLumo May 23 '18 at 12:21
  • thnks for your help .yes i installed 'libapache2-mod-fastcgi' and 'apache-suexec.'after uninstalling all of them finally able to uninstall apache2. – indrajit guha May 23 '18 at 12:24
  • Did you install them with a third-party repository or manually? Please feel free to write an answer on how you managed to solve this for other people having the same question. – pLumo May 23 '18 at 12:27

1 Answers1

0

As mentioned in the command i solve the issue by uninstalling libapache2-mod-fastcgi via apt-get purge libapache2-mod-fastcgi and apache2-suexec via apt-get purge apache2-suexec. finally

apt-get purge apache2