Package Management
In Linux, you rarely download .exe files from websites. Instead, software is managed through Packages and installed via Package Managers from central Repositories.
1. Core Concepts
What is a Package?
A package is a compressed archive containing all the files, metadata, and instructions needed to install a software project.
- .deb: Used by Debian and Ubuntu.
- .rpm: Used by RedHat, CentOS, and Fedora.
How Repositories Work
A repository is a server that hosts thousands of packages. Your package manager (the client) connects to these repositories (the servers) to search for and download software.
2. APT (Advanced Package Tool)
Standard for Debian, Ubuntu, and Linux Mint.
| Command | Action |
|---|---|
sudo apt update | Update the local list of available packages (Sync with server). |
sudo apt upgrade | Upgrade all installed packages to their newest versions. |
sudo apt install <pkg> | Install a new software package. |
sudo apt remove <pkg> | Remove a package (keeps config files). |
sudo apt purge <pkg> | Remove a package and its configuration files. |
apt search <keyword> | Search for a package in the repositories. |
3. YUM / DNF
Standard for RedHat, CentOS, Fedora, and Amazon Linux.
| Command | Action |
|---|---|
sudo yum install <pkg> | Install a new package. |
sudo yum update | Update all packages. |
sudo yum remove <pkg> | Remove a package. |
yum search <keyword> | Search for a package. |
Summary Comparison
| Feature | Debian / Ubuntu | RedHat / CentOS |
|---|---|---|
| Package Extension | .deb | .rpm |
| Low-level Tool | dpkg | rpm |
| High-level Tool | apt / apt-get | yum / dnf |
[!IMPORTANT] Update First! Always run
sudo apt updatebefore installing a new package to ensure you are getting the latest version available on the server.