Linux Common Command (wuyi): Yum command __linux

Source: Internet
Author: User
Tags ftp site gpg
Yum Command

The Yum command is an RPM-based package manager in Fedora and Redhat as well as SUSE, which enables system administrators to interact and automate finer and more granular management of RPM packages, automatically downloading RPM packs from designated servers, and installing You can automate dependency relationships and install all dependent software packages at once, without the hassle of downloading and installing them.

Yum provides commands to find, install, delete, or even complete a package, and commands are simple and easy to remember.

Grammar

Yum (options) (parameters)    
Options-H: Display Help information;-Y: Answer "yes" to all questions;-c: Specify configuration file;-Q: Quiet mode;-V: verbose mode;-D: Sets the debug level (0-10); e: Sets the error level (0-10); R: Sets the maximum wait time for the Yum to process a command; -C: Run completely from the cache without downloading or updating any header files. ParametersInstall: Install RPM software package; Update: Updates RPM package; Check-update: Check for available update RPM packages; Remove: Delete the specified RPM package; list: Display package information;  Search: Check the package information; Info: Displays the description and profile of the specified RPM package; Clean: cleans up yum expired cache; Shell: Enter Yum's shell prompt; RESOLVEDEP: Shows the dependencies of RPM packages; Localinstall: Install the local RPM package; Localupdate: Displays the local RPM package for updates; Deplist: Displays all dependencies of the RPM package.

Common examples

The Yum command form is generally as follows: Yum [options] [command] [package ...]
Options are optional, including-H (Help),-y (when the installation prompts you to select all "Yes"), Q (does not display the installation process), and so on. [command] for the action to be taken, [package ...] Is the object of the operation.

Some of the most commonly used commands are summarized, including:

Auto Search fastest Mirroring plugin: Yum install Yum-fastestmirror
Install Yum graphics window plugin: Yum install Yumex
To view a list of possible bulk installations: Yum Grouplist

1 Installation
Yum Install all installed
Yum Install Package1 Install the specified installation package Package1
Yum groupinsall group1 Installer group group1

2 updates and upgrades
Yum Update all Updates
Yum Update Package1 the specified package Package1
Yum check-update Check for updatable programs
Yum Upgrade Package1 Upgrade the specified package Package1
Yum groupupdate group1 upgrade program group Group1

3 Find and display
Yum Info package1 Display installation package information Package1
Yum list shows all packages that have been installed and can be installed
Yum List Package1 shows the installation of the specified package Package1
Yum groupinfo group1 Display program group group1 information Yum Search string finds an installation package based on a keyword string

4 Removing programs
Yum Remove & #124; Erase Package1 Remove Package Package1
Yum groupremove group1 Delete program group group1
Yum deplist package1 Viewing program package1 dependencies

5 Clear Cache
Yum Clean packages clears the packages under the cache directory
Yum clean headers clears the headers in the cache directory
Yum clean oldheaders clears the cache directory of old headers
Yum clean, yum cleaned all (= Yum cleaning packages; yum Clear oldheaders) clears the packages under the cache directory and the old headers

----------------------------------------------------------

Yum Command detailed:
The Software Installation command for Redhat and Fedora is rpm, but the biggest trouble with using RPM to install the software is the need to manually find the series of dependencies needed to install the software, which is super hassle. If the software does not need to uninstall it is very annoying to unload a dependency and cause other software to not be used. Happily, Fedora has finally rolled out an apt command yum similar to Ubuntu, making Fedora's software installation easy. Yum has the following characteristics:
* Multiple resource pools can be configured at the same time (Repository)
* Concise configuration file (/etc/yum.conf)
* Automatically resolve the dependency problems encountered when adding or removing RPM packages
* Easy to use
* Maintain consistency with the RPM database
Yum, the abbreviation for Yellow Dog Updater modified, was originally developed by Yellow Dog, the release developer Terra Soft, in Python, then yup (Yellow Dog updater), After the improvement by the Linux@duke development team of Duke University, this is the name. Yum's mission is to automate upgrades, install/remove RPM packages, collect information about RPM packages, check dependencies, and automatically prompt users to resolve them. Yum's key is to have a reliable repository, as the name implies, this is the software warehouse, it can be HTTP or FTP site, can also be a local software pool, but must include RPM header, header includes the various information of the RPM package, including descriptions, functions, Provide documents, dependencies, etc. it is only by collecting these headers and analyzing them that the remaining tasks can be completed automatically.
1.yum All configuration information is stored in a configuration file called yum.conf, usually located in the/etc directory, this is the entire Yum system is the most important, I see this file in the F9, we look at the following:
[Hanlong@localhost F9 Common document]$ sudo more/etc/yum.conf
[Main]
Cachedir=/var/cache/yum
Keepcache=0
debuglevel=2
Logfile=/var/log/yum.log
Exactarch=1
Obsoletes=1
Gpgcheck=1
Plugins=1
metadata_expire=1800
# put YOUR REPOS this OR in separate files named File.repo
# IN/ETC/YUM.REPOS.D

A brief description of the document is given below:
Cachedir:yum Cache directory, yum this store to download the RPM package and database, generally/var/cache/yum.
DebugLevel: Debug level, 0──10, default is 2
Logfile:yum log file, default is/var/log/yum.log.
Exactarch, there are two options 1 and 0, whether to upgrade only and you install the package CPU system consistent package, if set to 1, if you install a i386 rpm, then Yum will not use 686 of the package to upgrade.
Gpgchkeck= has 1 and 2 choices, representing whether or not a GPG check is performed, and if not, the default seems to be checked.
2. OK, the next is the use of Yum, first use Yum to upgrade the software, yum operation most must have Superuser permissions, of course, can use sudo.
Yum update, this step is necessary, Yum will download the RPM header from the server header directory, placed in the local cache, which may take a certain amount of time, but compared to Yum to bring us convenience, the cost of these time is counted. Header download complete, yum will determine whether there is an updatable package, if so, it will ask your opinion, whether the update, or say y bar, the system always up to date is always good, then yum start to download the package and use the call RPM installation, which may take some time, Depending on the number of software updates and network conditions, if the network is broken, it does not matter, do it again. Upgrade completed, every day as long as the use of Yum check-update Check if there is any with the new, if there is, with Yum update with the new, always keep the system for the latest, blocking all the loopholes found. Upgrade a separate package with the Yum update packagename.
Now simply list some of the commands for Yum software upgrades:
(Update: I installed the wine is an RPM one installed, first installed since the relationship, and then installed wine main package, but just found in the forum to a good post, on the Yum Local installation. parameter is-localinstall
$yum Localinstall wine-*
In this way, the Yum will automatically install all the dependencies, rather than the RPM of a single installation, save a lot of work.
There is also a parameter similar to his:
$yum localupdate wine-*
If you have a new version of wine and you download it locally, you can update the wine locally. )

1. List all updatable software
Command: Yum check-update

2. Install all UPDATE software
Command: Yum update

3. Install only the specified software
Command: Yum Install

4. Update only the specified software
Command: Yum update

5. List all the items that can be installed
Command: Yum list

3. Install and uninstall software using Yum, one prerequisite is that Yum installed packages are in RPM format.
The command to install is, yum install Xxx,yum will query the database, whether there is a package, if there is, check its dependency conflict, if there is no dependency conflict, then it is best to download the installation; If so, you will be prompted to ask if you want to install dependencies at the same time, or to delete the conflicting packages. You can make your own judgments.
The delete command is, yum remove xxx, as with the installation, Yum will also query the database, give a solution to the dependencies of the hint.
1. Install packages with Yum
Command: Yum Install

2. Remove packages with Yum
Command: Yum Remove

4. Use the Yum query to install software
We often encounter this situation, want to install a software, only know it and a certain aspect, but not exactly know its name. At this point the Yum query function is working. You can search with commands such as Yum search keyword, such as we would like to install a instant messenger, but do not know exactly what, then you may wish to use the Yum search Messenger such instructions for searching, Yum will search all available rpm descriptions, listing all the RPM packages described in Messeger, so we might get gaim,kopete and so on and choose from them.
Sometimes we also encounter the installation of a package, but do not know its purpose, we can use the Yum info packagename this instruction to obtain information.
1. Use Yum to find Packages
Command: Yum search
2. List all installable Packages
Command: Yum list
3. List all updatable Packages
Command: Yum list updates
4. List the There are installed Packages
Command: Yum list installed
5. List all installed packages that are not in Yum Repository
Command: Yum list Extras
6. List the packages you specified
command: Yum List 7. Get package information using Yum
Command: Yum info 8. List information for all Packages
Command: Yum info
9. List all updatable package information
Command: Yum info updates
10. List all the Installed package Information
Command: Yum info installed
11. List all installed package information that is not in Yum Repository
command: Yum info Extras
12. List which files are provided by the package
Command: Yum provides

5. Clear Yum Cache
Yum will store the downloaded packages and headers in the cache and not automatically delete them. If we feel that they are taking up disk space, you can use the Yum Clean command for cleanup, more precise usage is yum clean headers clear Header,yum Clean Packages erase downloaded RPM package, yum clean all clears all
1. Clear the package under the cache directory (/var/cache/yum)
Command: Yum Clean packages

2. Clear the Cache directory (/var/cache/yum) under the headers

Command: Yum Clean headers

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

Command: Yum clean oldheaders

4. Clear the Cache directory (/var/cache/yum) under the package and the old headers

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

The use of all of the above command parameters can be viewed in man:
1, the installation of graphics version Yumex:yum install Yumex.
2, install the additional software warehouse:
Rpm.livna.org's Package Warehouse:
RPM-IVH http://livna-dl.reloumirrors.net ... ease-7-2.noarch.rpm

Freshrpms.net's Package Warehouse:
RPM–IVH Http://ftp.freshrpms.net/pub/fre ... 1.1-1.fc.noarch.rpm

3, install the fastest source yum install Yum-fastestmirror

Resources are really very rich, from CentOS to Ubuntu,iso Mirror, upgrade package, everything, the brothers are really happy, envy ah. But fortunately, we are at least in the education network, make up can also touch a little light, download some.
The website is: ftp://ftp.sjtu.edu.cn/

The corresponding yum of the repo is
[Updates]
Name=fedora Updates
baseurl=ftp://ftp.sjtu.edu.cn/fedora/linux/updates/$releasever/$basearch/
Enabled=1
Gpgcheck=0
[Fedora]
Name=fedora $releasever-$basearch
baseurl=ftp://ftp.sjtu.edu.cn/fedora/linux/releases/$releasever/everything/$basearch/os/
Enabled=1
Gpgcheck=1
Gpgkey=file:///etc/pki/rpm-gpg/rpm-gpg-key-fedora File:///etc/pki/rpm-gpg/RPM-GPG-KEY

If APT Manager is installed on the machine, the corresponding source is
REPOMD ftp://ftp.sjtu.edu.cn/fedora/linux/updates/$ (VERSION)/$ (ARCH)/

REPOMD ftp://ftp.sjtu.edu.cn/fedora/linux/releases/$ (VERSION)/everything/$ (ARCH)/os/

This is somewhat different from the format of the source in front of Yum and needs to be noted.


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.