0

When trying to repair a failed installation of apache2, I deleted usr/sbin/apache2 thinking a reinstall would replace it. It did not and I get the following error when trying to start apache2:

service: /usr/sbin/apachectl: 174: /usr/sbin/apachectl: /usr/sbin/apache2: not found.
0

/usr/sbin/apache2 is provided by apache2-bin. apache2-bin is a dependency of the apache2 package, so apache2 will not work properly without it. Open the terminal and type:

sudo apt install --reinstall apache2-bin   
sudo service apache2 start  
  • A stronger way to reinstall apache2-bin is sudo dpkg --remove --force-remove-reinstreq apache2-bin – karel Sep 26 '18 at 0:29
  • @RickKern If this answered your question, you can mark this answer as accepted by clicking the gray check mark beside the answer to change its color to green. – karel Sep 26 '18 at 1:17
0

First, you need to find the package the file belongs to:

dpkg -S /usr/sbin/apache2

Now, let's say it's apache2-bin, so we run:

sudo apt install --reinstall apache2-bin

Afterwards, the file should be restored.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.