How to Remove Systemd Services on Linux

Take Your Linux Skills to the Next Level All courses, certifications, ad-free articles & community — from $8/mo
Join Root →
Ad-free access to all premium articles
Access to all courses: Learn Linux, AI for Linux, Bash Scripting, Ubuntu Handbook, Golang and more.
Access to Linux certifications (RHCSA, RHCE, LFCS and LFCA)
Access new courses on release
Get access to weekly newsletter
Priority help in comments
Private Telegram community
Connect with the Linux community
From $8/mo · or $59/yr billed annually · Cancel anytime

Systemd is a system and service manager for Linux operating systems, providing a standard process for controlling what services start when the system boots.

Sometimes, you may need to remove a systemd service for various reasons, such as it being no longer necessary, conflicting with other services, or you simply want to clean up your system.

Systemd uses unit files to manage services, which are typically located in /etc/systemd/system/ or /lib/systemd/system/. These unit files define how the service should start, stop, and behave.

Removing a systemd service involves stopping the service, disabling it so it doesn’t start on boot, and then deleting its unit file.

This guide will walk you through the steps to remove systemd services in Linux.

Identifying Systemd Service

First, you need to identify the exact name of the service you wish to remove by listing all the active services using the following command.

systemctl list-units --type=service

Or, if you know the service name or a part of it, you can use.

systemctl | grep <service-name>
List Active Systemd Services
List Active Systemd Services

Stopping and Disabling Systemd Service

Before removing a service, it’s important to stop it if it is currently running by using the following systemctl command.

sudo systemctl stop <service-name>

To prevent the service from starting automatically on boot, you need to disable it.

sudo systemctl disable <service-name>

Removing Systemd Service

Finally, remove the service’s unit file from the system, which is usually located in /etc/systemd/system/ or /lib/systemd/system/ using the rm command to delete the file.

sudo rm /etc/systemd/system/<service-name>.service

Or, if it’s located in the other directory.

sudo rm /lib/systemd/system/<service-name>.service

After removing the unit file, reload the systemd configuration to reflect the changes.

sudo systemctl daemon-reload
Conclusion

Removing systemd services on Linux involves stopping the service, disabling it from starting on boot, and deleting its unit file.

Always verify that the service is no longer needed and that you have the necessary permissions to perform these actions.

Root Plan
Premium Linux Education for Serious Learners

Take Your Linux Skills to the Next Level

Root members get full access to every course, certification prep track, and a growing library of hands-on Linux content — with new courses added every month.

What You Get
Ad-free access to all premium articles
Access to all courses: Learn Linux, AI for Linux, Bash Scripting, Ubuntu Handbook, Golang and more.
Access to Linux certifications (RHCSA, RHCE, LFCS and LFCA)
Access new courses on release
Get access to weekly newsletter
Priority help in comments
Private Telegram community
Connect with the Linux community
Ravi Saive
I'm Ravi Saive, an award-winning entrepreneur and founder of several successful 5-figure online businesses, including TecMint.com, GeeksMint.com, UbuntuMint.com, and the premium learning hub Pro.Tecmint.com.

Each tutorial at TecMint is created by a team of experienced Linux system administrators so that it meets our high-quality standards.

Join the TecMint Weekly Newsletter (More Than 156,129 Linux Enthusiasts Have Subscribed)
Was this article helpful? Please add a comment or buy me a coffee to show your appreciation.

Got Something to Say? Join the Discussion...

Thank you for taking the time to share your thoughts with us. We appreciate your decision to leave a comment and value your contribution to the discussion. It's important to note that we moderate all comments in accordance with our comment policy to ensure a respectful and constructive conversation.

Rest assured that your email address will remain private and will not be published or shared with anyone. We prioritize the privacy and security of our users.

Root Plan Premium Linux Education for Serious Learners

Before You Go - Upgrade Your Linux Skills

Root members get everything in one place, with new courses added every month.

What You Get
Ad-free access to all premium articles
Access to all courses: Learn Linux, AI for Linux, Bash Scripting, Ubuntu Handbook, Golang and more.
Linux certifications: RHCSA, RHCE, LFCS and LFCA
Access new courses on release
Weekly newsletter, priority support & Telegram community
Join Root Today and Start Learning Linux the Right Way
Structured courses, certification prep, and a community of Linux professionals - all in one membership.
Join Root Plan →
$8/mo · or $59/yr billed annually