Yum Command Tutorial With Examples For Linux Package Management Like Install, Update Remove

RSS
EMAIL
FACEBOOK
FACEBOOK
GOOGLE
GOOGLE
https://www.poftut.com/yum-command-tutorial-with-examples-for-linux-package-management-like-install-update-remove/
PINTEREST
PINTEREST
INSTAGRAM

Linux applications installed (generally) as packages. Packages contains required files like binary, configuration, database, data, graphic etc. All files packaged to one file named rpm. There is a lot of packages in fedora or other rpm based distribution to manage.

Keep in mind that there is also different version of packages like a1,a2,a3. Packages are named like wireshark-1.10.7-3.fc20.x86_64. Here wireshark is package real name as we know, 1.10.7-3 is the version number used in wireshark, fc20  shows that this packages used in fedora core 20 but it is not must you can use this packet if you supply dependencies of package, latest x86_64 means that this package includes 64 bit binaries and this is important because it will not work with 32 bit libraries or OS if you see noarch it means that there is no architecture specific binary. Do we look all of these things when installing applications? NO because a lot of work is done by yum rpm manager. Yum use rpm to make things more smooth and easy. So we just write package name  and it install it. So much talk is enough let’s action.

Install Package

Installing package is very easy you can add more packages with space delimiter. Here we will install wireshark core package and gcc which is a c compiler. If we want to install them without answering yes/no question we must provide -y between yum and install like yum -y install. Here yum resolves dependencies and show installation required packages. There is 9 required package.

Install Package
Install Package

Install Package From Specified Repository

As we will see below yum can use multiple repositories and the same package can be provided from multiple repositories. While installing this package we can specify specific repository like below.

Automatic Confirmation / Yes

While operating with yum commands for caution reasons confirmations exists. If we are confident what we do we simply provide -y parameter to accept all confirmation questions like below.

LEARN MORE  Yum Usage

Install Group Packages

If we want to install group which includes group of packages for similar targets like gnome desktop, kde desktop etc. we can use @ sign before package name

Install Group Packages
Install Group Packages

Search Package

To search packages with specific word use search. If you want to search all areas of package description use all parameter.

Search Package
Search Package

Search More Details

Name and summary matches only, use “search all” for everything.

Search More Details
Search More Details

List Packages

If you want to list all available packages use list option. But there may be a lot of output you can filter it with grep

List Packages
List Packages

Update Packages

To update packages use update. You can specify version if not it is updated to the latest. If not installed it is installed. To see any updatest available use check-update which outputs updated packages count. Upgrade is the same but looks for obsolete flag.

Update Packages
Update Packages

List Group Packages

Repositories provides packages. There can be more than one repository configured in a Linux system. Packages provided configured repositories can be listed like below.

List Group Packages
List Group Packages

List Installed Group Packages

There is an option to only list installed group packages

List Installed Group Packages
List Installed Group Packages

Remove Package

To remove packages use remove or erase which removes all files and dependencies.

Remove Package
Remove Package

Remove Group Packages

Group packages can be removed like a regular package. To remove group packages just provide groupremove like below.

Remove Group Packages
Remove Group Packages

Find Package Name With File Path

If you want to search a filename in packages use provides or whatprovides. This is very handy option for looking what file belongs to what package. Here we query etc/grub2.cfg and get results from different versions of grub.

Look Package Name
Look Package Name

Package Information

To get info about a package use info . Wireshark has two package for x64 and x86 which is shown i686. This will provide information like name, architecture,version,realease, size, repository, description, license

LEARN MORE  Linux Rpm Command With Examples

Package Information
Package Information

Clean Cache

To clean cache files and get more free space. We can use this command for every 1-2 months. This option has parameters but using all is most practical usage.

Clean Cache
Clean Cache

Yum Interactive Shell

Yum shell is used for batch or interactive command line if you specify file the yum commands in file are executed if not you will get a shell to run yum commands.

Yum Shell
Yum Shell

Reinstall Package

Installed packages can be installed again. This will reconfigure the package and clean the binaries and configuration of the package.

Reinstall Package
Reinstall Package

Downgrade Package

This is a rare situation. Packages can be downgraded which means installing older versions. If there is an application relies on old releases this feature can be used. To downgrade a package exact version must be exist configured repository.

List Package Dependencies

Dependency is the requirement to install a package. A package dependency is another packages like libraries, binaries, frameworks. The dependency of a package can be get by providing the package name like below.

List Package Dependencies
List Package Dependencies

List Enabled Repositories

Generally Linux systems are configured to use more than one repository. There is also popular repositories provided by third parties. All these repositories can be listed with repolist command.

List Repositories
List Repositories

List All Repositories

By default yum repolist command provides enabled repositories. There may be some repositories not enabled and not used. Providing all will list all enabled and not enabled repositories.

List All Repositories
List All Repositories

Print Detailed Repository Information

In previous example we have listed repositories. Details about these repositories can be listed with repoinfo command.

Print Detailed Repository Information
Print Detailed Repository Information

repoinfo provides repository information like repository id, name, status,revision, package count, size, mirrors, base url, expire and file name.

LEARN MORE  How To Avoid Not Signed Error For Yum

Yum Command History

Yum provides practical way to see history of yum with history parameter. To see yum history we can also look to the /var/log/yum.log for more detailed info. history command provides command id, command, issued date and time, action and changed package count.

History
History

Resume Transaction

Think about this while installing packages with yum the ssh connection is lost. What will happen can we resume from where we left? Yes.Some times there is a error or disrupt and you need to resume transaction

Resume Transaction
Resume Transaction

Yum Database Integrity Check

check command will check the status of the yum database. If it founds some corruption it will try to recover this.

Yum Configuration File

Generally yum configuration resides /etc/yum.conf and /etc/yum.conf.d and these paths are used as default. If you want to specify different yum configuration file use -c option

Yum Configuration File
Yum Configuration File

Verbose Mode

While using operation commands with yum we may want to get more informed about running command. We can use -v option to see more details about yum operations.

Verbose Mode
Verbose Mode

Install Without GPG/Digest Check

Rpm files are signed for security reasons but some times it may be a trivial problem and we want to disable signature checking use –nogpgcheck . But generally do not prefer using this option which will provide some security thread for the installed packages.

Install Without GPG/Digest Check
Install Without GPG/Digest Check

Skip Broken Packages For Update

Sometimes updates comes with broken dependencies or packages so you can skip all of them and install other packages without problem use –skip-broken

Skip Broken Packages For Update
Skip Broken Packages For Update

Only Download Package

To just download packages not install them you can install them later. This will download package to the current working directory like a name tmux-1.8-4.el7.x86_64.rpm

Download Package
Download Package
RSS
EMAIL
FACEBOOK
FACEBOOK
GOOGLE
GOOGLE
https://www.poftut.com/yum-command-tutorial-with-examples-for-linux-package-management-like-install-update-remove/
PINTEREST
PINTEREST
INSTAGRAM

Leave a Reply

Your email address will not be published.