Tips

LinuxServer yumによるパッケージ管理 yumの設定ファイル

LinuxServer yumによるパッケージ管理 yumの設定ファイル

yumを使用する前に確認することがあります。

yumの設定ファイル

yumの設定ファイルは /etc/yum.conf になります。
/etc/yum.confの [main] セクションではyumの基本的な動作について設定します。

[# cat /etc/yum.conf] [main] cachedir=/var/cache/yum/$basearch/$releasever
keepcache=0
debuglevel=2
logfile=/var/log/yum.log
exactarch=1
obsoletes=1
gpgcheck=1
plugins=1
installonly_limit=3

# 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
[divider]

標準の設定で使用して問題はありませんが、キャッシュの保存場所、ログファイルの保存場所、
ログのデバッグレベル等を設定します。

[main]セクションのオプション詳細

[main] セクションの詳細なオプションは以下のページを参照してください。
https://access.redhat.com/knowledge/docs/ja-JP/Red_Hat_Enterprise_Linux/6/html/Deployment_Guide/sec-Configuring_Yum_and_Yum_Repositories.html

また、「yumによるパッケージ管理【第1回】」https://techpjin.sakura.ne.jp/techpjin_new/?p=7042で説明したリポジトリサーバについて [repository] セクションにて設定します。
[repository] セクションでは、リポジトリ固有のオプションを設定できます。

ただし、/etc/yum.conf の最下行に
# PUT YOUR REPOS HERE OR IN separate files named file.repo
# in /etc/yum.repos.d
の記述があるように、デフォルトでは /etc/yum.repos.d/ ディレクトリ内に
.repo ファイルで個々のリポジトリを定義しています。

Linux認定資格 LPICを取るなら・・

Linux資格 「LPIC Lv1」徹底解説 連載目次

Recent News

Recent Tips

Tag Search