Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use the yum command under linux

2025-04-04 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

Editor to share with you how to use the yum command under linux, I believe most people do not know much about it, so share this article for your reference, I hope you can learn a lot after reading this article, let's go to know it!

What does yum do?

Linuxer that uses redhat,fedora must have a headache for rpm's famous dependency hell (this is also a problem with all rpm-based distributions). Foo is needed by bar,bar is needed by foo . To load and unload a piece of software, you have to work hard to sort out all the dependency problems. Several rpm search sites have become frequent places, and if you unfortunately encounter circular dependencies, you will have to stare. Sometimes add a-- nodeps parameter, it is out of sight, out of mind, but this installed software, you can guarantee normal use, so uninstall the software, you can guarantee that it will not affect the work of other software, I am afraid no one can give an affirmative answer. At this point, the hats can only look at debian's apt and secretly envy. Fortunately, these are a thing of the past. Rpm-based distributions now have package management tools like apt that automatically resolve dependencies. One of the most famous is apt4rpm, which is basically a migration of the debian system apt to the rpm distribution. But did you know that using linuxer with Redhat and Fedora, there is also a rpm package management system similar to apt, which is yum. The Fedora system already comes with it, and Redhat also has a corresponding rpm download. Compared with apt, yum is not weak at all, and even has many advantages over apt. For example, yum is built into the Fedora system, so it can use fedora's official software source to complete various upgrades to various official releases. Yum is not bad for support for third-party software sources, and most repository notes that support apt can also support yum, such as freshrpms,fedora.us,livna, and so on. In addition, yum has a more detailed log to see when to upgrade, what packages are installed, and so on. The code of yum is more concise than that of apt.

one。 What is yum?

Yum = Yellow dog Updater, the main function of Modified is to add / delete / update RPM packages more easily. It can automatically solve the problem of packet dependence.

It is easy to manage a large number of system update problems.

Note: the simplest reason for using yum instead of apt is that Fedora comes with

two。 Characteristics of yum

* multiple repositories can be configured simultaneously (Repository)

* concise configuration file (/ etc/yum.conf)

* automatically resolve dependency issues encountered when adding or deleting rpm packages

* easy to use

* maintain consistency with RPM database

three。 Yum installation

Fedora comes with

# rpm-ivh yum-2.0.4-2.noarch.rpm

four。 Yum configuration

Note: modify and add the repository in the configuration file, speed up the download and have more updatable rpm packages to replace all the contents of / etc/yum.conf with

[main]

Cachedir=/var/cache/yum

Debuglevel=2

Logfile=/var/log/yum.log

Pkgpolicy=newest

Distroverpkg=fedora-release

Tolerant=1

Exactarch=1

[fedora-us-1]

Name=Fedora Core 1-Fedora US mirror

Baseurl= ftp://mirrors.kernel.org/fedora.us/fedora/fedora/1/i386/yum/os

[fedora-us-1-updates]

Name=Fedora Core 1 updates-Fedora US mirror

Baseurl= ftp://mirrors.kernel.org/fedora.us/fedora/fedora/1/i386/yum/updates

[fedora-us-1-stable]

Name=Fedora Linux (stable) for Fedora Core 1-Fedora US mirror

Baseurl= ftp://mirrors.kernel.org/fedora.us/fedora/fedora/1/i386/yum/stable

[freshrpms]

Name=Fedora Linux $releasever-$basearch-freshrpms

Baseurl= http://ayo.freshrpms.net/fedora/linux/$releasever/$basearch/freshrpms

five。 Yum application

Note: when you update the yum or yum repository for * times, yum will automatically download all the required headers and place them in the / var/cache/yum directory, which may take a long time.

Check for updatable rpm packages

# yum check-update

Install the rpm package so that xmms can play mp3

# yum install xmms-mp3

Install mplayer and automatically install the relevant software

# yum install mplayer

Delete the licq package and delete the package that is dependent on the package

# yum remove licq

Note: you will be prompted to delete licq-gnome,licq-qt,licq-text at the same time, which is very convenient.

System updates (update all upgradeable rpm packages, including kernel)

# yum-y update

Perform system updates regularly every day

# chkconfig yum on

# service yum start

six。 Detailed explanation of yum instruction

* updates to the rpm package

Check for updatable rpm packages

# yum check-update

Update all rpm packages

# yum update

Update specified rpm packages, such as kernel and kernel source

# yum update kernel kernel-source

Large-scale version upgrades, unlike yum update, even old obsolete packages are upgraded.

# yum upgrade

* installation and removal of rpm packages

Install rpm packages, such as xmms-mp3

# yum install xmms-mp3

Delete the rpm package, including packages that are dependent on the package

# yum remove licq

Note: you will also be prompted to delete licq-gnome,licq-qt,licq-text.

* parameters related to yum temporary storage (/ var/cache/yum/)

Clear rpm package files in temporary storage

# yum clean packages

Clear the rpm header file in temporary storage

# yum clean headers

Clear old rpm header files in temporary storage

# yum clean oldheaders

Clear old rpm header files and package files in temporary storage

# yum clean or # yum clean all

Note: equivalent to yum clean packages + yum clean oldheaders

* list of rpm packages

List all rpm packages in the repository that can be installed or updated

# yum list

List the specific rpm packages in the repository that can be installed or updated, as well as which packages have been installed

# yum list mozilla

# yum list mozilla*

Note: you can use matches in rpm package names, such as listing all rpm packages that begin with mozilla

List all updatable rpm packages in the repository

# yum list updates

List all installed rpm packages

# yum list installed

List rpm packages that have been installed but are not included in the repository

# yum list extras

Note: download and install the rpm package through other websites

* display of rpm package information (info parameter is the same as list)

Lists information about all rpm packages in the repository that can be installed or updated

# yum info

Lists specific information in the repository that can be installed or updated, as well as the rpm packages that have been installed

# yum info mozilla

# yum info mozilla*

Note: you can use matches in rpm package names, such as listing information for all rpm packages that begin with mozilla

Lists information about all updatable rpm packages in the repository

# yum info updates

List the information of all installed rpm packages

# yum info installed

Lists information about rpm packages that have been installed but are not included in the repository

# yum info extras

Note: download information about installed rpm packages from other websites

* search for rpm packages

Search for rpm packets that match specific characters

# yum search mozilla

Note: search in rpm package name, package description, etc.

Search for rpm packages that contain specific file names

# yum provides realplay

seven。 Securely update freshrpms.net 's rpm package

Install GPG key # rpm of freshrpms.net-- import http://freshrpms.net/packages/RPM-GPG-KEY.txt

Edit / etc/yum.conf, add the following information to the tail

[freshrpms]

Name=Fedora Linux $releasever-$basearch-freshrpms

Baseurl= http://ayo.freshrpms.net/fedora/linux/$releasever/$basearch/freshrpms

Gpgcheck=1

Note:

Check GPG Key

# rpm-qa gpg-pubkey*

Display Key information

# rpm-qi gpg-pubkey-e42d547b-3960bdf1

Delete Key

# rpm-e gpg-pubkey-e42d547b-3960bdf1

The above is all the contents of this article entitled "how to use yum commands under linux". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report