• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

Swift Guides

Howtos, Tutorials & Guides

  • Home
  • Servers
  • Applications
  • Opinions
  • Search
You are here: Home / Servers / How to Install and Remove Packages from Rocky or Alma Linux?

How to Install and Remove Packages from Rocky or Alma Linux?

June 6, 2024 by Sourabh Verma

Rocky or Alma Linux are the best Linux distros for servers. They offer both stability and reliability for a wide range of software. Managing packages is the most essential part when it comes to Linux. Packages are the collection of libraries, applications, and other components that make it functional.

Install-and-Remove-Packages-from-Rocky-or-Alma-Linux
Install-and-Remove-Packages-from-Rocky-or-Alma-Linux

In this article, we will learn how to install and remove packages from Rocky or Alma Linux

Rocky and Alma, Linux uses DNF (Dandified YUM) to manage packages. DNF is developed keeping performance in mind. It has the best algorithm to work with dependencies.

Prerequisites

Rocky or Alma Linux installed in the system with sudo or root user

Updating Package Information

In Linux, updating package information is the most important step before installing any package. If not done, you may experience errors like package not found.

You can check the list of available updates for your system using

$ sudo dnf check-update

To update, execute

$ sudo dnf update -y

Installing Packages

To install packages, you can follow “dnf install” syntax

$ sudo dnf install [Package-Name]

For example, you want to install PHP, execute the following command

$ sudo dnf install php

Removing Packages

To remove any package from Rocky or Alma Linux, you can follow the “dnf remove” syntax

$ sudo dnf remove [Package-Name]

For example, if you want to remove PHP, execute the following command

$ sudo dnf remove php

Removing Unnecessary Packages

To remove unnecessary packages, you can use “dnf autoremove” syntax. Autoremove syntax scans your system and lists out the packages that aren’t needed and have no dependencies. So, it is safe to remove them

$ sudo dnf autoremove

Execute the command and it will remove the packages automatically.

Category: Servers Tagged In: alma, rocky, Server

Like my work? Don't Forget to Share

Share on Facebook Share on Twitter Share on LinkedIn Share on Reddit Share on WhatsApp Share via Email

Hi, welcome to SwiftGuides! With over 12 years of experience in Linux, SysAdmin, databases, cloud computing, and other IT-related areas, I make sure publish easy-to-follow, 100% working tutorials. I hope you like my work. Thanks!

Reader Interactions

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Primary Sidebar

Stay With Us

Follow on Facebook Follow on Twitter Follow on LinkedIn Follow on Reddit Subscribe on YouTube Follow on Instagram

SwiftGuides: Howtos, Tutorials & Guides © 2025 ยท All Rights Reserved

  • Contact Us
  • Privacy Policy
  • Disclaimer