Tuesday, May 7, 2024
 Popular · Latest · Hot · Upcoming
203
rated 0 times [  203] [ 0]  / answers: 1 / hits: 955901  / 2 Years ago, thu, september 29, 2022, 5:18:51

It seems a simple apt-get remove apache2 does not completely remove apache2 as I can still see it on one of the processes when running top. How does one remove apache2 completely on his ubuntu server?



It's not removed indeed:



~# which apache2
/usr/sbin/apache2
~# whereis apache2
apache2: /usr/sbin/apache2 /etc/apache2 /usr/lib/apache2 /usr/share/apache2 /usr/share/man/man8/apache2.8.gz


But when I do apt-get remove apache2 again:



# apt-get remove apache2
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package apache2 is not installed, so not removed
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

More From » apt

 Answers
5

apache2 is a metapackage that just selects other packages. If you installed apache by installing that package, you just need to run this to clean up the automatically selected packages:



sudo apt autoremove


If that doesn't work, you might have installed one of the dependents manually. You can target all the apache2- packages from space and nuke the lot:



sudo apt remove apache2.*


For future reference, to find out which package a binary is from, you can run this:



dpkg -S `which apache2`


I'd expect that to come back with apache2.2-bin (at the time of writing).


[#36111] Friday, September 30, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
attagjump

Total Points: 272
Total Questions: 127
Total Answers: 124

Location: Taiwan
Member since Fri, Sep 17, 2021
3 Years ago
;