yumアップデート手順


無料Linux入門マニュアル無料ダウンロード

今だけ2,200円のLinux入門PDFマニュアルが【数量限定】で無料ダウンロードできます。
Linux入門マニュアル無料ダウンロードはこちらをクリック

yumを使用したLinuxのシステムアップデート手順。

本作業を実行することで、システムやアプリケーションの誤作動や不具合、場合によっては、サーバー自体が起動しなくなる可能性があります。

本番環境で実施する場合は、事前にテスト環境で充分検証を行ってから実施してください。作業はroot権限を行います。

1.Linuxのバージョンを確認する

[root@Master ~]# cat /etc/redhat-release
CentOS Linux release 7.1.1503 (Core)


2.カーネルバージョンを確認する

[root@Master ~]# uname -a
Linux Master 3.10.0-229.el7.x86_64 #1 SMP Fri Mar 6 11:36:42 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux


3.カーネルをアップデート対象から除外する

[root@Master ~]# vi /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=5
bugtracker_url=http://bugs.centos.org/set_project.php?project_id=23&ref=http://bugs.centos.org/bug_r
eport_page.php?category=yum
distroverpkg=centos-release
exclude=kernel* ←追加

# 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
---------------------------------------------------------------------------

:wq」で保存終了



4.アップデートを実施する

[root@Master ~]# yum update
途中、処理を続行するか問われるのでyを入力
Is this ok [y/d/N]:y


5.アップデート後のLinuxバージョンを確認する
CentOS7.1から7.4にバージョンアップしている

[root@Master ~]# cat /etc/redhat-release
CentOS Linux release 7.4.1708 (Core)


6.カーネルバージョンを確認する
カーネルはバージョンアップ対象外なので変化なし

[root@Master ~]# uname -a
Linux Master 3.10.0-229.el7.x86_64 #1 SMP Fri Mar 6 11:36:42 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux


7.カーネルをバージョンアップする

[root@Master ~]# vi /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=5
bugtracker_url=http://bugs.centos.org/set_project.php?project_id=23&ref=http://bugs.centos.org/bug_r
eport_page.php?category=yum
distroverpkg=centos-release
#exclude=kernel* ←行頭に「#」を追加

# 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
---------------------------------------------------------------------------

:wq」で保存終了

8.アップデートを実施する

[root@Master ~]# yum update
途中、処理を続行するか問われるのでyを入力
Is this ok [y/d/N]:y


9.サーバーを再起動する

[root@Master ~]# shutdown -r now


10.カーネルバージョンを確認する

カーネルがバージョンアップしている事を確認
[root@Master ~]# uname -a
Linux Master 3.10.0-693.11.6.el7.x86_64 #1 SMP Thu Jan 4 01:06:37 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux


■mkpasswdインストール

# yum -y install expect


■nmapインストール

# yum -y install nmap



無料Linux入門マニュアル無料ダウンロード

今だけ2,200円のLinux入門PDFマニュアルが【数量限定】で無料ダウンロードできます。
Linux入門マニュアル無料ダウンロードはこちらをクリック


<<関連記事>>
・RHEL7/CentOS7が重要カーネルセキュリティアップデートをリリース【CVE-2019-14821/CVE-2019-15239】
・PostgreSQL 12が公開と2019年10月データベース人気ランキング
・CentOS8とCentOS7の違い、変更点のまとめ
・Apacheに脆弱性(CVE-2017-9798)、メモリから情報漏えいの恐れ
・Apache Tomcat の複数の脆弱性に対するアップデート(CVE-2017-7674、CVE-2017-7675)

Linux入門マニュアル無料ダウンロード