yum
2015.06.10VPSなどの各種設定を行う際に利用する yum 。なにを今更といった感もあるが、念のためよく使用するコマンド、オプションの指定、設定ファイル、ログファイル等についての備忘録。
YUM(Yellowdog Updater Modified)について
RHEL、Fedora、CentOSなどRPMベースのディストリビューションのパッケージ管理システム(のメタ管理システム)として利用されている。
読み方は一般的に「ヤム」と呼ばれることが多い。次に「ユム」といったところ。
Debian系Linuxではdeb形式のパッケージ管理システムdpkgやAPT(Advanced Packaging Tool)がよく利用される。
Macintoshでは似たようなパッケージ管理システムとしてMacPortsやHomebrewなどがある。
設定について
/etc/yum.conf
メイン設定ファイルとなる /etc/yum.conf はkeepcache設定とexclude設定については考慮する。デフォルトでは keepcache=0 でrpmパッケージはキャッシュされない。必要であれば keepcache=1 と変更し、キャッシュを残す。その際にはキャッシュ使用容量に注意する。exclude設定はyumを使用したupdateなどで除外するパッケージを指定できる。OS、kernel関連をupdateしたくない場合は exclude=kernel* centos* といった内容を追記する。
/etc/yum.repos.d/*.repo
vpsサービスを提供している企業によりRepositoryファイルなどは初期設定状態で変更されている場合もあるが、基本的な仕様は大きく変わらない場合が多い。
CentOS標準Repository以外では、epelとremiを使用できるようにrepoファイルを追加設定しておくと便利かもしれない。それぞれのファイル内のenable設定とpriority設定については留意しないと期待しないupdateが行われる場合がある。
/var/yum.log
ログファイルの設置場所は自由だが、他のログファイル同様ある程度ルールを決めて管理することが望ましい。ファイルの指定は /etc/yum.conf で変更可能。
/etc/logrotate.conf
/etc/logrotate.d/yum
ログローテーションの設定ファイルは他のシステム同様 /etc/logrotate.conf (ログローテーション基本設定ファイル)と /etc/logrotate.d/ 内の yumファイルにて設定を行う。(インストール時に作成されているはず。)設定自体はロギング頻度も高いわけではないので長いスパンでのローテーションで通常は問題ない。
※ /etc/yum.conf, /etc/yum.repos.d/*.repo の行頭の # はコメントアウト(念のため)
Yum Settings
Yum
/etc/yum.conf
/etc/logrotate.conf
/etc/logrotate.d/yum
man yum.conf
man logrotate
Ex. CentOS 6.6 yum 3.2.29 # yum executable file /usr/bin/yum # yum configuration file /etc/yum.conf # メイン設定ファイル # yum repository files /etc/yum.repos.d/CentOS-Base.repo # 基本となる5つのリポジトリの設定ファイル [base] リリースポイントでの基本パッケージリポジトリ [updates] 次期リリースポイントまでのbaseリポジトリパッケージに対するアップデートリポジトリ [extras] 追加機能を上位への互換性を壊すことなく、またベースコンポーネントの更新をせずに提供できる(都度新しいバージョンを提供する)リポジトリ [centosplus] CentOSの特定のベースコンポーネントをアップグレードする項目が含まれるリポジトリ(上位プロダクトで利用できない) [contrib] コアディストリビューションのパッケージに重複しない、CentOSのユーザーから提供されたパッケージリポジトリ /etc/yum.repos.d/CentOS-Debuginfo.repo # プライマリパッケージが構築されたときに生成される、デバッグシンボル付きのパッケージが含まれるリポジトリ設定ファイル [base-debuginfo] /etc/yum.repos.d/CentOS-Media.repo # DVDやISOイメージなどをリポジトリとする設定ファイル [c6-media] /etc/yum.repos.d/CentOS-Vault.repo # 旧OSバージョンのリポジトリ設定ファイル(基本の5つ x バージョン数 のリポジトリが記述) [C6.0-base][C6.0-updates][C6.0-extras][C6.0-contrib][C6.0-centosplus] [C6.0-base][C6.1-updates][C6.1-extras][C6.1-contrib][C6.1-centosplus] [C6.0-base][C6.2-updates][C6.2-extras][C6.2-contrib][C6.2-centosplus] [C6.0-base][C6.3-updates][C6.3-extras][C6.3-contrib][C6.3-centosplus] [C6.0-base][C6.4-updates][C6.4-extras][C6.4-contrib][C6.4-centosplus] [C6.0-base][C6.5-updates][C6.5-extras][C6.5-contrib][C6.5-centosplus] /etc/yum.repos.d/CentOS-fasttrack.repo # 次期リリースポイントまでの先行リポジトリ設定ファイル(理由があり先行され、戻される可能性もある) [fasttrack] /etc/yum.repos.d/epel.repo # エンタープライズ Linux 用の拡張パッケージ:EPEL(Extra Packages for Enterprise Linux)リポジトリ設定ファイル # デフォルトで有効となっているCentOS extrasのリポジトリと競合する可能性がある [epel] [epel-debuginfo] [epel-source] /etc/yum.repos.d/epel-testing.repo # 将来的にリリース予定のアップデートパッケージ等を含むEPELリポジトリ設定ファイル [epel-testing] [epel-testing-debuginfo] [epel-testing-source] /etc/yum.repos.d/remi.repo # MySQLとPHPの最新バージョンを含むremi(Les RPM de Remi)リポジトリ設定ファイル(コアパッケージが置き換わる) [remi] [remi-php55] [remi-php56] [remi-test] [remi-debuginfo] [remi-php55-debuginfo] [remi-php56-debuginfo] [remi-test-debuginfo] # yum log file /var/log/yum.log # Yumの実行によるログ出力ファイル(デフォルト) # yum log rotation configuration file /etc/logrotate.d/yum # Yumの実行によるログ出力ファイルのログローテーション設定ファイル
[main] cachedir=/var/cache/yum/$basearch/$releasever # キャッシュとデータベースファイルを格納するディレクトリへの絶対パス。$basearch, $releasever はYum変数。 keepcache=0 # 0:インストール成功後、ヘッダーとパッケージのキャッシュを保持しない。(デフォルト) # 1:インストール成功後、キャッシュを保持する。 debuglevel=2 # 0-10:高い数値ほど詳細なデバッグ出力を表示。0を指定すると出力が無効となる。(デフォルト値は2) logfile=/var/log/yum.log # yumがログ出力するファイルへの絶対パス。/var/log/yum.log がデフォルト。 #tolerant=[0|1] # 0:エラーに対して寛容ではない。(デフォルト) # 1:エラーに対して寛容な挙動を取る。-t と同じ(例えばインストール済みパッケージなどをインストールしようとしてもエラーとならない) # ※ディストリビューション、バージョンにより違いが出てきているようだ exactarch=1 # 0:パッケージ更新時に正しいアーキテクチャーを考慮しない。 # 1:パッケージ更新時に正しいアーキテクチャーを考慮する。(デフォルト) obsoletes=1 # 0:パッケージ更新時に obsoletes処理ロジックを無効にする。 # 1:パッケージ更新時に obsoletes処理ロジックを有効にする。(デフォルト) # obsoletes処理ロジック:簡単に説明すると違う新旧パッケージや名前の変更があったパッケージの置き換え処理ロジック gpgcheck=1 # 0:インストールされるパッケージのGPG署名確認を無効にする。 # 1:インストールされるパッケージのGPG署名確認を有効にする。(デフォルト) # この設定は各.repoファイルでも個々に指定可能。yum.confにデフォルト値の指定がある場合、.repoファイル内での個々の指定は無効となる。 plugins=1 # 0:Yumのプラグインを全体的に無効にする。(推奨されない) # 1:Yumのプラグインを全体的に有効にする。Yumプラグイン内で個々に enabled=0 を設定し、無効化することも可能。 metadata_expire=1800 # num[(second:default) | d(day) | h(hour) | m(minute) | never(never expire)] # リポジトリのメタデータの有効時間。デフォルトは6hourだがyum-updatesdなどが動いている場合、補完される。 # ※デフォルト値など、ディストリビューションやdaemon、cronの設定により違いが出る installonly_limit=5 # installonlypkgs指示文に表示されている単一のパッケージに同時にインストール可能なバージョンの最大数を表す整数。 # デフォルト値は3。2より小さい数値を指定することは推奨されない。 # installonlypkgs指示文のデフォルトには複数の様々なカーネルパッケージが含まれているため、 # この値を変更すると単一のカーネルパッケージのインストール済みバージョンの最大数にも影響が及ぶ点に注意が必要。 bugtracker_url=http://bugs.centos.org/set_project.php?project_id=19&ref=http://bugs.centos.org/bug_report_page.php?category=yum # yumの処理においてバグが発生した場合に報告されるべきURL。ディストリビューションやバージョンにより異なる指定が可能。 distroverpkg=centos-release # yumがディストリビューション、バージョンを判断するための記述。redhat-release や fedora-release といった記述。 #exclude=kernel* centos* # インストール、アップデート処理の際に指定パッケージやキーワードにマッチするパッケージを除外する。複数指定する場合は、空白で区切る。ワイルドカード(* や ? など)が使用可能。 #assumeyes=[0|1] # 1を指定すると -yオプションをつけてコマンドを実行したように動作する。 # This is the default, if you make this bigger yum won't see if the metadata # is newer on the remote and so you'll "gain" the bandwidth of not having to # download the new metadata and "pay" for it by yum not having correct # information. # It is esp. important, to have correct metadata, for distributions like # Fedora which don't keep old packages around. If you don't like this checking # interupting your command line usage, it's much better to have something # manually check the metadata once an hour (yum-updatesd will do this). # metadata_expire=90m # PUT YOUR REPOS HERE OR IN separate files named file.repo # in /etc/yum.repos.d
# see "man logrotate" for details
# rotate log files weekly
weekly
# ローテート周期 [daily | weekly | monthly | yearly]
# keep 4 weeks worth of backlogs
rotate 4
# バックログ保持数 [rotate count]
# create new (empty) log files after rotating old ones
create
# ローテート時、新規ログファイル作成
# use date as a suffix of the rotated file
dateext
# バックログサフィックスに日付を使用
# uncomment this if you want your log files compressed
#compress
# バックログをgzip圧縮
# RPM packages drop log rotation information into this directory
include /etc/logrotate.d
# Yum等でインストールされるRPMパッケージからのログローテーション設定ファイル配置パスをインクルード
# no packages own wtmp and btmp -- we'll rotate them here
/var/log/wtmp {
monthly
create 0664 root utmp
minsize 1M
rotate 1
}
/var/log/btmp {
missingok
monthly
create 0600 root utmp
rotate 1
}
# system-specific logs may be also be configured here.
/var/log/yum.log {
# /var/log/yum.log に対する設定
missingok
# ログファイルが存在しなくてもエラーを出さない [missingok | nomissingok]
notifempty
# ログファイルが空ならローテーションを行わない [ifempty | notifempty]
yearly
# 年単位でログローテーションを実行 [daily | weekly | monthly | yearly]
create 0600 root root
# ログローテーション実行後、新規ログファイルを作成 create [permission] [group] [user]
}
yum.conf(5) yum configuration file yum.conf(5)
NAME
yum.conf - Configuration file for yum(8).
DESCRIPTION
Yum uses a configuration file at /etc/yum.conf.
Additional configuration files are also read from the directories set by the reposdir option (default is ‘/etc/yum.repos.d’). See the reposdir
option below for further details.
PARAMETERS
There are two types of sections in the yum configuration file(s): main and repository. Main defines all global configuration options. There should be
only one main section. The repository section(s) define the configuration for each repository/server. There should be one or more repository sec-
tions.
[main] OPTIONS
The [main] section must exist for yum to do anything. It consists of the following options:
cachedir Directory where yum should store its cache and db files. The default is ‘/var/cache/yum’.
persistdir Directory where yum should store information that should persist over multiple runs. The default is ‘/var/lib/yum’.
keepcache Either ‘1’ or ‘0’. Determines whether or not yum keeps the cache of headers and packages after successful installation. Default is
’1’ (keep files)
reposdir A list of directories where yum should look for .repo files which define repositories to use. Default is ‘/etc/yum.repos.d’. Each
file in this directory should contain one or more repository sections as documented in [repository] options below. These will be merged with
the repositories defined in /etc/yum.conf to form the complete set of repositories that yum will use.
debuglevel Debug message output level. Practical range is 0-10. Default is ‘2’.
errorlevel Error message output level. Practical range is 0-10. Default is ‘2’.
rpmverbosity Debug scriptlet output level. ’info’ is the default, other options are: ’critical’, ’emergency’, ’error’, ’warn’ and ’debug’.
protected_packages This is a list of packages that yum should never completely remove. They are protected via Obsoletes as well as user/plugin
removals.
The default is: yum glob:/etc/yum/protected.d/*.conf So any packages which should be protected can do so by including a file in /etc/yum/pro-
tected.d with their package name in it.
Also if this configuration is set to anything, then yum will protect the package corresponding to the running version of the kernel.
protected_multilib Either ‘1’ or ‘0’. This tells yum whether or not it should perform a check to make sure that multilib packages are the same
version. For example, if this option is off (rpm behaviour) pkgA-1.x86_64 and pkgA-2.i386 can be installed at the same time. However this is
very rarely desired. install only packages, like the kernel, are excempt from this check. The default is ‘1’.
logfile Full directory and file name for where yum should write its log file.
gpgcheck Either ‘1’ or ‘0’. This tells yum whether or not it should perform a GPG signature check on packages. When this is set in the [main]
section it sets the default for all repositories. The default is ‘0’.
localpkg_gpgcheck Either ‘1’ or ‘0’. This tells yum whether or not it should perform a GPG signature check on local packages (packages in a
file, not in a repositoy). The default is ‘0’.
repo_gpgcheck Either ‘1’ or ‘0’. This tells yum whether or not it should perform a GPG signature check on the repodata. When this is set in
the [main] section it sets the default for all repositories. The default is ‘0’.
skip_broken Either ‘1’ or ‘0’. Resolve depsolve problems by removing packages that are causing problems from the transaction.
assumeyes Either ‘1’ or ‘0’. Determines whether or not yum prompts for confirmation of critical actions. Default is ‘0’ (do prompt).
Command-line option: -y
alwaysprompt Either ‘1’ or ‘0’. Without this option, yum will not prompt for confirmation when the list of packages to be installed exactly
matches those given on the command line. Unless assumeyes is enabled, it will still prompt for package removal, or when additional packages
need to be installed to fulfill dependencies. Default is ‘1’.
tolerant Either ‘1’ or ‘0’. If enabled, then yum will be tolerant of errors on the command line with regard to packages. 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. Default to ‘0’ (not
tolerant).
Command-line option: -t
exclude List of packages to exclude from updates or installs. This should be a space separated list. Shell globs using wildcards (eg. * and
?) are allowed.
exactarch Either ‘1’ or ‘0’. Set to ‘1’ to make yum update only update the architectures of packages that you have installed. ie: with this
enabled yum will not install an i686 package to update an i386 package. Default is ‘1’.
installonlypkgs List of package provides that should only ever be installed, never updated. Kernels in particular fall into this category.
Defaults to kernel, kernel-bigmem, kernel-enterprise, kernel-smp, kernel-debug, kernel-unsupported, kernel-source, kernel-devel, kernel-PAE,
kernel-PAE-debug.
Note that because these are provides, and not just package names, kernel-devel will also apply to kernel-debug-devel, etc.
Note that "kernel-modules" is not in this list, in RHEL-6, and so anything providing that is updated like any other package.
installonly_limit Number of packages listed in installonlypkgs to keep installed at the same time. Setting to 0 disables this feature. Default
is ’3’. Note that this functionality used to be in the "installonlyn" plugin, where this option was altered via tokeep. Note that as of ver-
sion 3.2.24, yum will now look in the yumdb for a installonly attribute on installed packages. If that attribute is "keep", then they will
never be removed.
kernelpkgnames List of package names that are kernels. This is really only here for the updating of kernel packages and should be removed out
in the yum 2.1 series.
showdupesfromrepos Either ‘0’ or ‘1’. Set to ‘1’ if you wish to show any duplicate packages from any repository, from package listings like
the info or list commands. Set to ‘0’ if you want only to see the newest packages from any repository. Default is ‘0’.
obsoletes This option only has affect during an update. It enables yum’s obsoletes processing logic. Useful when doing distribution level
upgrades. See also the yum upgrade command documentation for more details (yum(8)). Default is ‘true’.
Command-line option: --obsoletes
overwrite_groups Either ‘0’ or ‘1’. Used to determine yum’s behaviour if two or more repositories offer the package groups with the same name.
If overwrite_groups is ‘1’ then the group packages of the last matching repository will be used. If overwrite_groups is ‘0’ then the groups
from all matching repositories will be merged together as one large group.
groupremove_leaf_only Either ‘0’ or ‘1’. Used to determine yum’s behaviour when the groupremove command is run. If groupremove_leaf_only is
‘0’ (default) then all packages in the group will be removed. If groupremove_leaf_only is ‘1’ then only those packages in the group that
aren’t required by another package will be removed.
enable_group_conditionals Either ‘0’ or ‘1’. Determines whether yum will allow the use of conditionals packages. Default is ‘1’ (package con-
ditionals are allowed).
group_package_types List of the following: optional, default, mandatory. Tells yum which type of packages in groups will be installed when
’groupinstall’ is called. Default is: default, mandatory
installroot Specifies an alternative installroot, relative to which all packages will be installed.
Command-line option: --installroot
distroverpkg The package used by yum to determine the "version" of the distribution. This can be any installed package. Default is ‘redhat-
release’. You can see what provides this manually by using: "yum whatprovides redhat-release".
diskspacecheck Either ‘0’ or ‘1’. Set this to ‘0’ to disable the checking for sufficient diskspace before a RPM transaction is run. Default is
‘1’ (perform the check).
tsflags Comma or space separated list of transaction flags to pass to the rpm transaction set. These include ’noscripts’, ’notriggers’,
’nodocs’, ’test’, ’justdb’ and ’nocontexts’. ’repackage’ is also available but that does nothing with newer rpm versions. You can set all/any
of them. However, if you don’t know what these do in the context of an rpm transaction set you’re best leaving it alone. Default is an empty
list.
recent Number of days back to look for ‘recent’ packages added to a repository. Used by the list recent command. Default is ‘7’.
retries Set the number of times any attempt to retrieve a file should retry before returning an error. Setting this to ‘0’ makes yum try for-
ever. Default is ‘10’.
keepalive Either ‘0’ or ‘1’. Set whether HTTP keepalive should be used for HTTP/1.1 servers that support it. This can improve transfer speeds
by using one connection when downloading multiple files from a repository. Default is ‘1’.
timeout Number of seconds to wait for a connection before timing out. Defaults to 30 seconds. This may be too short of a time for extremely
overloaded sites.
http_caching Determines how upstream HTTP caches are instructed to handle any HTTP downloads that Yum does. This option can take the following
values:
‘all’ means that all HTTP downloads should be cached.
‘packages’ means that only RPM package downloads should be cached (but not repository metadata downloads).
‘none’ means that no HTTP downloads should be cached.
The default is ‘all’. This is recommended unless you are experiencing caching related issues. Try to at least use ‘packages’ to minimize load
on repository servers.
throttle Enable bandwidth throttling for downloads. This option can be expressed as a absolute data rate in bytes/sec. An SI prefix (k, M or
G) may be appended to the bandwidth value (eg. ‘5.5k’ is 5.5 kilobytes/sec, ‘2M’ is 2 Megabytes/sec).
Alternatively, this option can specify the percentage of total bandwidth to use (eg. ‘60%’). In this case the bandwidth option should be used
to specify the maximum available bandwidth.
Set to ‘0’ to disable bandwidth throttling. This is the default.
bandwidth Use to specify the maximum available network bandwidth in bytes/second. Used with the throttle option (above). If throttle is a
percentage and bandwidth is ‘0’ then bandwidth throttling will be disabled. If throttle is expressed as a data rate (bytes/sec) then this
option is ignored. Default is ‘0’ (no bandwidth throttling).
sslcacert Path to the directory containing the databases of the certificate authorities yum should use to verify SSL certificates. Defaults to
none - uses system default
sslverify Boolean - should yum verify SSL certificates/hosts at all. Defaults to True.
Note that the plugin yum-rhn-plugin will force this value to true, and may alter other ssl settings (like hostname checking), even if it the
machine is not registered.
sslclientcert Path to the SSL client certificate yum should use to connect to repos/remote sites Defaults to none.
Note that if you are using curl compiled against NSS (default in Fedora/RHEL), curl treats sslclientcert values with the same basename as
_identical_. This version of yum will check that this isn’t true and output an error when the repositories "foo" and "bar" violate this, like
so:
sslclientcert basename shared between foo and bar
sslclientkey Path to the SSL client key yum should use to connect to repos/remote sites Defaults to none.
ssl_check_cert_permissions Boolean - Whether yum should check the permissions on the paths for the certificates on the repository (both remote
and local). If we can’t read any of the files then yum will force skip_if_unavailable to be true. This is most useful for non-root processes
which use yum on repos. that have client cert files which are readable only by root. Defaults to True.
history_record Boolean - should yum record history entries for transactions. This takes some disk space, and some extra time in the transac-
tions. But it allows how to know a lot of information about what has happened before, and display it to the user with the history
info/list/summary commands. yum also provides the history undo/redo commands. Defaults to True.
Note that if history is recorded, yum uses that information to see if any modifications to the rpmdb have been done outside of yum. These are
always bad, from yum’s point of view, and so yum will issue a warning and automatically run some of "yum check" to try and find some of the
worst problems altering the rpmdb might have caused.
This means that turning this option off will stop yum from being able to detect when the rpmdb has changed and thus. it will never warn you or
automatically run "yum check". The problems will likely still be there, and yumdb etc. will still be wrong but yum will not warn you about it.
history_record_packages This is a list of package names that should be recorded as having helped the transaction. yum plugins have an API to
add themselves to this, so it should not normally be necessary to add packages here. Not that this is also used for the packages to look for
in --version. Defaults to rpm, yum, yum-metadata-parser.
history_list_view Which column of information to display in the "yum history list" command. There are currently three options: users, cmds (or
commands), single-user-commands.
Older versions of yum acted like "users", which always outputs the user who initiated the yum transaction. You can now specify "commands"
which will instead always output the command line of the transaction. You can also specify "single-user-commands" which will display the users
if there are more than one, otherwise it will display the command line.
You can also specify "default" which currently selects "users".
commands List of functional commands to run if no functional commands are specified on the command line (eg. "update foo bar baz quux"). None
of the short options (eg. -y, -e, -d) are accepted for this option.
syslog_ident Identification (program name) for syslog messages.
syslog_facility Facility name for syslog messages, see syslog(3). Default is ‘LOG_USER’.
syslog_device Where to log syslog messages. Can be a local device (path) or a host:port string to use a remote syslog. If empty or points to
a nonexistent device, syslog logging is disabled. Default is ‘/dev/log’.
proxy URL to the proxy server that yum should use.
proxy_username username to use for proxy
proxy_password password for this proxy
username username to use for basic authentication to a repo or really any url.
password password to use with the username for basic authentication.
plugins Either ‘0’ or ‘1’. Global switch to enable or disable yum plugins. Default is ‘0’ (plugins disabled). See the PLUGINS section of the
yum(8) man for more information on installing yum plugins.
pluginpath A list of directories where yum should look for plugin modules. Default is ‘/usr/share/yum-plugins’ and ‘/usr/lib/yum-plugins’.
pluginconfpath A list of directories where yum should look for plugin configuration files. Default is ‘/etc/yum/pluginconf.d’.
metadata_expire Time (in seconds) after which the metadata will expire. So that if the current metadata downloaded is less than this many sec-
onds old then yum will not update the metadata against the repository. If you find that yum is not downloading information on updates as
often as you would like lower the value of this option. You can also change from the default of using seconds to using days, hours or minutes
by appending a d, h or m respectively. The default is 6 hours, to compliment yum-updatesd running once an hour. It’s also possible to use
the word "never", meaning that the metadata will never expire. Note that when using a metalink file the metalink must always be newer than the
metadata for the repository, due to the validation, so this timeout also applies to the metalink file.
mirrorlist_expire Time (in seconds) after which the mirrorlist locally cached will expire. If the current mirrorlist is less than this many
seconds old then yum will not download another copy of the mirrorlist, it has the same extra format as metadata_expire. If you find that yum
is not downloading the mirrorlists as often as you would like lower the value of this option.
mdpolicy You can select from different metadata download policies depending on how much data you want to download with the main repository
metadata index. The advantages of downloading more metadata with the index is that you can’t get into situations where you need to use that
metadata later and the versions available aren’t compatible (or the user lacks privileges) and that if the metadata is corrupt in any way yum
will revert to the previous metadata.
‘instant’ - Just download the new metadata index, this is roughly what yum always did, however it now does some checking on the index and
reverts if it classifies it as bad.
‘group:primary’ - Download the primary metadata with the index. This contains most of the package information and so is almost always required
anyway. This is the default.
‘group:small’ - With the primary also download the updateinfo metadata, this is required for yum-security operations and it also used in the
graphical clients. This file also tends to be significantly smaller than most others.
‘group:main’ - With the primary and updateinfo download the filelists metadata and the group metadata. The filelists data is required for
operations like "yum install /bin/bash", and also some dependency resolutions require it. The group data is used in some graphical clients and
for group operations like "yum grouplist Base".
‘group:all’ - Download all metadata listed in the index, currently the only one not listed above is the other metadata, which contains the
changelog information which is used by yum-changelog. This is what "yum makecache" uses.
multilib_policy Can be set to ’all’ or ’best’. All means install all possible arches for any package you want to install. Therefore yum
install foo will install foo.i386 and foo.x86_64 on x86_64, if it is available. Best means install the best arch for this platform, only.
bugtracker_url URL where bugs should be filed for yum. Configurable for local versions or distro-specific bugtrackers.
color Display colorized output automatically, depending on the output terminal, always (using ANSI codes) or never. Command-line option:
--color
color_list_installed_older The colorization/highlighting for packages in list/info installed which are older than the latest available package
with the same name and arch. Default is ‘bold’. Possible values are a comma separated list containing: bold, blink, dim, reverse, underline,
fg:black, fg:red, fg:green, fg:yellow, fg:blue, fg:magenta, fg:cyan, fg:white, bg:black, bg:red, bg:green, bg:yellow, bg:blue, bg:magenta,
bg:cyan, bg:white.
color_list_installed_newer The colorization/highlighting for packages in list/info installed which are newer than the latest available package
with the same name and arch. Default is ‘bold,yellow’. See color_list_installed_older for possible values.
color_list_installed_reinstall The colorization/highlighting for packages in list/info installed which is the same version as the latest
available package with the same name and arch. Default is ‘normal’. See color_list_installed_older for possible values.
color_list_installed_extra The colorization/highlighting for packages in list/info installed which has no available package with the same name
and arch. Default is ‘bold,red’. See color_list_installed_older for possible values.
color_list_available_upgrade The colorization/highlighting for packages in list/info available which is an upgrade for the latest installed
package with the same name and arch. Default is ‘bold,blue’. See color_list_installed_older for possible values.
color_list_available_downgrade The colorization/highlighting for packages in list/info available which is a downgrade for the latest installed
package with the same name and arch. Default is ‘dim,cyan’. See color_list_installed_older for possible values.
color_list_available_install The colorization/highlighting for packages in list/info available which has no installed package with the same
name and arch. Default is ‘normal’. See color_list_installed_older for possible values.
color_list_available_reinstall The colorization/highlighting for packages in list/info available which is the same version as the installed
package with the same name and arch. Default is ‘bold,underline,green. See color_list_installed_older for possible values.
color_search_match The colorization/highlighting for text matches in search. Default is ‘bold’. See color_list_installed_older for possible
values.
color_update_installed The colorization/highlighting for packages in the "updates list" which are installed. The updates list is what is
printed when you run "yum update", "yum list updates", "yum list obsoletes" and "yum check-update". Default is ‘normal’. See
color_list_installed_older for possible values.
color_update_local The colorization/highlighting for packages in the "updates list" which are already downloaded. The updates list is what is
printed when you run "yum update", "yum list updates", "yum list obsoletes" and "yum check-update". Default is ‘bold’. See
color_list_installed_older for possible values.
color_update_remote The colorization/highlighting for packages in the "updates list" which need to be downloaded. The updates list is what is
printed when you run "yum update", "yum list updates", "yum list obsoletes" and "yum check-update". Default is ‘normal’. See
color_list_installed_older for possible values.
clean_requirements_on_remove When removing packages (by removal, update or obsoletion) go through each package’s dependencies. If any of them
are no longer required by any other package then also mark them to be removed. Boolean (1, 0, True, False, yes,no) Defaults to False
reset_nice If set to true then yum will try to reset the nice value to zero, before running an rpm transaction. Defaults to True.
depsolve_loop_limit Set the number of times any attempt to depsolve before we just give up. This shouldn’t be needed as yum should always
solve or fail, however it has been observed that it can loop forever with very large system upgrades. Setting this to ‘0’ (or "<forever>")
makes yum try forever. Default is ‘100’.
[repository] OPTIONS
The repository section(s) take the following form:
Example: [repositoryid]
name=Some name for this repository
baseurl=url://path/to/repository/
repositoryid Must be a unique name for each repository, one word.
name A human readable string describing the repository.
baseurl Must be a URL to the directory where the yum repository’s ‘repodata’ directory lives. Can be an http://, ftp:// or file:// URL. You
can specify multiple URLs in one baseurl statement. The best way to do this is like this:
[repositoryid]
name=Some name for this repository
baseurl=url://server1/path/to/repository/
url://server2/path/to/repository/
url://server3/path/to/repository/
If you list more than one baseurl= statement in a repository you will find yum will ignore the earlier ones and probably act bizarrely. Don’t
do this, you’ve been warned.
You can use HTTP basic auth by prepending "user:password@" to the server name in the baseurl line. For example:
"baseurl=http://user:passwd@example.com/".
metalink Specifies a URL to a metalink file for the repomd.xml, a list of mirrors for the entire repository are generated by converting the
mirrors for the repomd.xml file to a baseurl. The metalink file also contains the latest timestamp from the data in the repomd.xml, the length
of the repomd.xml and checksum data. This data is checked against any downloaded repomd.xml file and all of the information from the metalink
file must match. This can be used instead of or with the baseurl option. Substitution variables, described below, can be used with this
option. This option disables the mirrorlist option. As a special hack is the mirrorlist URL contains the word "metalink" then the value of
mirrorlist is copied to metalink (if metalink is not set).
mirrorlist Specifies a URL to a file containing a list of baseurls. This can be used instead of or with the baseurl option. Substitution vari-
ables, described below, can be used with this option. As a special hack is the mirrorlist URL contains the word "metalink" then the value of
mirrorlist is copied to metalink (if metalink is not set).
enabled Either ‘1’ or ‘0’. This tells yum whether or not use this repository.
gpgcheck Either ‘1’ or ‘0’. This tells yum whether or not it should perform a GPG signature check on the packages gotten from this repository.
repo_gpgcheck Either ‘1’ or ‘0’. This tells yum whether or not it should perform a GPG signature check on the repodata from this repository.
gpgkey A URL pointing to the ASCII-armored GPG key file for the repository. This option is used if yum needs a public key to verify a package
and the required key hasn’t been imported into the RPM database. If this option is set, yum will automatically import the key from the speci-
fied URL. You will be prompted before the key is installed unless the assumeyes option is set.
Multiple URLs may be specified here in the same manner as the baseurl option (above). If a GPG key is required to install a package from a
repository, all keys specified for that repository will be installed.
gpgcakey A URL pointing to the ASCII-armored CA key file for the repository. This is a normal gpg public key - but this key will be used to
validate detached signatures of all other keys. The idea is you are asked to confirm import for this key. After that any other gpg key needed
for package or repository verification, if it has a detached signature which matches this key will be automatically imported without user con-
firmation.
exclude Same as the [main] exclude option but only for this repository. Substitution variables, described below, are honored here.
includepkgs Inverse of exclude. This is a list of packages you want to use from a repository. If this option lists only one package then that
is all yum will ever see from the repository. Defaults to an empty list. Substitution variables, described below, are honored here.
enablegroups Either ‘0’ or ‘1’. Determines whether yum will allow the use of package groups for this repository. Default is ‘1’ (package
groups are allowed).
failovermethod Either ‘roundrobin’ or ‘priority’.
‘roundrobin’ randomly selects a URL out of the list of URLs to start with and proceeds through each of them as it encounters a failure con-
tacting the host.
‘priority’ starts from the first baseurl listed and reads through them sequentially.
failovermethod defaults to ‘roundrobin’ if not specified.
keepalive Either ‘1’ or ‘0’. This tells yum whether or not HTTP/1.1 keepalive should be used with this repository. See the global option in
the [main] section above for more information.
timeout Overrides the timeout option from the [main] section for this repository.
http_caching Overrides the http_caching option from the [main] section for this repository.
retries Overrides the retries option from the [main] section for this repository.
throttle Overrides the throttle option from the [main] section for this repository.
bandwidth Overrides the bandwidth option from the [main] section for this repository.
sslcacert Overrides the sslcacert option from the [main] section for this repository.
sslverify Overrides the sslverify option from the [main] section for this repository.
sslclientcert Overrides the sslclientcert option from the [main] section for this repository.
sslclientkey Overrides the sslclientkey option from the [main] section for this repository.
ssl_check_cert_permissions Overrides the ssl_check_cert_permissions option from the [main] section for this repository.
metadata_expire Overrides the metadata_expire option from the [main] section for this repository.
mirrorlist_expire Overrides the mirrorlist_expire option from the [main] section for this repository.
proxy URL to the proxy server for this repository. Set to ’_none_’ to disable the global proxy setting for this repository. If this is unset
it inherits it from the global setting
proxy_username username to use for proxy. If this is unset it inherits it from the global setting
proxy_password password for this proxy. If this is unset it inherits it from the global setting
username username to use for basic authentication to a repo or really any url. If this is unset it inherits it from the global setting
password password to use with the username for basic authentication. If this is unset it inherits it from the global setting
cost relative cost of accessing this repository. Useful for weighing one repo’s packages as greater/less than any other. defaults to 1000
skip_if_unavailable If set to True yum will continue running if this repository cannot be contacted for any reason. This should be set care-
fully as all repos are consulted for any given command. Defaults to False.
URL INCLUDE SYNTAX
The inclusion of external configuration files is supported for /etc/yum.conf and the .repo files in the /etc/yum.repos.d directory. To include a URL,
use a line of the following format:
include=url://to/some/location
The configuration file will be inserted at the position of the "include=" line. Included files may contain further include lines. Yum will abort
with an error if an inclusion loop is detected.
GLOB: FOR LIST OPTIONS
Any of the configurations options which are a list of items can be specfied using the glob syntax: glob:/etc/path/somewhere.d/*.conf. This will read
in all files matching that glob and include all lines in each file (excluding comments and blank lines) as items in the list.
VARIABLES
There are a number of variables you can use to ease maintenance of yum’s configuration files. They are available in the values of several options
including name, baseurl and commands.
$releasever This will be replaced with the value of the version of the package listed in distroverpkg. This defaults to the version of ‘red-
hat-release’ package.
$arch This will be replaced with the architecture or your system as detected by yum.
$basearch This will be replaced with your base architecture in yum. For example, if your $arch is i686 your $basearch will be i386.
$uuid This will be replaced with a unique but persistent uuid for this machine. The value that is first generated will be stored in
/var/lib/yum/uuid and reused until this file is deleted.
$YUM0-$YUM9 These will be replaced with the value of the shell environment variable of the same name. If the shell environment variable does
not exist then the configuration file variable will not be replaced.
As of 3.2.28, any properly named file in /etc/yum/vars is turned into a variable named after the filename (or overrides any of the above variables).
Filenames may contain only alphanumeric characters and underscores and be in lowercase.
Note that no warnings/errors are given if the files are unreadable, so creating files that only root can read may be confusing for users.
Also note that only the first line will be read and all new line characters are removed, as a convenience. However, no other checking is performed on
the data. This means it is possible to have bad character data in any value.
FILES
/etc/yum.conf
/etc/yum.repos.d/
/etc/yum/pluginconf.d/
/etc/yum/protected.d
/etc/yum/vars
SEE ALSO
yum(8)
Seth Vidal yum.conf(5)
LOGROTATE(8) System Administrator’s Manual LOGROTATE(8)
NAME
logrotate - rotates, compresses, and mails system logs
SYNOPSIS
logrotate [-dv] [-f|--force] [-s|--state file] config_file ..
DESCRIPTION
logrotate is designed to ease administration of systems that generate large numbers of log files. It allows automatic rotation, compression,
removal, and mailing of log files. Each log file may be handled daily, weekly, monthly, or when it grows too large.
Normally, logrotate is run as a daily cron job. It will not modify a log multiple times in one day unless the criterion for that log is based on
the log’s size and logrotate is being run multiple times each day, or unless the -f or --force option is used.
Any number of config files may be given on the command line. Later config files may override the options given in earlier files, so the order in
which the logrotate config files are listed is important. Normally, a single config file which includes any other config files which are needed
should be used. See below for more information on how to use the include directive to accomplish this. If a directory is given on the command
line, every file in that directory is used as a config file.
If no command line arguments are given, logrotate will print version and copyright information, along with a short usage summary. If any errors
occur while rotating logs, logrotate will exit with non-zero status.
OPTIONS
-d, --debug
Turns on debug mode and implies -v. In debug mode, no changes will be made to the logs or to the logrotate state file.
-f, --force
Tells logrotate to force the rotation, even if it doesn’t think this is necessary. Sometimes this is useful after adding new entries to a
logrotate config file, or if old log files have been removed by hand, as the new files will be created, and logging will continue cor-
rectly.
-m, --mail <command>
Tells logrotate which command to use when mailing logs. This command should accept two arguments: 1) the subject of the message, and 2) the
recipient. The command must then read a message on standard input and mail it to the recipient. The default mail command is /bin/mail -s.
-s, --state <statefile>
Tells logrotate to use an alternate state file. This is useful if logrotate is being run as a different user for various sets of log
files. The default state file is /var/lib/logrotate.status.
--usage
Prints a short usage message.
--?, --help
-Prints help message.
-v, --verbose
Turns on verbose mode.
CONFIGURATION FILE
logrotate reads everything about the log files it should be handling from the series of configuration files specified on the command line. Each
configuration file can set global options (local definitions override global ones, and later definitions override earlier ones) and specify log-
files to rotate. A simple configuration file looks like this:
# sample logrotate configuration file
compress
/var/log/messages {
rotate 5
weekly
postrotate
/usr/bin/killall -HUP syslogd
endscript
}
"/var/log/httpd/access.log" /var/log/httpd/error.log {
rotate 5
mail www@my.org
size 100k
sharedscripts
postrotate
/usr/bin/killall -HUP httpd
endscript
}
/var/log/news/* {
monthly
rotate 2
olddir /var/log/news/old
missingok
postrotate
kill -HUP ‘cat /var/run/inn.pid‘
endscript
nocompress
}
The first few lines set global options; in the example, logs are compressed after they are rotated. Note that comments may appear anywhere in the
config file as long as the first non-whitespace character on the line is a #.
The next section of the config files defined how to handle the log file /var/log/messages. The log will go through five weekly rotations before
being removed. After the log file has been rotated (but before the old version of the log has been compressed), the command /sbin/killall -HUP
syslogd will be executed.
The next section defines the parameters for both /var/log/httpd/access.log and /var/log/httpd/error.log. They are rotated whenever it grows over
100k in size, and the old logs files are mailed (uncompressed) to www@my.org after going through 5 rotations, rather than being removed. The
sharedscripts means that the postrotate script will only be run once (after the old logs have been compressed), not once for each log which is
rotated. Note that the double quotes around the first filename at the beginning of this section allows logrotate to rotate logs with spaces in the
name. Normal shell quoting rules apply, with ’, ", and characters supported.
The last section defines the parameters for all of the files in /var/log/news. Each file is rotated on a monthly basis. This is considered a sin-
gle rotation directive and if errors occur for more than one file, the log files are not compressed.
Please use wildcards with caution. If you specify *, logrotate will rotate all files, including previously rotated ones. A way around this is to
use the olddir directive or a more exact wildcard (such as *.log).
Here is more information on the directives which may be included in a logrotate configuration file:
compress
Old versions of log files are compressed with gzip(1) by default. See also nocompress.
compresscmd
Specifies which command to use to compress log files. The default is gzip. See also compress.
uncompresscmd
Specifies which command to use to uncompress log files. The default is gunzip.
compressext
Specifies which extension to use on compressed logfiles, if compression is enabled. The default follows that of the configured compression
command.
compressoptions
Command line options may be passed to the compression program, if one is in use. The default, for gzip(1), is "-9" (maximum compression).
copy Make a copy of the log file, but don’t change the original at all. This option can be used, for instance, to make a snapshot of the cur-
rent log file, or when some other utility needs to truncate or parse the file. When this option is used, the create option will have no
effect, as the old log file stays in place.
copytruncate
Truncate the original log file in place after creating a copy, instead of moving the old log file and optionally creating a new one. It
can be used when some program cannot be told to close its logfile and thus might continue writing (appending) to the previous log file for-
ever. Note that there is a very small time slice between copying the file and truncating it, so some logging data might be lost. When
this option is used, the create option will have no effect, as the old log file stays in place.
create mode owner group, create owner group
Immediately after rotation (before the postrotate script is run) the log file is created (with the same name as the log file just rotated).
mode specifies the mode for the log file in octal (the same as chmod(2)), owner specifies the user name who will own the log file, and
group specifies the group the log file will belong to. Any of the log file attributes may be omitted, in which case those attributes for
the new file will use the same values as the original log file for the omitted attributes. This option can be disabled using the nocreate
option.
daily Log files are rotated every day.
dateext
Archive old versions of log files adding a daily extension like YYYYMMDD instead of simply adding a number. The extension may be configured
using the dateformat option.
dateformat format_string
Specify the extension for dateext using the notation similar to strftime(3) function. Only %Y %m %d and %s specifiers are allowed. The
default value is -%Y%m%d. Note that also the character separating log name from the extension is part of the dateformat string. The system
clock must be set past Sep 9th 2001 for %s to work correctly. Note that the datestamps generated by this format must be lexically sortable
(i.e., first the year, then the month then the day. e.g., 2001/12/01 is ok, but 01/12/2001 is not, since 01/11/2002 would sort lower while
it is later). This is because when using the rotate option, logrotate sorts all rotated filenames to find out which logfiles are older and
should be removed.
delaycompress
Postpone compression of the previous log file to the next rotation cycle. This only has effect when used in combination with compress. It
can be used when some program cannot be told to close its logfile and thus might continue writing to the previous log file for some time.
extension ext
Log files with ext extension can keep it after the rotation. If compression is used, the compression extension (normally .gz) appears
after ext. For example you have a logfile named mylog.foo and want to rotate it to mylog.1.foo.gz instead of mylog.foo.1.gz.
ifempty
Rotate the log file even if it is empty, overriding the notifempty option (ifempty is the default).
include file_or_directory
Reads the file given as an argument as if it was included inline where the include directive appears. If a directory is given, most of the
files in that directory are read in alphabetic order before processing of the including file continues. The only files which are ignored
are files which are not regular files (such as directories and named pipes) and files whose names end with one of the taboo extensions, as
specified by the tabooext directive. The include directive may not appear inside a log file definition.
mail address
When a log is rotated out-of-existence, it is mailed to address. If no mail should be generated by a particular log, the nomail directive
may be used.
mailfirst
When using the mail command, mail the just-rotated file, instead of the about-to-expire file.
maillast
When using the mail command, mail the about-to-expire file, instead of the just-rotated file (this is the default).
maxage count
Remove rotated logs older than <count> days. The age is only checked if the logfile is to be rotated. The files are mailed to the config-
ured address if maillast and mail are configured.
minsize size
Log files are rotated when they grow bigger than size bytes, but not before the additionally specified time interval (daily, weekly,
monthly, or yearly). The related size option is similar except that it is mutually exclusive with the time interval options, and it causes
log files to be rotated without regard for the last rotation time. When minsize is used, both the size and timestamp of a log file are
considered.
missingok
If the log file is missing, go on to the next one without issuing an error message. See also nomissingok.
monthly
Log files are rotated the first time logrotate is run in a month (this is normally on the first day of the month).
nocompress
Old versions of log files are not compressed. See also compress.
nocopy Do not copy the original log file and leave it in place. (this overrides the copy option).
nocopytruncate
Do not truncate the original log file in place after creating a copy (this overrides the copytruncate option).
nocreate
New log files are not created (this overrides the create option).
nodelaycompress
Do not postpone compression of the previous log file to the next rotation cycle (this overrides the delaycompress option).
nodateext
Do not archive old versions of log files with date extension (this overrides the dateext option).
nomail Don’t mail old log files to any address.
nomissingok
If a log file does not exist, issue an error. This is the default.
noolddir
Logs are rotated in the same directory the log normally resides in (this overrides the olddir option).
nosharedscripts
Run prerotate and postrotate scripts for every log file which is rotated (this is the default, and overrides the sharedscripts option). The
absolute path to the log file is passed as first argument to the script. If the scripts exit with error, the remaining actions will not be
executed for the affected log only.
noshred
Do not use shred when deleting old log files. See also shred.
notifempty
Do not rotate the log if it is empty (this overrides the ifempty option).
olddir directory
Logs are moved into directory for rotation. The directory must be on the same physical device as the log file being rotated, and is assumed
to be relative to the directory holding the log file unless an absolute path name is specified. When this option is used all old versions
of the log end up in directory. This option may be overridden by the noolddir option.
postrotate/endscript
The lines between postrotate and endscript (both of which must appear on lines by themselves) are executed (using /bin/sh) after the log
file is rotated. These directives may only appear inside a log file definition. Normally, the absolute path to the log file is passed as
first argument to the script. If sharedscripts is specified, whole pattern is passed to the script. See also prerotate. See sharedscripts
and nosharedscripts for error handling.
prerotate/endscript
The lines between prerotate and endscript (both of which must appear on lines by themselves) are executed (using /bin/sh) before the log
file is rotated and only if the log will actually be rotated. These directives may only appear inside a log file definition. Normally, the
absolute path to the log file is passed as first argument to the script. If sharedscripts is specified, whole pattern is passed to the
script. See also postrotate. See sharedscripts and nosharedscripts for error handling.
firstaction/endscript
The lines between firstaction and endscript (both of which must appear on lines by themselves) are executed (using /bin/sh) once before all
log files that match the wildcarded pattern are rotated, before prerotate script is run and only if at least one log will actually be
rotated. These directives may only appear inside a log file definition. Whole pattern is passed to the script as first argument. If the
script exits with error, no further processing is done. See also lastaction.
lastaction/endscript
The lines between lastaction and endscript (both of which must appear on lines by themselves) are executed (using /bin/sh) once after all
log files that match the wildcarded pattern are rotated, after postrotate script is run and only if at least one log is rotated. These
directives may only appear inside a log file definition. Whole pattern is passed to the script as first argument. If the script exits with
error, just an error message is shown (as this is the last action). See also firstaction.
rotate count
Log files are rotated count times before being removed or mailed to the address specified in a mail directive. If count is 0, old versions
are removed rather than rotated.
size size
Log files are rotated only if they grow bigger then size bytes. If size is followed by k, the size is assumed to be in kilobytes. If the M
is used, the size is in megabytes, and if G is used, the size is in gigabytes. So size 100, size 100k, size 100M and size 100Gare all
valid.
sharedscripts
Normally, prerotate and postrotate scripts are run for each log which is rotated and the absolute path to the log file is passed as first
argument to the script. That means a single script may be run multiple times for log file entries which match multiple files (such as the
/var/log/news/* example). If sharedscripts is specified, the scripts are only run once, no matter how many logs match the wildcarded pat-
tern, and whole pattern is passed to them. However, if none of the logs in the pattern require rotating, the scripts will not be run at
all. If the scripts exit with error, the remaining actions will not be executed for any logs. This option overrides the nosharedscripts
option and implies create option.
shred Delete log files using shred -u instead of unlink(). This should ensure that logs are not readable after their scheduled deletion; this is
off by default. See also noshred.
shredcycles count
Asks GNU shred(1) to overwite log files count times before deletion. Without this option, shred’s default will be used.
start count
This is the number to use as the base for rotation. For example, if you specify 0, the logs will be created with a .0 extension as they are
rotated from the original log files. If you specify 9, log files will be created with a .9, skipping 0-8. Files will still be rotated the
number of times specified with the count directive.
tabooext [+] list
The current taboo extension list is changed (see the include directive for information on the taboo extensions). If a + precedes the list
of extensions, the current taboo extension list is augmented, otherwise it is replaced. At startup, the taboo extension list contains
.rpmorig, .rpmsave, ,v, .swp, .rpmnew, ~, .cfsaved and .rhn-cfg-tmp-*.
weekly Log files are rotated if the current weekday is less than the weekday of the last rotation or if more than a week has passed since the last
rotation. This is normally the same as rotating logs on the first day of the week, but it works better if logrotate is not run every night.
yearly Log files are rotated if the current year is not the same as the last rotation.
FILES
/var/lib/logrotate.status Default state file.
/etc/logrotate.conf Configuration options.
SEE ALSO
gzip(1)
<http://fedorahosted.org/logrotate/>
AUTHORS
Erik Troan, Preston Brown, Jan Kaluza.
<logrotate-owner@fedoraproject.org>
Linux Wed Nov 5 2002 LOGROTATE(8)
Cent OS Repository
CentOS-Base.repo
CentOS-Debuginfo.repo
CentOS-Media.repo
CentOS-Vault.repo
CentOS-fasttrack.repo
# CentOS-Base.repo # # The mirror system uses the connecting IP address of the client and the # update status of each mirror to pick mirrors that are updated to and # geographically close to the client. You should use this for CentOS updates # unless you are manually picking other mirrors. # # If the mirrorlist= does not work for you, as a fall back you can try the # remarked out baseurl= line instead. # # [base] name=CentOS-$releasever - Base mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os&infra=$infra #baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/ gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6 #released updates [updates] name=CentOS-$releasever - Updates mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates&infra=$infra #baseurl=http://mirror.centos.org/centos/$releasever/updates/$basearch/ gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6 #additional packages that may be useful [extras] name=CentOS-$releasever - Extras mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras&infra=$infra #baseurl=http://mirror.centos.org/centos/$releasever/extras/$basearch/ gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6 #additional packages that extend functionality of existing packages [centosplus] name=CentOS-$releasever - Plus mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus&infra=$infra #baseurl=http://mirror.centos.org/centos/$releasever/centosplus/$basearch/ gpgcheck=1 enabled=0 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6 #contrib - packages by Centos Users [contrib] name=CentOS-$releasever - Contrib mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=contrib&infra=$infra #baseurl=http://mirror.centos.org/centos/$releasever/contrib/$basearch/ gpgcheck=1 enabled=0 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
# CentOS-Debug.repo # # The mirror system uses the connecting IP address of the client and the # update status of each mirror to pick mirrors that are updated to and # geographically close to the client. You should use this for CentOS updates # unless you are manually picking other mirrors. # # All debug packages from all the various CentOS-5 releases # are merged into a single repo, split by BaseArch # # Note: packages in the debuginfo repo are currently not signed # [base-debuginfo] name=CentOS-6 - Debuginfo baseurl=http://debuginfo.centos.org/6/$basearch/ gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-Debug-6 enabled=0
# CentOS-Media.repo
#
# This repo can be used with mounted DVD media, verify the mount point for
# CentOS-6. You can use this repo and yum to install items directly off the
# DVD ISO that we release.
#
# To use this repo, put in your DVD and use it with the other repos too:
# yum --enablerepo=c6-media [command]
#
# or for ONLY the media repo, do this:
#
# yum --disablerepo=* --enablerepo=c6-media [command]
[c6-media]
name=CentOS-$releasever - Media
baseurl=file:///media/CentOS/
file:///media/cdrom/
file:///media/cdrecorder/
gpgcheck=1
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
# CentOS-Vault.repo # # CentOS Vault holds packages from previous releases within the same CentOS Version # these are packages obsoleted by the current release and should usually not # be used in production #----------------- [C6.0-base] name=CentOS-6.0 - Base baseurl=http://vault.centos.org/6.0/os/$basearch/ gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6 enabled=0 [C6.0-updates] name=CentOS-6.0 - Updates baseurl=http://vault.centos.org/6.0/updates/$basearch/ gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6 enabled=0 [C6.0-extras] name=CentOS-6.0 - Extras baseurl=http://vault.centos.org/6.0/extras/$basearch/ gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6 enabled=0 [C6.0-contrib] name=CentOS-6.0 - Contrib baseurl=http://vault.centos.org/6.0/contrib/$basearch/ gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6 enabled=0 [C6.0-centosplus] name=CentOS-6.0 - CentOSPlus baseurl=http://vault.centos.org/6.0/centosplus/$basearch/ gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6 enabled=0 #----------------- [C6.1-base] name=CentOS-6.1 - Base baseurl=http://vault.centos.org/6.1/os/$basearch/ gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6 enabled=0 [C6.1-updates] name=CentOS-6.1 - Updates baseurl=http://vault.centos.org/6.1/updates/$basearch/ gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6 enabled=0 [C6.1-extras] name=CentOS-6.1 - Extras baseurl=http://vault.centos.org/6.1/extras/$basearch/ gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6 enabled=0 [C6.1-contrib] name=CentOS-6.1 - Contrib baseurl=http://vault.centos.org/6.1/contrib/$basearch/ gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6 enabled=0 [C6.1-centosplus] name=CentOS-6.1 - CentOSPlus baseurl=http://vault.centos.org/6.1/centosplus/$basearch/ gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6 enabled=0 #----------------- [C6.2-base] name=CentOS-6.2 - Base baseurl=http://vault.centos.org/6.2/os/$basearch/ gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6 enabled=0 [C6.2-updates] name=CentOS-6.2 - Updates baseurl=http://vault.centos.org/6.2/updates/$basearch/ gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6 enabled=0 [C6.2-extras] name=CentOS-6.2 - Extras baseurl=http://vault.centos.org/6.2/extras/$basearch/ gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6 enabled=0 [C6.2-contrib] name=CentOS-6.2 - Contrib baseurl=http://vault.centos.org/6.2/contrib/$basearch/ gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6 enabled=0 [C6.2-centosplus] name=CentOS-6.2 - CentOSPlus baseurl=http://vault.centos.org/6.2/centosplus/$basearch/ gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6 enabled=0 #----------------- [C6.3-base] name=CentOS-6.3 - Base baseurl=http://vault.centos.org/6.3/os/$basearch/ gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6 enabled=0 [C6.3-updates] name=CentOS-6.3 - Updates baseurl=http://vault.centos.org/6.3/updates/$basearch/ gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6 enabled=0 [C6.3-extras] name=CentOS-6.3 - Extras baseurl=http://vault.centos.org/6.3/extras/$basearch/ gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6 enabled=0 [C6.3-contrib] name=CentOS-6.3 - Contrib baseurl=http://vault.centos.org/6.3/contrib/$basearch/ gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6 enabled=0 [C6.3-centosplus] name=CentOS-6.3 - CentOSPlus baseurl=http://vault.centos.org/6.3/centosplus/$basearch/ gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6 enabled=0 #----------------- [C6.4-base] name=CentOS-6.4 - Base baseurl=http://vault.centos.org/6.4/os/$basearch/ gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6 enabled=0 [C6.4-updates] name=CentOS-6.4 - Updates baseurl=http://vault.centos.org/6.4/updates/$basearch/ gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6 enabled=0 [C6.4-extras] name=CentOS-6.4 - Extras baseurl=http://vault.centos.org/6.4/extras/$basearch/ gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6 enabled=0 [C6.4-contrib] name=CentOS-6.4 - Contrib baseurl=http://vault.centos.org/6.4/contrib/$basearch/ gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6 enabled=0 [C6.4-centosplus] name=CentOS-6.4 - CentOSPlus baseurl=http://vault.centos.org/6.4/centosplus/$basearch/ gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6 enabled=0 #----------------- [C6.5-base] name=CentOS-6.5 - Base baseurl=http://vault.centos.org/6.5/os/$basearch/ gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6 enabled=0 [C6.5-updates] name=CentOS-6.5 - Updates baseurl=http://vault.centos.org/6.5/updates/$basearch/ gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6 enabled=0 [C6.5-extras] name=CentOS-6.5 - Extras baseurl=http://vault.centos.org/6.5/extras/$basearch/ gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6 enabled=0 [C6.5-contrib] name=CentOS-6.5 - Contrib baseurl=http://vault.centos.org/6.5/contrib/$basearch/ gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6 enabled=0 [C6.5-centosplus] name=CentOS-6.5 - CentOSPlus baseurl=http://vault.centos.org/6.5/centosplus/$basearch/ gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6 enabled=0
[fasttrack] name=CentOS-6 - fasttrack mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=fasttrack&infra=$infra #baseurl=http://mirror.centos.org/centos/$releasever/fasttrack/$basearch/ gpgcheck=1 enabled=0 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
Third Party Repository
epel.repo
epel-testing.repo
remi.repo
[epel] name=Extra Packages for Enterprise Linux 6 - $basearch #baseurl=http://download.fedoraproject.org/pub/epel/6/$basearch mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-6&arch=$basearch failovermethod=priority enabled=0 gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6 [epel-debuginfo] name=Extra Packages for Enterprise Linux 6 - $basearch - Debug #baseurl=http://download.fedoraproject.org/pub/epel/6/$basearch/debug mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-debug-6&arch=$basearch failovermethod=priority enabled=0 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6 gpgcheck=1 [epel-source] name=Extra Packages for Enterprise Linux 6 - $basearch - Source #baseurl=http://download.fedoraproject.org/pub/epel/6/SRPMS mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-source-6&arch=$basearch failovermethod=priority enabled=0 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6 gpgcheck=1
[epel-testing] name=Extra Packages for Enterprise Linux 6 - Testing - $basearch #baseurl=http://download.fedoraproject.org/pub/epel/testing/6/$basearch mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=testing-epel6&arch=$basearch failovermethod=priority enabled=0 gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6 [epel-testing-debuginfo] name=Extra Packages for Enterprise Linux 6 - Testing - $basearch - Debug #baseurl=http://download.fedoraproject.org/pub/epel/testing/6/$basearch/debug mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=testing-debug-epel6&arch=$basearch failovermethod=priority enabled=0 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6 gpgcheck=1 [epel-testing-source] name=Extra Packages for Enterprise Linux 6 - Testing - $basearch - Source #baseurl=http://download.fedoraproject.org/pub/epel/testing/6/SRPMS mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=testing-source-epel6&arch=$basearch failovermethod=priority enabled=0 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6 gpgcheck=1
[remi] name=Les RPM de remi pour Enterprise Linux 6 - $basearch #baseurl=http://rpms.famillecollet.com/enterprise/6/remi/$basearch/ mirrorlist=http://rpms.famillecollet.com/enterprise/6/remi/mirror enabled=0 gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-remi [remi-php55] name=Les RPM de remi de PHP 5.5 pour Enterprise Linux 6 - $basearch #baseurl=http://rpms.famillecollet.com/enterprise/6/php55/$basearch/ mirrorlist=http://rpms.famillecollet.com/enterprise/6/php55/mirror # WARNING: If you enable this repository, you must also enable "remi" enabled=0 gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-remi [remi-php56] name=Les RPM de remi de PHP 5.6 pour Enterprise Linux 6 - $basearch #baseurl=http://rpms.famillecollet.com/enterprise/6/php56/$basearch/ mirrorlist=http://rpms.famillecollet.com/enterprise/6/php56/mirror # WARNING: If you enable this repository, you must also enable "remi" enabled=0 gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-remi [remi-test] name=Les RPM de remi en test pour Enterprise Linux 6 - $basearch #baseurl=http://rpms.famillecollet.com/enterprise/6/test/$basearch/ mirrorlist=http://rpms.famillecollet.com/enterprise/6/test/mirror # WARNING: If you enable this repository, you must also enable "remi" enabled=0 gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-remi [remi-debuginfo] name=Les RPM de remi pour Enterprise Linux 6 - $basearch - debuginfo baseurl=http://rpms.famillecollet.com/enterprise/6/debug-remi/$basearch/ enabled=0 gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-remi [remi-php55-debuginfo] name=Les RPM de remi de PHP 5.5 pour Enterprise Linux 6 - $basearch - debuginfo baseurl=http://rpms.famillecollet.com/enterprise/6/debug-php55/$basearch/ enabled=0 gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-remi [remi-php56-debuginfo] name=Les RPM de remi de PHP 5.6 pour Enterprise Linux 6 - $basearch - debuginfo baseurl=http://rpms.famillecollet.com/enterprise/6/debug-php56/$basearch/ enabled=0 gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-remi [remi-test-debuginfo] name=Les RPM de remi en test pour Enterprise Linux 6 - $basearch - debuginfo baseurl=http://rpms.famillecollet.com/enterprise/6/debug-test/$basearch/ enabled=0 gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-remi
基本的な使用方法とヘルプ
Construction
Usage
Help
man yum
基本構文 yum [option] [command] [package] option -y:全てyesで処理が進められる。 command install:インストール remove:アンインストール update:アップデート check−updates:アップデート可能なパッケージリストを表示 list:listオプションで指定されたパッケージリストを表示 [updates | installed | available | extras | recent] [package | keyword] info:infoオプションで指定されたパッケージリストの情報、あるいは指定パッケージの情報を表示 [updates | installed | available | extras | recent] [package | keyword] search:続くkeywordにマッチするパッケージを検索しリスト表示 [package | keyword] clean:cleanオプションで指定されたデータを削除 [headers | packages | cache | metadata | all] history:histoyのサブコマンドの指定により、yumトランザクションの表示、履歴情報、復帰、繰り返し、ロールバック処理を行う [list | info | summary | rollback | undo | redo | new] [all | list-ID | list-ID..list-ID] ※コマンドやオプションは以上が全てではない。代表的なもののみを掲載。
### install package
[user@hostname ~]# yum install [package]
### uninstall package
[user@hostname ~]# yum remove [package]
### update packages
[user@hostname ~]# yum update
# アップデート可能なパッケージ全てをアップデート。カーネルもアップデートされる。
[user@hostname ~]# yum -y update
# -yオプションをつけることで、全てyesという返答で処理が進められる。
[user@hostname ~]# yum update [package]
# 特定のパッケージのみアップデート。
### check available package updates
[user@hostname ~]$ yum check-update [package | keyword]
# インストール済みパッケージよりアップデート可能なパッケージを表示。
### check package list
[user@hostname ~]$ yum list [updates | installed | available | extras | recent] [package | keyword]
# listオプションの指定がない場合、インストール済み、利用可能パッケージともに表示。
### check installed list
[user@hostname ~]$ yum list installed [package | keyword]
# インストール済みパッケージのリストを表示。
### check available package list
[user@hostname ~]$ yum list available [package | keyword]
# 未インストールの利用可能なパッケージを表示。
### check updatable package list
[user@hostname ~]$ yum list updates [package | keyword]
# インストール済みパッケージよりアップデート可能なパッケージを表示。
### check installed list recent
[user@hostname ~]$ yum list recent [package | keyword]
# 最近インストールされたパッケージをリスト表示。
### check package information
[user@hostname ~]$ yum info [updates | installed | available | extras | recent] [package | keyword]
# infoオプションの指定がない場合、インストール済み、利用可能パッケージともにパッケージ情報を表示。
### check installed packages information
[user@hostname ~]$ yum info installed [package | keyword]
# インストール済みパッケージのパッケージ情報を表示。
### check available package information
[user@hostname ~]$ yum info available [package | keyword]
# 利用可能なパッケージのパッケージ情報をを表示。
### check updatable packages information
[user@hostname ~]$ yum info updates [package | keyword]
# インストール済みパッケージよりアップデート可能なパッケージのパッケージ情報を表示。
### check installed recent packages information
[user@hostname ~]$ yum info recent [package | keyword]
# 最近インストールされたパッケージのパッケージ情報を表示。
### search available package
[user@hostname ~]$ yum search [package | keyword]
# 利用可能なパッケージよりkeywordにマッチするパッケージ検索し表示。
### check yum cache
[user@hostname ~]$ du -sh /var/cache/yum/
# ダウンロードされたパッケージ等のキャッシュ容量を表示。
# キャッシュされているデータは /var/cache/yum/ に保存されている。
### delete yum data (headers, packages, caches, metadata or all)
[user@hostname ~]# yum clean [headers | packages | cache | metadata | all]
# キャッシュされたデータを削除。削除対象は clearn オプションで指定可能。
### check yum-transaction history
[user@hostname ~]# yum history [list] [all | list-ID | list-ID..list-ID]
# historyのサブコマンド、キーワード指定がない場合、直近の20件の履歴を表示。
### check yum-transaction history all
[user@hostname ~]# yum history list all
# 現在保有している全てのトランザクションデータを表示。
### check yum-transaction information
[user@hostname ~]# yum history info [all | list-ID | list-ID..list-ID]
# ID指定されたトランザクションの詳細データを表示。指定がない場合、最後のトランザクションの詳細データを表示。
### undo yum-transaction
[user@hostname ~]# yum history undo [list-ID]
# ID指定されたトランザクションを実行前に戻す。対象となるパッケージが指定トランザクションでアップグレードされている場合、ダウングレードパッケージが利用可能ならダウングレードされる。
### undo yum-transaction
[user@hostname ~]# yum history redo [list-ID]
# ID指定されたトランザクションを再実行する。対象となるパッケージが指定トランザクションでアップグレードされている場合、ダウングレードパッケージが利用可能ならダウングレードされる。
### rollback yum-transaction
[user@hostname ~]# yum history rollback [list-ID]
# ID指定されたトランザクション実行後の状態までロールバックする。ロールバック後のパッケージが指定ID後のトランザクションでアップグレードされている場合、ダウングレードパッケージが利用可能ならダウングレードされる。
### clean & create new yum-transaction database
[user@hostname ~]# yum history new
# /var/lib/yum/history/ 内に新しいトランザクションデータベース(SQLite)を作成する。古いトランザクション履歴(データベース)は保存されるが、新しいデータベースがある限りアクセスはできない。
### check installed package
[user@hostname ~]$ rpm -qliv [package]
# インストールしたパッケージ情報の確認
### use EPEL repository
[user@hostname ~]# yum --enablerepo=epel <コマンド> <パッケージ名>
# epel.repo を使用してコマンドを実行する。
### check log file
[user@hostname ~]# cat /var/log/yum.log
[user@hostname ~]# tail /var/log/yum.log
[user@hostname ~]# tail -n 50 /var/log/yum.log
# yum.log を確認する。
Usage: yum [options] COMMAND
List of Commands:
check rpmdb の問題を確認する
check-update 更新に利用できるパッケージを確認する
clean キャッシュデータを削除する
deplist パッケージの依存性の一覧を表示する
distribution-synchronization 最新の利用可能なバージョンへインストール済みパッケージを同期する
downgrade パッケージのダウングレード
erase システムから削除するパッケージ
groupinfo パッケージグループについての詳細を表示する
groupinstall システムのグループのパッケージをインストールする
grouplist 利用できるパッケージグループの一覧
groupremove システムからグループのパッケージを削除する
help 役立つ使い方のメッセージを表示する
history トランザクション履歴を表示、使用する
info パッケージもしくはパッケージのグループについての詳細を表示する
install システムにパッケージをインストールする
list パッケージグループの一覧を表示する
load-transaction load a saved transaction from filename
makecache メタデータキャッシュを生成する
provides 指定値を提供するパッケージを検索する
reinstall パッケージの再インストール
repolist ソフトウェアリポジトリーの構成を表示する
resolvedep 指定の依存性を提供するパッケージがどれか特定する
search 指定した文字列でパッケージの詳細を検索する
shell 対話型の yum シェルを実行する
update システムのパッケージを更新する
update-minimal Works like update, but goes to the 'newest' package match which fixes a problem that affects your system
updateinfo Acts on repository update information
upgrade 不要になったパッケージを考慮しながらパッケージを更新する
version ホストの利用できるリポジトリーのバージョンを表示する
Options:
-h, --help このヘルプ メッセージを表示して終了する
-t, --tolerant エラーを黙認する
-C, --cacheonly キャッシュから完全に実行し、キャッシュを更新しません
-c [config file], --config=[config file]
構成ファイルの場所
-R [minutes], --randomwait=[minutes]
コマンドの最大待ち時間
-d [debug level], --debuglevel=[debug level]
デバッグ情報の出力レベル
--showduplicates 一覧/検索コマンドのリポジトリーの重複の表示
-e [error level], --errorlevel=[error level]
エラー出力レベル
--rpmverbosity=[debug level name]
rpm のデバッグ情報の出力レベル
-q, --quiet 静かに処理をする
-v, --verbose 冗長に処理をする
-y, --assumeyes すべての問い合わせに「yes」で答える
--version Yum のバージョンを表示して終了する
--installroot=[path] インストールのベース ディレクトリーを設定する
--enablerepo=[repo] ひとつ以上のリポジトリーを有効にする (ワイルドカード許可)
--disablerepo=[repo] ひとつ以上のリポジトリーを無効にする (ワイルドカード許可)
-x [package], --exclude=[package]
名前かワイルドカードでパッケージを除外する
--disableexcludes=[repo]
main、あるリポジトリー、またはすべてからの除外を無効にします。
--obsoletes 更新中に不要な処理を有効にします
--noplugins Yum プラグインを無効にする
--nogpgcheck GPG 署名の確認を無効にする
--disableplugin=[plugin]
名前でプラグインを無効にする
--enableplugin=[plugin]
名前でプラグインを有効にする
--skip-broken 依存性に問題があるパッケージを飛ばす
--color=COLOR 色を使うかどうか制御する
--releasever=RELEASEVER
yum 設定と repo ファイルに $releasever の値を設定する
--setopt=SETOPTS 全体設定とリポジトリー オプションの任意に設定する
プラグインのオプション:
--security Include security relevant packages
--bugfixes Include bugfix relevant packages
--cve=CVE Include packages needed to fix the given CVE
--bz=BZ Include packages needed to fix the given BZ
--sec-severity=SEVERITY
Include security relevant packages, of this severity
--advisory=ADVISORY
Include packages needed to fix the given advisory
yum(8) yum(8)
NAME
yum - Yellowdog Updater Modified
SYNOPSIS
yum [options] [command] [package ...]
DESCRIPTION
yum is an interactive, rpm based, package manager. It can automatically perform system updates, including dependency analysis and obsolete pro-
cessing based on "repository" metadata. It can also perform installation of new packages, removal of old packages and perform queries on the
installed and/or available packages among many other commands/services (see below). yum is similar to other high level package managers like
apt-get and smart.
While there are some graphical interfaces directly to the yum code, more recent graphical interface development is happening with PackageKit and
the gnome-packagekit application.
command is one of:
* install package1 [package2] [...]
* update [package1] [package2] [...]
* update-to [package1] [package2] [...]
* check-update
* upgrade [package1] [package2] [...]
* upgrade-to [package1] [package2] [...]
* distribution-synchronization [package1] [package2] [...]
* remove | erase package1 [package2] [...]
* list [...]
* info [...]
* provides | whatprovides feature1 [feature2] [...]
* clean [ packages | metadata | expire-cache | rpmdb | plugins | all ]
* makecache
* groupinstall group1 [group2] [...]
* groupupdate group1 [group2] [...]
* grouplist [hidden] [groupwildcard] [...]
* groupremove group1 [group2] [...]
* groupinfo group1 [...]
* search string1 [string2] [...]
* shell [filename]
* resolvedep dep1 [dep2] [...]
* localinstall rpmfile1 [rpmfile2] [...]
(maintained for legacy reasons only - use install)
* localupdate rpmfile1 [rpmfile2] [...]
(maintained for legacy reasons only - use update)
* reinstall package1 [package2] [...]
* downgrade package1 [package2] [...]
* deplist package1 [package2] [...]
* repolist [all|enabled|disabled]
* version [ all | installed | available | group-* | nogroups* | grouplist | groupinfo ]
* history [info|list|packages-list|packages-info|summary|addon-info|redo|undo|rollback|new|sync|stats]
* load-transaction [txfile]
* check
* help [command]
Unless the --help or -h option is given, one of the above commands must be present.
Repository configuration is honored in all operations.
install
Is used to install the latest version of a package or group of packages while ensuring that all dependencies are satisfied. (See Specify-
ing package names for more information) 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 name starts with an @ character the rest of the name is used as though passed to the groupinstall com-
mand. If the name starts with a - character, then a search is done within the transaction and any matches are removed. If the name is a
file, then install works like localinstall. If the name doesn’t match a package, then package "provides" are searched (e.g. "_sqlite-
cache.so()(64bit)") as are filelists (Eg. "/usr/bin/yum"). Also note that for filelists, wildcards will match multiple packages.
update If run without any packages, update will update every currently installed package. If one or more packages or package globs are specified,
Yum will only update the listed packages. While updating packages, yum will ensure that all dependencies are satisfied. (See Specifying
package names for more information) If the packages or globs specified match to packages which are not currently installed then update will
not install them. update operates on groups, files, provides and filelists just like the "install" command.
If the main obsoletes configure option is true (default) or the --obsoletes flag is present yum will include package obsoletes in its cal-
culations - this makes it better for distro-version changes, for example: upgrading from somelinux 8.0 to somelinux 9.
Note that "update" works on installed packages first, and only if there are no matches does it look for available packages. The difference
is most noticeable when you do "update foo-1-2" which will act exactly as "update foo" if foo-1-2 is installed. You can use the "update-to"
if you’d prefer that nothing happen in the above case.
update-to
This command works like "update" but always specifies the version of the package we want to update to.
check-update
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 packages to be updated in list format. Returns 0 if
no packages are available for update. Returns 1 if an error occurred. Running in verbose mode also shows obsoletes.
upgrade
Is the same as the update command with the --obsoletes flag set. See update for more details.
upgrade-to
This command works like "upgrade" but always specifies the version of the package we want to update to.
distribution-synchronization or distro-sync
Synchronizes the installed package set with the latest packages available, this is done by either obsoleting, upgrading or downgrading as
appropriate. This will "normally" do the same thing as the upgrade command however if you have the package FOO installed at version 4, and
the latest available is only version 3, then this command will downgrade FOO to version 3.
This command does not perform operations on groups, local packages or negative selections.
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.
remove operates on groups, files, provides and filelists just like the "install" command.(See Specifying package names for more informa-
tion)
Note that "yum" is included in the protected_packages configuration, by default. So you can’t accidentally remove yum itself.
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 pack-
ages available or installed that provide that feature or file.
search This is used to find packages when you know something about the package but aren’t sure of it’s name. By default search will try searching
just package names and summaries, but if that "fails" it will then try descriptions and url.
Yum search orders the results so that those packages matching more terms will appear first.
You can force searching everything by specifying "all" as the first argument.
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.
makecache
Is used to download and make usable all the metadata for the currently enabled yum repos.
groupinstall
Is used to install all of the individual packages in a group, of the specified types (this works as if you’d taken each of those package
names and put them on the command line for a "yum install" command).
The group_package_types configuration option specifies which types will be installed.
groupinstall
Is used to install all of the individual packages in a group, of the specified types (this works as if you’d taken each of those package
names and put them on the command line for a "yum install" command).
The group_package_types configuration option specifies which types will be installed.
groupupdate
Is just an alias for groupinstall, which will do the right thing because "yum install X" and "yum update X" do the same thing, when X is
already installed.
grouplist
Is used to list the available groups from all yum repos. Groups are marked as "installed" if all mandatory packages are installed, or if a
group doesn’t have any mandatory packages then it is installed if any of the optional or default package are installed. The optional "hid-
den" argument will also list groups marked as not being "user visible". If you pass the -v option, to enable verbose mode, then the
groupids are displayed.
groupremove
Is used to remove all of the packages in a group, unlike "groupinstall" this will remove everything regardless of group_package_types. It
is worth pointing out that packages can be in more than one group, so "groupinstall X Y" followed by "groupremove Y" does not do give you
the same result as "groupinstall X".
The groupremove_leaf_only configuration changes the behaviour of this command to only remove packages which aren’t required by something
else.
groupinfo
Is used to give the description and package list of a group (and which type those packages are marked as). Note that you can use the yum-
filter-data and yum-list-data plugins to get/use the data the other way around (Ie. what groups own packages need updating). If you pass
the -v option, to enable verbose mode, then the package names are matched against installed/available packages similar to the list command.
shell Is used to enter the ’yum shell’, when a filename is specified the contents of that file is executed in yum shell mode. See yum-shell(8)
for more info
resolvedep
Is used to list packages providing the specified dependencies, at most one package is listed per dependency.
localinstall
Is used to install a set of local rpm files. If required the enabled repositories will be used to resolve dependencies. Note that the
install command will do a local install, if given a filename. This option is maintained for legacy reasons only.
localupdate
Is used to update the system by specifying local rpm files. Only the specified rpm files of which an older version is already installed
will be installed, the remaining specified packages will be ignored. If required the enabled repositories will be used to resolve depen-
dencies. Note that the update command will do a local update, if given a filename. This option is maintained for legacy reasons only.
reinstall
Will reinstall the identically versioned package as is currently installed. This does not work for "installonly" packages, like Kernels.
reinstall operates on groups, files, provides and filelists just like the "install" command.
downgrade
Will try and downgrade a package from the version currently installed to the previously highest version (or the specified version). The
depsolver will not necessarily work, but if you specify all the packages it should work (and thus. all the simple cases will work). Also
this does not work for "installonly" packages, like Kernels. downgrade operates on groups, files, provides, filelists and rpm files just
like the "install" command.
deplist
Produces a list of all dependencies and what packages provide those dependencies for the given packages.
repolist
Produces a list of configured repositories. The default is to list all enabled repositories. If you pass -v, for verbose mode, more infor-
mation is listed. If the first argument is ’enabled’, ’disabled’ or ’all’ then the command will list those types of repos.
You can pass repo id or name arguments, or wildcards which to match against both of those. However if the id or name matches exactly then
the repo will be listed even if you are listing enabled repos. and it is disabled.
In non-verbose mode the first column will start with a ’*’ if the repo. has metalink data and the latest metadata is not local. For non-
verbose mode the last column will also display the number of packages in the repo. and (if there are any user specified excludes) the num-
ber of packages excluded.
One last special feature of repolist, is that if you are in non-verbose mode then yum will ignore any repo errors and output the informa-
tion it can get (Eg. "yum clean all; yum -C repolist" will output something, although the package counts/etc. will be zeroed out).
version
Produces a "version" of the rpmdb, and of the enabled repositories if "all" is given as the first argument. You can also specify version
groups in the version-groups configuration file. If you pass -v, for verbose mode, more information is listed. The version is calculated by
taking an SHA1 hash of the packages (in sorted order), and the checksum_type/checksum_data entries from the yumdb. Note that this rpmdb
version is now also used significantly within yum (esp. in yum history).
The version command will now show "groups" of packages as a separate version, and so takes sub-commands:
"version grouplist" - List the defined version groups.
"version groupinfo" - Get the complete list of packages within one or more version groups.
"version installed" - This is the default, only show the version information for installed packages.
"version available" - Only show the version information for available packages.
"version all" - Show the version information for installed and available packages.
"version nogroups | nogroups-*" - Just show the main version information.
"version group-*" - Just show the grouped version information, if more arguments are given then only show the data for those groups.
history
The history command allows the user to view what has happened in past transactions (assuming the history_record config. option is set). You
can use info/list/packages-list/packages-info/summary to view what happened, undo/redo/rollback to act on that information and new to start
a new history file.
The info/list/summary commands take either a transaction id or a package (with wildcards, as in Specifying package names), all three can
also be passed no arguments. list can be passed the keyword "all" to list all the transactions.
The info command can also take ranges of transaction ids, of the form start..end, which will then display a merged history as if all the
transactions in the range had happened at once.
Eg. "history info 1..4" will merge the first four transactions and display them as a single transaction.
The packages-list/packages-info commands takes a package (with wildcards, as in Specifying package names). And show data from the point of
view of that package.
The undo/redo/rollback commands take either a single transaction id or the keyword last and an offset from the last transaction (Eg. if
you’ve done 250 transactions, "last" refers to transaction 250, and "last-4" refers to transaction 246).
The undo/redo commands act on the specified transaction, undo’ing or repeating the work of that transaction. While the rollback command
will undo all transactions up to the point of the specified transaction. For example, if you have 3 transactions, where package A; B and C
where installed respectively. Then "undo 1" will try to remove package A, "redo 1" will try to install package A (if it is not still
installed), and "rollback 1" will try to remove packages B and C. Note that after a "rollback 1" you will have a fourth transaction,
although the ending rpmdb version (see: yum version) should be the same in transactions 1 and 4.
The addon-info command takes a transaction ID, and the packages-list command takes a package (with wildcards).
The stats command shows some statistics about the current history DB.
The sync commands allows you to change the rpmdb/yumdb data stored for any installed packages, to whatever is in the current rpmdb/yumdb
(this is mostly useful when this data was not stored when the package went into the history DB).
In "history list" you can change the behaviour of the 2nd column via the configuration option history_list_view.
In "history list" output the Altered column also gives some extra information if there was something not good with the transaction (this is
also shown at the end of the package column in the packages-list command).
> - The rpmdb was changed, outside yum, after the transaction.
< - The rpmdb was changed, outside yum, before the transaction.
* - The transaction aborted before completion.
# - The transaction completed, but with a non-zero status.
E - The transaction completed fine, but had warning/error output during the transaction.
P - The transaction completed fine, but problems already existed in the rpmdb.
s - The transaction completed fine, but --skip-broken was enabled and had to skip some packages.
load-transaction
This command will re-load a saved yum transaction file, this allows you to run a transaction on one machine and then use it on another.
The two common ways to get a saved yum transaction file are from "yum -q history addon-info last saved_tx" or via the automatic saves in
$TMPDIR/yum_save_tx.* when a transaction is solved but not run.
check Checks the local rpmdb and produces information on any problems it finds. You can pass the check command the arguments "dependencies",
"duplicates", "obsoletes" or "provides", to limit the checking that is performed (the default is "all" which does all).
help Produces help, either for all commands or if given a command name then the help for that particular command.
GENERAL OPTIONS
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, --assumeyes
Assume yes; assume that the answer to any question which would be asked is yes.
Configuration Option: assumeyes
-c, --config=[config file]
Specifies the config file location - can take HTTP and FTP URLs and local file paths.
-q, --quiet
Run without output. Note that you likely also want to use -y.
-v, --verbose
Run with a lot of debugging output.
-d, --debuglevel=[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, --errorlevel=[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 important. 1+ means print more errors (if any) -e 0 is good for cron jobs.
Configuration Option: errorlevel
--rpmverbosity=[name]
Sets the debug level to [name] for rpm scriptlets. ’info’ is the default, other options are: ’critical’, ’emergency’, ’error’, ’warn’ and
’debug’.
Configuration Option: rpmverbosity
-R, --randomwait=[time in minutes]
Sets the maximum amount of time yum will wait before performing a command - it randomizes over the time.
-C, --cacheonly
Tells yum to run entirely from system cache - does not download or update any headers unless it has to to perform the requested action. If
you’re using this as a user yum will not use the tempcache for the user but will only use the system cache in the system cachedir.
--version
Reports the yum version number and installed package versions for everything in history_record_packages (can be added to by plugins).
--showduplicates
Doesn’t limit packages to their latest versions in the info, list and search commands (will also affect plugins which use the doPackage-
Lists() API).
--installroot=root
Specifies an alternative installroot, relative to which all packages will be installed.
Configuration Option: installroot
--enablerepo=repoidglob
Enables specific repositories by id or glob that have been disabled in the configuration file using the enabled=0 option.
Configuration Option: enabled
--disablerepo=repoidglob
Disables specific repositories by id or glob.
Configuration Option: enabled
--obsoletes
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
-x, --exclude=package
Exclude a specific package by name or glob from updates on all repositories. Configuration Option: exclude
--color=[always|auto|never]
Display colorized output automatically, depending on the output terminal, always (using ANSI codes) or never. Note that some commands (Eg.
list and info) will do a little extra work when color is enabled. Configuration Option: color
--disableexcludes=[all|main|repoid]
Disable the excludes defined in your config files. Takes one of three options:
all == disable all excludes
main == disable excludes defined in [main] in yum.conf
repoid == disable excludes defined for that repo
--disableplugin=plugin
Run with one or more plugins disabled, the argument is a comma separated list of wildcards to match against plugin names.
--noplugins
Run with all plugins disabled.
Configuration Option: plugins
--nogpgcheck
Run with GPG signature checking disabled.
Configuration Option: gpgcheck
--skip-broken
Resolve depsolve problems by removing packages that are causing problems from the transaction.
Configuration Option: skip_broken
--releasever=version
Pretend the current release version is the given string. This is very useful when combined with --installroot. Note that with the default
upstream cachedir, of /var/cache/yum, using this option will corrupt your cache (and you can use $releasever in your cachedir configuration
to stop this).
-t, --tolerant
This option makes yum go slower, checking for things that shouldn’t be possible making it more tolerant of external errors.
--setopt=option=value
Set any config option in yum config or repo files. For options in the global config just use: --setopt=option=value for repo options use:
--setopt=repoid.option=value
LIST OPTIONS
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.
OUTPUT
The format of the output of yum list is:
name.arch [epoch:]version-release repo or @installed-from-repo
yum list [all | glob_exp1] [glob_exp2] [...]
List all available and installed packages.
yum list available [glob_exp1] [...]
List all packages in the yum repositories available to be installed.
yum list updates [glob_exp1] [...]
List all packages with updates available in the yum repositories.
yum list installed [glob_exp1] [...]
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 [glob_exp1] [...]
List the packages installed on the system that are not available in any yum repository listed in the config file.
yum list obsoletes [glob_exp1] [...]
List the packages installed on the system that are obsoleted by packages in any yum repository listed in the config file.
yum list recent
List packages recently added into the repositories. This is often not helpful, but what you may really want to use is "yum list-updateinfo
new" from the security yum plugin.
SPECIFYING PACKAGE NAMES
A package can be referred to for install, update, remove, list, info etc with any of the following as well as globs of any of the following:
name
name.arch
name-ver
name-ver-rel
name-ver-rel.arch
name-epoch:ver-rel.arch
epoch:name-ver-rel.arch
For example: yum remove kernel-2.4.1-10.i686
this will remove this specific kernel-ver-rel.arch.
Or: yum list available ’foo*’
will list all available packages that match ’foo*’. (The single quotes will keep your shell from expanding the globs.)
CLEAN OPTIONS
The following are the ways which you can invoke yum in clean mode. Note that "all files" in the commands below means "all files in currently
enabled repositories". If you want to also clean any (temporarily) disabled repositories you need to use --enablerepo=’*’ option.
yum clean expire-cache
Eliminate the local data saying when the metadata and mirrorlists were downloaded for each repo. This means yum will revalidate the cache
for each repo. next time it is used. However if the cache is still valid, nothing significant was deleted.
yum clean packages
Eliminate any cached packages from the system. Note that packages are not automatically deleted after they are downloaded.
yum clean headers
Eliminate all of the header files, which old versions of yum used for dependency resolution.
yum clean metadata
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 metadata the next time it is run.
yum clean dbcache
Eliminate the sqlite cache used for faster access to metadata. Using this option will force yum to download the sqlite metadata the next
time it is run, or recreate the sqlite metadata if using an older repo.
yum clean rpmdb
Eliminate any cached data from the local rpmdb.
yum clean plugins
Tell any enabled plugins to eliminate their cached data.
yum clean all
Does all of the above.
PLUGINS
Yum can be extended through the use of plugins. A plugin is a Python ".py" file which is installed in one of the directories specified by the
pluginpath option in yum.conf. For a plugin to work, the following conditions must be met:
1. The plugin module file must be installed in the plugin path as just described.
2. The global plugins option in /etc/yum.conf must be set to ‘1’.
3. A configuration file for the plugin must exist in /etc/yum/pluginconf.d/<plugin_name>.conf and the enabled setting in this file must set to
‘1’. The minimal content for such a configuration file is:
[main]
enabled = 1
See the yum.conf(5) man page for more information on plugin related configuration options.
FILES
/etc/yum.conf
/etc/yum/version-groups.conf
/etc/yum.repos.d/
/etc/yum/pluginconf.d/
/var/cache/yum/
SEE ALSO
pkcon (1)
yum.conf (5)
yum-updatesd (8)
package-cleanup (1)
repoquery (1)
yum-complete-transaction (1)
yumdownloader (1)
yum-utils (1)
yum-security (8)
http://yum.baseurl.org/
http://yum.baseurl.org/wiki/Faq
yum search yum
AUTHORS
See the Authors file included with this program.
BUGS
There of course aren’t any bugs, but if you find any, you should first consult the FAQ mentioned above and then email the mailing list:
yum@lists.baseurl.org or filed in bugzilla.
Seth Vidal yum(8)