웹사이트 검색

CentOS 및 RHEL에서 업데이트를 확인하고 설치하는 방법


소프트웨어 패키지 또는 커널 자체에 대한 업데이트를 설치하는 것은 시스템 관리자에게 적극 권장되는 유익한 작업입니다. 특히 보안 업데이트나 패치와 관련해서는 더욱 그렇습니다. 보안 취약점이 발견되는 동안 전체 시스템에 대한 잠재적인 보안 위험을 줄이기 위해 영향을 받는 소프트웨어를 업데이트해야 합니다.

보안 패치 또는 업데이트를 자동으로 설치하도록 시스템을 구성하지 않은 경우 수동으로 설치해야 합니다. 이 기사에서는 CentOS 및 RHEL 배포판에서 소프트웨어 업데이트를 확인하고 설치하는 방법을 보여줍니다.

설치된 패키지에 사용 가능한 업데이트를 확인하려면 check-update 하위 명령과 함께 YUM 패키지 관리자를 사용하세요. 이를 통해 사용 가능한 모든 리포지토리의 모든 패키지 업데이트를 확인할 수 있습니다.

yum check-update
Loaded plugins: changelog, fastestmirror
base                                                                                                                                                 | 3.6 kB  00:00:00     
epel/x86_64/metalink                                                                                                                                 |  22 kB  00:00:00     
epel                                                                                                                                                 | 4.3 kB  00:00:00     
extras                                                                                                                                               | 3.4 kB  00:00:00     
mariadb                                                                                                                                              | 2.9 kB  00:00:00     
updates                                                                                                                                              | 3.4 kB  00:00:00     
(1/2): epel/x86_64/updateinfo                                                                                                                        | 842 kB  00:00:15     
(2/2): epel/x86_64/primary_db                                                                                                                        | 6.1 MB  00:00:00     
Loading mirror speeds from cached hostfile
 * base: mirrors.linode.com
 * epel: mirror.vorboss.net
 * extras: mirrors.linode.com
 * updates: mirrors.linode.com

MariaDB-client.x86_64                                                              10.1.28-1.el7.centos                                                             mariadb 
MariaDB-common.x86_64                                                              10.1.28-1.el7.centos                                                             mariadb 
MariaDB-server.x86_64                                                              10.1.28-1.el7.centos                                                             mariadb 
MariaDB-shared.x86_64                                                              10.1.28-1.el7.centos                                                             mariadb 
NetworkManager.x86_64                                                              1:1.8.0-11.el7_4                                                                 updates 
NetworkManager-adsl.x86_64                                                         1:1.8.0-11.el7_4                                                                 updates 
....

단일 패키지를 사용 가능한 최신 버전으로 업데이트하려면 아래 명령을 실행하세요. 이 예에서 yumhttpd 패키지 업데이트를 시도합니다.

yum update httpd
Loaded plugins: changelog, fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirrors.linode.com
 * epel: mirror.vorboss.net
 * extras: mirrors.linode.com
 * updates: mirrors.linode.com
Resolving Dependencies
--> Running transaction check
---> Package httpd.x86_64 0:2.4.6-45.el7.centos.4 will be updated
--> Processing Dependency: httpd = 2.4.6-45.el7.centos.4 for package: 1:mod_ssl-2.4.6-45.el7.centos.4.x86_64
---> Package httpd.x86_64 0:2.4.6-67.el7.centos.6 will be an update
--> Processing Dependency: httpd-tools = 2.4.6-67.el7.centos.6 for package: httpd-2.4.6-67.el7.centos.6.x86_64
--> Running transaction check
---> Package httpd-tools.x86_64 0:2.4.6-45.el7.centos.4 will be updated
---> Package httpd-tools.x86_64 0:2.4.6-67.el7.centos.6 will be an update
---> Package mod_ssl.x86_64 1:2.4.6-45.el7.centos.4 will be updated
---> Package mod_ssl.x86_64 1:2.4.6-67.el7.centos.6 will be an update
....

패키지 그룹을 업데이트하기 위해 다음 명령은 개발 도구(C 및 C++ 컴파일러와 관련 유틸리티)를 업데이트합니다.

yum update "Development Tools"
Loaded plugins: changelog, fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirrors.linode.com
 * epel: mirror.vorboss.net
 * extras: mirrors.linode.com
 * updates: mirrors.linode.com
...

모든 시스템 소프트웨어와 해당 종속성을 최신 버전으로 업그레이드하려면 다음 명령을 사용하십시오.

yum update
Loaded plugins: changelog, fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirrors.linode.com
 * epel: mirror.vorboss.net
 * extras: mirrors.linode.com
 * updates: mirrors.linode.com
Resolving Dependencies
--> Running transaction check
---> Package MariaDB-client.x86_64 0:10.1.23-1.el7.centos will be updated
---> Package MariaDB-client.x86_64 0:10.1.28-1.el7.centos will be an update
---> Package MariaDB-common.x86_64 0:10.1.23-1.el7.centos will be updated
---> Package MariaDB-common.x86_64 0:10.1.28-1.el7.centos will be an update
---> Package MariaDB-server.x86_64 0:10.1.23-1.el7.centos will be updated
---> Package MariaDB-server.x86_64 0:10.1.28-1.el7.centos will be an update
---> Package MariaDB-shared.x86_64 0:10.1.23-1.el7.centos will be updated
---> Package MariaDB-shared.x86_64 0:10.1.28-1.el7.centos will be an update
---> Package NetworkManager.x86_64 1:1.4.0-19.el7_3 will be obsoleted
---> Package NetworkManager.x86_64 1:1.8.0-11.el7_4 will be obsoleting
....

그게 다야! 다음 관련 기사를 읽고 싶을 수도 있습니다.

  1. CentOS 7에서 최신 커널 버전을 설치하거나 업그레이드하는 방법
  2. CentOS, RHEL 및 Fedora에서 사용하지 않는 오래된 커널을 삭제하는 방법
  3. Debian 및 Ubuntu에서 보안 업데이트를 자동으로 설치하는 방법

최신 보안 및 일반 패키지 업데이트를 통해 Linux 시스템을 항상 최신 상태로 유지하십시오. 질문하고 싶은 사항이 있으면 아래 의견 양식을 사용하십시오.