0% found this document useful (0 votes)
25 views10 pages

Ubuntu 18

Uploaded by

nishanrai530
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
25 views10 pages

Ubuntu 18

Uploaded by

nishanrai530
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 10

Yum is a package manager for Linux systems that rose to prominence for being the

default package management system for Red Hat Enterprise Linux and its derivative
distributions for many years. It has since been replaced by dnf package manager,
which is a fork of yum that has been developed to be faster, more efficient, and have
better documentation. Modern Linux distros only use yum as a compatibility layer for
dnf, in order to accomodate legacy Bash scripts and old commands.

Most likely, you ended up on this page because you attempted to execute a yum
command that you found online and got an error. But this is because you are not using
a Linux distro that utilizes the yum package manager. Find out what your default
package manager is (e.g., Ubuntu uses apt, and Arch uses pacman, etc), and instead
use that package manager to install the software.

In this tutorial, we will go over the step by step instructions to install yum and dnf on
on all major Linux distros. Then, we will go over a few commands and examples to
help you get started installing packages with your new package manager.

Ubuntu 18.04 and Debian 10


Slightly older versions of Debian and Ubuntu can still install and use yum, although it
is recommended that you opt for dnf instead. To install yum on Ubuntu 18.04, Debian
10, and older versions of the operating systems:

$ sudo apt update

$ sudo apt install yum

Or to install dnf:

$ sudo apt install dnf

Ubuntu and Debian


On modern versions of Ubuntu, Debian, and some other derivatives, you can install
the dnf package manager:

$ sudo apt update

$ sudo apt install dnf


You can also install a yum compatibility layer if necessary:

$ sudo apt install nextgen-yum4

This will also install dnf as a dependency (if not already installed) and gives access to
the yum4 command. This just takes old yum commands and sends them straight to dnf
for you.

Arch Linux and Manjaro


Yum can be installed from the Arch User Repository. The simplest way is to use an
AUR helper like yay (see the linked tutorial if you need help installing yay):

$ yay -s yum

Or just use Pacman if you want to install dnf instead:

$ sudo pacman -S dnf

yum / dnf usage examples


Now that you have yum and/or dnf installed on your system, let’s see how to use it.
We will be using dnf commands in the examples below, but you can substitute in
the yum command or yum4 command if you installed one of the yum packages:

1. To search for a package in yum/dnf:

2. $ dnf search [package]

3. To install a package in yum/dnf:

4. $ sudo dnf install [package]


5. To upgrade all installed packages in yum/dnf:

6. $ sudo dnf update

7. To remove a package in yum/dnf:

8. $ sudo dnf remove [package]

There are plenty of other dnf and yum commands, and you can view them in the
manual:

$ man dnf

and

$ man yum

How to uninstall packages from Linux?


search in chrome

Example 1: Uninstall a package using apt-get


In this example, we will remove GIMP, a graphics software that was installed
with the help of apt-get.
Step 1: To list all the apt-get packages, enter the following command in
Terminal:
dpkg --list
As you can see, gimp is installed in the output
Step 2: Now run the following command to uninstall any package. Here the
package is GIMP.
sudo apt-get --purge remove gimp
The output is as follows:
Example 2: Uninstall the SNAP package
Snap packages are very popular, and in this example, we again have GIMP
as a snap package to uninstall.
Step 1: Run the following command to check the exact name
snap list
The gimp software is highlighted in the output
Step 2: Run the following command to remove it.
sudo snap remove gimp
The output is as follows:
Example 3: Using autoremove command
We will uninstall the GIMP software as an apt-get package. We may not
always want to uninstall the configuration file.
Step 1: So run the following command to remove it.
sudo apt-get remove gimp
The output is as follows:
Step 2: And then if you want to remove unnecessary packages that were
required for gimp exclusively to be not present, then run the following
command.
sudo apt-get autoremove
The output is as follows
Step 3: Finally, run the following command so that everything is fine
sudo apt-get clean
.
RPM Package Manager (RPM), originally called the Red Hat Package Manager, is an open
source program for installing, uninstalling and managing software packages in Linux. RPM
was developed on the basis of the Linux Standard Base (LSB).

1. Install, update, or remove RPMs as follows:

 To install an RPM from the yum repository, run the following command:
 # yum install rpm_name

 To update a specific RPM, run the following command:


 # yum update rpm_name

 To update all the RPMs, run the following command:


 # yum update

 To remove an RPM, run the following command:


 # yum remove rpm_name

For the yum update or yum remove command, if you specify an RPM that is in the
exclusion list defined earlier, the command will fail.

You might also like