Skip to content
Home » Installing and removing Software in Linux

Installing and removing Software in Linux

Managing Packages & Users: Installing and Removing Software in Linux


1. Introduction

In Linux, software is managed using packages. A package is a bundle that contains:

  • Program files
  • Libraries
  • Configuration files
  • Documentation

Linux uses package management systems to install, update, upgrade, and remove software safely and efficiently. This is a key responsibility of a system administrator.


2. Why Package Management is Important

  • Automatic dependency handling
  • Secure software installation
  • Easy updates and upgrades
  • Clean removal of software
  • Centralized software control

3. Types of Package Management Systems

1. Debian-Based Systems

Examples:

  • Ubuntu
  • Debian
  • Linux Mint

Package format: .deb
Package manager: apt


2. Red Hat–Based Systems

Examples:

  • RHEL
  • CentOS
  • AlmaLinux
  • Rocky Linux

Package format: .rpm
Package managers: yum, dnf


4. Installing Software in Linux


4.1 Updating Package Repository (First Step)

Debian / Ubuntu

sudo apt update

RHEL / CentOS

sudo yum update

4.2 Installing Software Packages

Using apt

sudo apt install apache2

Using yum / dnf

sudo yum install httpd
sudo dnf install httpd

📌 Automatically installs required dependencies.


4.3 Installing from Local Package File

.deb Package

sudo dpkg -i package.deb

.rpm Package

sudo rpm -ivh package.rpm

5. Removing Software in Linux


5.1 Remove Package (Keep Config Files)

Debian

sudo apt remove apache2

RHEL

sudo yum remove httpd

5.2 Remove Package Completely (With Config Files)

sudo apt purge apache2

5.3 Remove Unused Dependencies

sudo apt autoremove

6. Searching and Viewing Packages

Search Package

apt search nginx

Package Information

apt show nginx

List Installed Packages

dpkg -l
rpm -qa

7. Upgrading Software

Upgrade All Packages

sudo apt upgrade
sudo yum upgrade

8. Package Repositories

Repositories are online software sources.

  • Official repositories
  • Third-party repositories
  • Local repositories

📌 Managed in:

  • /etc/apt/sources.list
  • /etc/yum.repos.d/

9. Managing Software Permissions (User Role)

  • Only root or sudo users can install/remove software
  • Normal users cannot modify system packages
  • Uses sudo for controlled access

10. Role of Users in Package Management

User TypePermission
RootFull package control
Sudo userInstall/remove software
Normal userNo package access

11. Real-World Example

Installing a web server:

sudo apt install apache2
sudo systemctl start apache2
sudo systemctl enable apache2

Removing it:

sudo apt remove apache2

12. Advantages of Linux Package Management

  • Secure & verified software
  • No manual dependency tracking
  • Faster installation
  • Clean uninstall
  • Ideal for servers

13. Summary Table (Exam-Friendly)

TaskDebian/UbuntuRHEL/CentOS
Update repoapt updateyum update
Installapt installyum install
Removeapt removeyum remove
Upgradeapt upgradeyum upgrade

14. Conclusion

Linux package management provides a powerful, secure, and efficient method for installing and removing software. With strict user control and automatic dependency handling, Linux ensures system stability and security, especially in multi-user and server environments.