How To Install systemctl on Ubuntu
Posted on April 1, 2023  (Last modified on May 20, 2023 )
2 minutes • 409 words
Introduction
In this tutorial we learn how to install systemctl on Ubuntu.
What is systemctl
systemctl is:
“systemctl” is a replacement command to control system daemons without systemd. “systemctl” is useful in application containers where systemd is not available to start/stop services.
This script can also be run as init of an application container (i.e. the main “CMD” on PID 1) where it will automatically bring up all enabled services in the “multi-user.target” and where it will reap all zombies from background processes in the container. When stopping such a container it will also bring down all configured services correctly before exit.
There are three methods to install systemctl on Ubuntu. We can use apt-get, apt and aptitude. In the following sections we will describe each method. You can choose one of them.
Install systemctl Using apt-get
Update apt database with apt-get using the following command.
sudo apt-get update
After updating apt database, We can install systemctl using apt-get by running the following command:
sudo apt-get -y install systemctl
Install systemctl Using apt
Update apt database with apt using the following command.
sudo apt update
After updating apt database, We can install systemctl using apt by running the following command:
sudo apt -y install systemctl
Install systemctl Using aptitude
If you want to follow this method, you might need to install aptitude first since aptitude is usually not installed by default on Ubuntu. Update apt database with aptitude using the following command.
sudo aptitude update
After updating apt database, We can install systemctl using aptitude by running the following command:
sudo aptitude -y install systemctl
How To Uninstall systemctl on Ubuntu
To uninstall only the systemctl package we can use the following command:
sudo apt-get remove systemctl
Uninstall systemctl And Its Dependencies
To uninstall systemctl and its dependencies that are no longer needed by Ubuntu, we can use the command below:
sudo apt-get -y autoremove systemctl
Remove systemctl Configurations and Data
To remove systemctl configuration and data from Ubuntu we can use the following command:
sudo apt-get -y purge systemctl
Remove systemctl configuration, data, and all of its dependencies
We can use the following command to remove systemctl configurations, data and all of its dependencies, we can use the following command:
sudo apt-get -y autoremove --purge systemctl
Dependencies
systemctl have the following dependencies:
References
Summary
In this tutorial we learn how to install systemctl package on Ubuntu using different package management tools: apt, apt-get and aptitude.