In the following guidance, you will find information on managing programs and services on Fedora Linux. The below guidance is generally similar across Linux distributions, exact commands differ but the processes are largely the same.
## Package Management
Fedora Linux uses a command line (*CLI*) program called DNF to handle package management. As this deals with system packages it must be run using the `sudo` command to escalate user privileges.
### System Update
In order to update your system, issue the following command in your terminal.
```bash
sudo dnf update
```
This automatically checks for latest updates for both the operating system *and* your installed packages.
### Searching For Programs
When looking for a specific piece of software, you can search for it use `dnf`:
```bash
sudo dnf search firefox
```
This command will return the exact package name for the program that you are looking for, allowing you to the install it.
### Software Installation
Once you have the name of the package(s) that you wish to install, you can issue the `dnf install` command:
```bash
sudo dnf install firefox
```
For more than one package, you can list all packages separated by a space:
```bash
sudo dnf install firefox libreoffice virt-manager
```
### Software Removal
If you wish to uninstall previously installed software, issue the `dnf remove` command:
```bash
sudo dnf remove google-chrome
```
Like the install command, you can remove multiple packages at a time by separating them with a space:
```bash
sudo dnf remove google-chrome gnome-sudoku
```
*Caution:* Linux is very trusting of its user and will willing allow you to remove critical packages and files that can potentially break your system. Be careful!
## Service Management
Some applications have a background service or **daemon** that can be configured to run at boot, or manually started when needed. For this example, I will be using `libvirtd`, the virtualisation service.
Services are controlled using the `systemctl` command, as this is a system administration command, you will need to use `sudo` as well.
There are five main options of systemctl that we will look at:
* `status` - Check the status of the service.
* `start` - Start the service once.
* `stop` - Stop the service.
* `enable` - Enable the service to run at boot time.
* `disable` - Disable the service from running at boot time.
The syntax for systemctl is:
```bash
sudo systemctl [OPTION] [ServiceName]
```
### Status
To check if a service is currently running, view service log files, or to see if a service has crashed you can use the status flag:
```bash
sudo systemctl status libvirtd
```
If a service is not behaving as expected, this is a good starting place for troubleshooting.
### Start
For example, once you have installed `libvirtd` it must be started before you can run a virtual machine:
```bash
sudo systemctl start libvirtd
```
### Stop
To stop a currently running service:
```bash
sudo systemctl stop libvirtd
```
### Enable
If you use virtual machines regularly, having this service start at boot would be a good idea:
```bash
sudo systemctl enable libvirtd
```
*Note:* Enable only sets the service to start on the next reboot, if you want to both start the service AND have it run at boot, you can use the --now flag:
```bash
sudo systemctl enable --now libvirtd
```
### Disable
If you no longer want a service to start a boot time, use the disable command:
```bash
sudo systemctl disable libvirtd
```
*Note:* This does not stop the service, it only disables it from starting at boot.
## Additional Information
The majority of mainstream Linux distributions use SystemD as the service manager for the operating, so these commands will work on most OSes. Including: Ubuntu, Debian, Arch Linux, SteamOS, Linux Mint, and many more.
For more advanced systemctl command, there is a great article on DigitalOcean:
[Digital Ocean Managing Service Guide](https://www.digitalocean.com/community/tutorials/how-to-use-systemctl-to-manage-systemd-services-and-units)