Installing and Uninstalling softwares
PACKAGE MANAGEMENT
Chapter : The Linux Shell 79
Installing and Uninstalling Softwares
• What is a Package?
– Is a file that includes all the components needed to install
software on a Linux system, such as :
• Program binaries : The actual compiled software files.
• Metadata: Information about the package (version,
dependencies, description)
• Configuration files: Default settings and setup details.
• Why is it useful ?
– Packages make software easy to install, update, and
manage.
Chapter : The Linux Shell 80
Installing and Uninstalling Softwares
• Common Package Formats
Format Used By Description
Used by Debian-based
.deb Debian, Ubuntu, Linux Mint
systems. Managed using apt.
Used by Red Hat-based
.rpm Red Hat, Fedora, CentOS systems. Managed with yum
or dnf.
A compressed archive. May
.tar.xz Arch Linux and others not include dependency info.
Requires manual steps.
Chapter : The Linux Shell 81
Installing and Uninstalling Softwares
• Package Management
– Refers to the system of tools used to install, update, and
remove software on a Linux system.
– It automates:
• Downloading packages
• Installing packages
• Updating software
• Resolving and installing dependencies
• Removing software cleanly
– Each Linux distribution has its own package manager.
• Installing and uninstalling applications in Linux is
handled through the package management system.
Chapter : The Linux Shell 82
Installing and Uninstalling Softwares
• Package Management System
– When installing software
• The package manager downloads the required package.
• It reads the metadata to understand dependencies and
configurations.
• It installs the software and ensures everything works
properly.
Chapter : The Linux Shell 83
Installing and Uninstalling Softwares
• Package Management System
– When Uninstalling Software
• The package manager removes the software files.
• Optionally removes configuration files and unused
dependencies.
Chapter : The Linux Shell 84
Installing and Uninstalling Softwares
• Popular Package Management System
Package Manager Used In Format
APT Debian, Ubuntu .deb
YUM/DNF Fedora, CentOS, RHEL .rpm
Pacman Arch Linux .tar.xz
Others
Chapter : The Linux Shell 85
Installing and Uninstalling Softwares
• APT (Advanced Package Tool)
– Common Commands
• $ sudo apt update – Updates the package list.
• $ sudo apt install <package> – Installs a new package.
– Ex. $ sudo apt install firefox
• $ sudo apt upgrade – Upgrades installed packages.
– Ex. $ sudo apt upgrade firefox
• $ sudo apt remove <package> – Removes a package.
– Ex. $ sudo apt remove firefox
• $ apt-cache search <term> – Searches for packages.
– Ex. $ sudo apt search apache2
• $ sudo apt show firefox – Shows inf on a package
Chapter : The Linux Shell 86