---
title: "Introduction to Linux Package Managers: Apt vs. Yum"
description: "Package managers are essential for managing software in Linux, as they allow users to install, update, remove, and search for packages quickly. The two primary package managers for Linux are **Apt** (Advanced Package Tool) and **Yum** (Yellowdog Updater, Modified). They…"
url: "https://truehost.com/support/knowledge-base/introduction-to-linux-package-managers-apt-vs-yum/"
updated: "2024-10-29"
category: Cloud servers in Kenya
---

# Introduction to Linux Package Managers: Apt vs. Yum

Package managers are essential for managing software in Linux, as they allow users to install, update, remove, and search for packages quickly. The two primary package managers for Linux are **Apt** (Advanced Package Tool) and **Yum** (Yellowdog Updater, Modified).

They are used on different systems; Debian-based distributions like **Ubuntu** use **Apt**, while Red Hat-based distributions like **Almalinux**, CentOS, Fedora, and RHEL use **Yum**.

While both serve similar purposes, they have different commands, configurations, and handling methods. Here’s an in-depth look at each, along with a comparison to help you understand the key differences.

### Understanding Apt (Advanced Package Tool)

**Apt** is the package management system used by **Debian** and its derivatives, including **Ubuntu** and **Linux Mint**. Apt interacts with the **dpkg** (Debian Package) system but adds a layer of functionality, including dependency resolution, making it easier to manage packages.

#### Key Features of Apt

1. **Dependency Resolution**: Apt automatically resolves and installs required dependencies.
2. **Repositories**: Packages are organized in repositories that Apt pulls from, like the Ubuntu repositories or PPA (Personal Package Archives).
3. **User-Friendly Commands**: Apt simplifies package management commands compared to the older `dpkg` commands.
4. **Powerful Tools for Scripted Use**: Apt is equipped with powerful features for automation and scripting.

#### Basic Apt Commands

- **Update Package Lists**:

```
sudo apt update
```

- **Install a Package**:

```
sudo apt install [package-name]
```

![](https://truehost.com/support/wp-content/uploads/2024/10/image-607.png)

- **Upgrade Installed Packages**:

```
sudo apt upgrade
```

- **Remove a Package**:

```
sudo apt remove [package-name]
```

- **List Installed Packages**:

```
apt list --installed
```

![](https://truehost.com/support/wp-content/uploads/2024/10/image-608-1024x272.png)

### Understanding Yum (Yellowdog Updater, Modified)

**Yum** is the default package manager for **Red Hat-based** systems like **CentOS**, **Fedora**, and **RHEL**. Yum manages **RPM (Red Hat Package Manager)** packages and resolves dependencies, making it easier to maintain packages across these distributions.

#### Key Features of Yum

1. **Dependency Management**: Yum installs packages with dependencies, ensuring no required component is missed.
2. **Central Repositories**: Yum relies on pre-configured repositories for package retrieval and installation.
3. **Automatic Updates**: Yum has options for setting up automatic package updates.
4. **History and Rollback**: Yum allows users to view the installation history and roll back changes if needed.

#### Basic Yum Commands

- **Update Repository Lists**:

```
sudo yum check-update
```

![](https://truehost.com/support/wp-content/uploads/2024/10/image-609.png)

- **Install a Package**:

```
sudo yum install [package-name]
```

- **Update All Packages**:

```
sudo yum update
```

- **Remove a Package**:

```
sudo yum remove [package-name]
```

![](https://truehost.com/support/wp-content/uploads/2024/10/image-610.png)

- **List Installed Packages**:

```
yum list installed
```

![](https://truehost.com/support/wp-content/uploads/2024/10/image-611-1024x351.png)

### Key Differences Between Apt and Yum

|  | Apt (Debian-Based) | Yum (Red Hat-Based) |
| --- | --- | --- |
| **Distribution** | Debian, Ubuntu, Linux Mint | RHEL, CentOS, Fedora |
| **Package Format** | .deb | .rpm |
| **Repositories** | Uses Debian and Ubuntu repos, can add PPAs | Uses Red Hat and CentOS repos |
| **Dependency Management** | Automatic | Automatic |
| **Command Structure** | Simplified and intuitive | Flexible with history/rollback options |
| **Rollback Capability** | No native rollback, manual downgrade | Has history and rollback features |

### **Which Should You Use?**

Your choice of package manager will be dictated by your Linux distribution. If you’re using a **Debian-based** system like Ubuntu, you’ll use **Apt**. For **Red Hat-based** systems like CentOS, **Yum** is the standard. Both provide reliable, secure ways to manage your software packages, and once you’re familiar with one, switching to the other is straightforward.

Apt and Yum are powerful tools for managing software on Linux systems, each tailored to the architecture of its supported distributions. While their command syntax and extra features differ, both make package management easy, efficient, and secure, helping you keep your system up-to-date and optimized
