人気セミナー
CentOS8、Ubuntu20.04対応を記念して、『受講料55%OFF』キャンペーン実施中
一生使えるLinux技術を「たった1日」で習得できます。
【CentOS/Ubuntu研修】リナックスマスターセミナー(ZOOM対応)
あなたが構築したサーバーや管理しているサーバーは、本当に安全ですか?
独学で誤魔化して使っていませんか?
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
---------------------------------------------------------------------------
1番人気 【Linuxセミナー】リナックスマスターセミナー【CentOS/Ubuntu研修】
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
---------------------------------------------------------------------------
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の転職に強い転職サイト・転職エージェント【厳選3選】
入門講座【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)
■CentOS7サーバー構築マニュアルを無料プレゼント
下記3冊のマニュアルを無料プレゼントしています。
・CentOS7サーバー構築マニュアル(105ページ)
・VMware Playerで作る仮想Linux環境構築マニュアル(40ページ)
・DB(PostgreSQL・MySQL)構築・CentOSバージョンアップマニュアル(33ページ)
詳細は↓をいますぐクリックしてください。


- 次のページへ:CentOS8とCentOS7の違い、変更点のまとめ
- 前のページへ:Apacheに脆弱性(CVE-2017-9798)、メモリから情報漏えいの恐れ
- この記事の属するカテゴリ:Linux情報・技術・セキュリティへ戻る