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 to query the package and clear the cache in Fedora

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

Share

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

This article mainly shows you "Fedora how to use the Yum command to query the software package and remove the cache", the content is easy to understand, clear, hope to help you solve your doubts, the following let the editor lead you to study and learn "Fedora how to use the Yum command to query the package and clear the cache" this article.

The software installation command for Redhat and Fedora is rpm.

But the trouble with installing software with rpm is that you need to manually find a series of dependencies needed to install the software, not to mention the super trouble, if the software is not used and needs to be uninstalled, it is very annoying that other software cannot be used due to uninstalling a dependency. Happily, Fedora finally launched a Fedora Yum command similar to apt in ubuntu, making Fedora software installation simple and easy. The Fedora Yum command has the following characteristics:

* 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

The Fedora Yum command, short for Yellow dog Updater Modified, was originally developed by Terra Soft, the developer of the yellow dog distribution, and written in python. At that time, it was also called yup (yellow dog updater), and later improved by the Linux@Duke development team at Duke University. The purpose of the Fedora Yum command is to automatically upgrade, install / remove rpm packages, collect information about rpm packages, check dependencies, and automatically prompt users for resolution. The key point of the Fedora Yum command is to have a reliable repository, as the name implies, this is the software repository, it can be a http or ftp site, it can also be a local software pool, but it must contain the header of rpm. Header includes all kinds of information about the rpm package, including descriptions, functions, provided files, dependencies, and so on. It is the collection and analysis of these header that automates the remaining tasks.

1. All the configuration information of the Fedora Yum command is stored in a configuration file called yum.conf, which is usually located in the / etc directory, which is the top priority of the entire Fedora Yum command system. I have viewed this file in F10. Let's take a look at this file:

[main] cachedir=/var/cache/yum keepcache=0 debuglevel=2 logfile=/var/log/yum.log exactarch=1 obsoletes=1 gpgcheck=1 plugins=1 installonly_limit=3

The following is a brief description of this file: the directory where the cachedir:Fedora Yum command is cached, where yum stores downloaded rpm packages and databases, usually / var/cache/yum. Debuglevel: debug level, 0 ── 10, default is 2logfile:yum log file, default is / var/log/yum.log. Exactarch, there are two options 1 and 0, indicating whether to upgrade only packages that are consistent with your installation package cpu. If set to 1, then if you install an i386 rpm, yum will not upgrade with 686 packages. Gpgchkeck= has two choices of 1 and 0, which represent whether or not to perform a gpg check. if not, it seems to be checked by default.

two。 Well, the next is the use of the Fedora Yum command, first of all, use yum to upgrade the software, the operation of the Fedora Yum command must have superuser permissions, of course, you can use sudo. Yum update, this step is necessary. The Fedora Yum command downloads rpm's header from the server's header directory and places it in the local cache, which may take some time, but what is the cost of this time compared to the convenience brought to us by yum? Header download is complete, the Fedora Yum command will determine whether there is an updatable software package, if so, it will ask your opinion whether to update, or y, it is always good to up to date the system all the time, then the Fedora Yum command starts to download the software package and use the call rpm installation, which may take a certain time, depending on the number of software to be updated and the network condition, in case the network is down, it doesn't matter, just do it again. After the upgrade, just use yum check-update every day to check whether it is up-to-date, and if so, use yum update to keep the system up-to-date at all times to plug all loopholes found. Upgrade a separate package with yum update packagename.

Now simply list some of the commands for Fedora Yum command software upgrades:

1. Make a list of all updatable software

Command: yum check-update

two。 Install all updated softwar

Command: yum update

3. Install only the specified software

Command: yum install

4. Update only the specified software

Command: yum update

5. Make a list of all installable software

Command: yum list

three。 Use the Fedora Yum command to install and uninstall software on the premise that the software packages installed by the Fedora Yum command are in rpm format. The command to install is that yum install xxx,yum will query the database to see if there is such a package. If so, check its dependency conflict. If there is no dependency conflict, then * download and install it. If so, it will give a prompt, asking whether to install dependencies at the same time, or delete conflicting packages, you can make your own command to determine the deletion is yum remove xxx, just like the installation, yum will query the database and give tips for resolving dependencies.

1. Install the software package with YUM

Command: yum install

two。 Install the rpm package from the hard drive and use yum to resolve dependencies

Yum localinstall application_name

3. Delete a software package with YUM

Command: yum remove

four。 We often encounter this situation when we use the Fedora Yum command to query the software we want to install. We only know that it is related to some aspect, but we don't know its name exactly. At this point, the query function of the Fedora Yum command works. You can use commands like yum search keyword to search, for example, if we want to install an Instant Messenger, but we don't know what it is, we might as well use an instruction like yum search messenger to search, yum will search the descriptions of all available rpm and list all the rpm packages related to messeger in the description, so we may get gaim,kopete and so on, and choose from them. Sometimes we come across the installation of a package, but do not know its purpose, we can use the yum info packagename instruction to get information.

1. Use the Fedora Yum command to find a software package

Command: yum search

two。 List all installable software packages

Command: yum list

3. List all updatable software packages

Command: yum list updates

4. List all installed packages

Command: yum list installed

5. List all packages that are installed but not within Yum Repository

Command: yum list extras

6. List the specified software packages

Command: yum list 7. Use YUM to get package information

Command: yum info 8. List information for all software packages

Command: yum info

9. List all updatable package information

Command: yum info updates

10. List all installed package information

Command: yum info installed

11. List all software packages installed but not within Yum Repository

Command: yum info extras

twelve。 List the files provided by the software package

Command: yum provides

13. What are the yum sources in the system

Command: yum repolist

five。 Clearing the Yum cache Fedora Yum command stores the downloaded package and header in cache instead of automatically deleting it. If we think they take up disk space, we can clear them using the yum clean directive. More precisely, yum clean headers clears header,yum clean packages clears downloaded rpm packages, yum clean all clears all

1. Clear the software packages under the cache directory (/ var/cache/yum)

Command: yum clean packages

two。 Clear the headers under the cache directory (/ var/cache/yum)

Command: yum clean headers

3. Clear the old headers under the cache directory (/ var/cache/yum)

Command: yum clean oldheaders

4. Clear the software packages under the cache directory (/ var/cache/yum) and the old headers

Command: yum clean, yum clean all (= yum clean packages; yum clean oldheaders)

The use of all the above command parameters can be viewed with man

5. Enable / disable a software repository

Yum-enablerepo=repo_name (repo_name stands for warehouse name, same below)

Yum-disablerepo=repo_name

6. Import Fedora GPG key

Fedora has two basic software repositories called "fedora" and "updates". To use them and avoid errors when installing unsigned packages, you must import their GPG keys, open a terminal, and enter the following command:

Rpm- import / etc/pki/rpm-gpg/*

The above is all the contents of the article "how to query the package and clear the cache by using the Yum command in Fedora". 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