linux install packages

Linux Basics: How to Install and Remove Software Packages

Install and remove packages using DNF,Apt,Yum

Managing software is a critical skill for any Linux user. While package managers that handle software installation and removal can vary across different Linux distributions, a few stand out as the most common. This article will cover apt, the package manager for Debian-based systems, and dnf, the latest package manager for RHEL-based systems.

Using the apt Package Manager in Debian-based Distributions

apt (Advanced Package Tool) is the package manager for Debian-based systems, including Ubuntu.

Installing Software

To install a software package with apt, you use the apt install command followed by the package name. For instance, to install the nano text editor, you’d run:

sudo apt install nano

Removing Software

To remove a package, use the apt remove command followed by the package name. This command does not remove the configuration files. To also remove those, use apt purge instead.

sudo apt remove nano

# or

sudo apt purge nano

Using the dnf Package Manager in RHEL-based Distributions

dnf (Dandified YUM) is the package manager for the latest RHEL-based systems, including CentOS, AlmaLinux, and Rocky Linux. It’s the next-generation version of yum, offering improved performance and resolving dependency issues more efficiently.

Installing Software

To install a software package with dnf, you use the dnf install command:

sudo dnf install nano

Removing Software

And to remove a package, use the dnf remove command:

sudo dnf remove nano

Some older systems still might use the “Yum” command.

Sudo yum install nano
Sudo yum remove nano

Conclusion

This guide provided an introduction to the installation and removal of software packages in Linux using the apt and dnf package managers. As you gain more experience with these commands, you’ll find software management on your Linux system to be a more efficient process.

Remember, always back up your data before making significant changes to your system, like installing or removing software. This practice is especially useful in the unlikely event of an unexpected issue. Happy Linuxing!


Posted

in

,

by

Tags: