转载 2007年10月15日 13:52:00

man page for yum 2.2.1 begin


  • yum - Yellowdog Updater Modified


  • yum [options] [command] [package ...]


  • yum is an interactive, automated update program which can be used for maintaining systems using rpm

    command is one of:

    • install package1 [package2] [...]

    • update [package1] [package2] [...]

    • check-update

    • upgrade [package1] [package2] [...]

    • remove | erase package1 [package2] [...]

    • list [...]

    • info [...]

    • provides | whatprovides feature1 [feature2] [...]

    • clean [ packages | headers | metadata | cache | all ]

    • makecache

    • groupinstall group1 [group2] [...]

    • groupupdate group1 [group2] [...]

    • grouplist

    • groupremove group1 [group2] [...]

    • groupinfo group1 [...]

    • search string1 [string2] [...]

    • generate-rss [updates]

    Unless the --help or -h option is given, one of the above commands must be present.


    • Is used to install the latest version of a package or group of packages while ensuring that all dependencies are satisfied. If no package matches the given package name(s), they are assumed to be a shell glob and any matches are then installed.

    update If run without any packages, update will update every currently

    • installed package. If one or more packages are specified, Yum will only update the listed packages. While updating packages, yum will ensure that all dependencies are satisfied. If no package matches the given package name(s), they are assumed to be a shell glob and any matches are then installed.

      If the --obsoletes flag is present yum will include package obsoletes in its calculations - this makes it better for dis- tro-version changes, for example: upgrading from somelinux 8.0 to somelinux 9.


    • Implemented so you could know if your machine had any updates that needed to be applied without running it interactively. Returns exit value of 100 if there are packages available for an update. Also returns a list of the pkgs to be updated in list format. Returns 0 and no packages are available for update.


    • Is the same as the update command with the --obsoletes flag set. See update for more details.

    remove or erase

    • Are used to remove the specified packages from the system as well as removing any packages which depend on the package being removed.

    list Is used to list various information about available packages;

    • more complete details are available in the List Options section below.

    provides or whatprovides

    • Is used to find out which package provides some feature or file. Just use a specific name or a file-glob-syntax wildcards to list the packages available or installed that provide that feature or file.

    search Is used to find any packages matching a string in the descrip-

    • tion, summary, packager and package name fields of an rpm. Use- ful for finding a package you do not know by name but know by some word related to it.

    info Is used to list a description and summary information about

    • available packages; takes the same arguments as in the List Options section below.

    clean Is used to clean up various things which accumulate in the yum

    • cache directory over time. More complete details can be found in the Clean Options section below.


    • Is used to create a rss file containing changelogs for all packages in the enabled repositories. By default it will list only the most recent packages. If the system.


  • Most command line options can be set using the configuration file as well and the descriptions indicate the necessary configuration option to set.

    -h, --help

    • Help; display a help message and then quit.

    -y Assume yes; assume that the answer to any question which would

    • be asked is yes. Configuration Option: assume-yes

    -c [config file]

    • Specifies the config file location - can take http, ftp urls and local file paths.

    -d [number]

    • Sets the debugging level to [number] - turns up or down the amount of things that are printed. Practical range: 0 - 10 Configuration Option: debuglevel

    -e [number]

    • Sets the error level to [number] Practical range 0 - 10. 0 means print only critical errors about which you must be told. 1 means print all errors, even ones that are not overly impor- tant. 1+ means print more errors (if any) -e 0 is good for cron jobs. Configuration Option: errorlevel

    -t, --tolerant

    • Tells yum to be tolerant of errors on the command line with regard to packages on the commandline. For example: if you request to install foo, bar and baz and baz is installed; yum wonât error out complaining that baz is already installed. Configuration Option: tolerant

    -R [time in minutes]

    • Sets the maximum amount of time yum will wait before performing a command - it randomizes over the time.

    -C Tells yum to run entirely from cache - does not download or

    • update any headers unless it has to to perform the requested action.


    • Reports the yum version number and exits.


    • Specifies an alternative installroot, relative to which all packages will be installed. Configuration Option: installroot


    • Enables a specific repository that has been disabled in the configuration file using the enabled=0 option. Configuration Option: enabled


    • Disables a specific repository. Configuration Option: enabled


    • This option only has affect for an update, it enables yum´s obsoletes processing logic. For more information see the update command above. Configuration Option: obsoletes


    • Output rss data for the generate-rss command to the specified file. Configuration Option: rss-filename


    • Exclude a specific package by name or glob from updates on all repositories. Configuration Option: exclude


  • The following are the ways which you can invoke yum in list mode. Note that all list commands include information on the version of the package.

    yum list [all | regexp1] [regexp2] [...]

    • List all available and installed packages.

    yum list available [regexp1] [...]

    • List all packages in the yum repositories available to be installed.

    yum list updates [regexp1] [...]

    • List all packages with updates available in the yum reposito- ries.

    yum list installed [regexp1] [...]

    • List the packages specified by args. If an argument does not match the name of an available package, it is assumed to be a shell-style glob and any matches are printed.

    yum list extras [regexp1] [...]

    • List the packages installed on the system that are not avail- able in any yum repository listed in the config file.

    yum list obsoletes [regexp1] [...]

    • List the packages installed on the system that are obsoleted by packages in any yum repository listed in the config file.

    Specifying package names

    • All the list options mentioned above take file-glob-syntax wildcards or package names as arguments, for example yum list available foo* will list all available packages that match foo*.


  • The following are the ways which you can invoke yum in clean mode.

    yum clean packages

    • Eliminate any cached packages from the system. Note that pack- ages are not automatically deleted after they are downloaded.

    yum clean headers

    • Eliminate all of the files which yum uses to determine the remote availability of packages. Using this option will force yum to download all the headers the next time it is run.

    yum clean all

    • Runs yum clean packages and yum clean headers as above.


  • Specifying package names

    • A package can be referred to for install,update,list,remove etc with any of the following:

      name name.arch name-ver name-ver-rel name-ver-rel.arch epoch:name-ver-rel.arch

      For example: yum remove kernel-2.4.1-10.i686.


  • /etc/yum.conf /var/cache/yum/



  • Seth Vidal <skvidal.[at]>


  • There of course arenât any bugs, but if you find any, they should be sent to the mailing list: [MAILTO] or filed in bugzilla.

Seth Vidal 2005 Jan 9 yum(8)