systemctl not working on a fresh Ubuntu 18.04 build

fresh ubuntu 18.04 build created new user and switched to that user installed apache2, php, mysql, essentials using sudo apt-get

Works: sudo /etc/init.d/apache2 restart sudo systemctl status apache2

Does not Work: sudo systemctl restart apache2 after I hit enter nothing is executed, just another standard line(user@server:~$)

Please advise. Thanks.

Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.


It is normal for the systemctl command not to provide you with any output after executing a restart command.

To check if the restart was successful, what you could do is run:

echo $?

This would provide you with the exit code of the previous command. If you get a 0 it means that it was successful, if you get 1 then something is wrong and you need to run the systemctl status command to get some more information.

Hope that this helps! Regards, Bobby