背景
- yumを使うとき便利なpluginがあって、よく使う
- 新しいyumになると、標準でpluginを搭載していたものもあったのでまとめた
環境
- CentOS7.2(CentOS/1511)
- 適当なvirtualboxで試す ... puppetlabs/centos-7.2-64-puppet
Tips
-
yum-plugin-security
... セキュリティアップデート対象の検出 -
yum-plugin-downloadonly
... パッケージをインストールせずダウンロードだけ実施 -
yum-plugin-changelog
... アップデートパッケージの更新履歴の参照
yum-plugin-security
- 昔は、
yum -y install yum-plugin-security
だが今は標準装備
[vagrant@test001 ~]$ sudo yum -d0 install yum-plugin-security
Package yum-3.4.3-132.el7.centos.0.1.noarch already installed and latest version
command
[vagrant@test001 ~]$ sudo yum help | grep "\-\-security"
--security Include security relevant packages, in updates
[vagrant@test001 ~]$ sudo yum -d1 --security check-update | head -3
--> dracut-config-rescue-033-360.el7_2.x86_64 from updates excluded (updateinfo)
--> rdma-7.2_4.1_rc6-2.el7.noarch from updates excluded (updateinfo)
--> 32:bind-license-9.9.4-29.el7_2.2.noarch from updates excluded (updateinfo)
アップデート対象をセキュリティアップデートが必要な物にしぼられるので便利
yum-plugin-downloadonly
- 昔は、
yum -y install yum-plugin-downloadonly
だが今は標準装備
[vagrant@test001 ~]$ sudo yum -d0 install yum-plugin-downloadonly
Package yum-3.4.3-132.el7.centos.0.1.noarch already installed and latest version
command
- 試しに
psmisc
を入れてみる
[vagrant@test001 ~]$ sudo yum -d0 install --downloadonly --downloaddir=/tmp psmisc
========================================================================================================================================
Package Arch Version Repository Size
========================================================================================================================================
Installing:
psmisc x86_64 22.20-9.el7 base 140 k
Transaction Summary
========================================================================================================================================
Install 1 Package
exiting because "Download Only" specified
[vagrant@test001 ~]$ ls /tmp/psmisc-22.20-9.el7.x86_64.rpm
/tmp/psmisc-22.20-9.el7.x86_64.rpm
downloadaされる。しかし、すでにインストールされていると反応しない。
[vagrant@test001 ~]$ sudo yum -d0 install --downloadonly --downloaddir=/tmp psmisc
Package psmisc-22.20-9.el7.x86_64 already installed and latest version
とにかくダウンロードをしたい場合は、 yumdownloader
を入れるとよい。
yum install yum-utils
yum-plugin-changelog
- こちらは標準で入っていない
sudo yum -y install yum-plugin-changelog
command
[vagrant@test001 ~]$ sudo yum help | grep "\-\-changelog"
--changelog Show changelog delta of updated packages
[vagrant@test001 ~]$ sudo yum --changelog update openssl
Loaded plugins: changelog, fastestmirror
Loading mirror speeds from cached hostfile
* base: www.ftp.ne.jp
* epel: mirrors.hustunique.com
* extras: www.ftp.ne.jp
* updates: www.ftp.ne.jp
Resolving Dependencies
--> Running transaction check
---> Package openssl.x86_64 1:1.0.1e-42.el7.9 will be updated
---> Package openssl.x86_64 1:1.0.1e-51.el7_2.2 will be an update
--> Processing Dependency: openssl-libs(x86-64) = 1:1.0.1e-51.el7_2.2 for package: 1:openssl-1.0.1e-51.el7_2.2.x86_64
--> Running transaction check
---> Package openssl-libs.x86_64 1:1.0.1e-42.el7.9 will be updated
---> Package openssl-libs.x86_64 1:1.0.1e-51.el7_2.2 will be an update
--> Finished Dependency Resolution
Changes in packages about to be updated:
ChangeLog for: 1:openssl-1.0.1e-51.el7_2.2.x86_64, 1:openssl-libs-1.0.1e-51.el7_2.2.x86_64
* Mon Dec 21 12:00:00 2015 Tomáš Mráz <tmraz@redhat.com> 1.0.1e-51.2
- fix CVE-2015-7575 - disallow use of MD5 in TLS1.2
* Fri Dec 4 12:00:00 2015 Tomáš Mráz <tmraz@redhat.com> 1.0.1e-51.1
- fix CVE-2015-3194 - certificate verify crash with missing PSS parameter
- fix CVE-2015-3195 - X509_ATTRIBUTE memory leak
- fix CVE-2015-3196 - race condition when handling PSK identity hint
インストール対象のパッケージの履歴を見ることができるので確認して入れることができて便利。
細かい設定は一応プラグイン管理フォルダでenableを確認するとよい。
[vagrant@test001 ~]$ cat /etc/yum/pluginconf.d/changelog.conf
[main]
enabled=1
# Set to 'pre' or 'post' to see changes before or after transaction
when=pre
# Set to true, to always get the output (removes the cmd line arg)
always=false