리눅스마스터1급: 시스템 업데이트를 위한 yum에 대하여
작성자 정보
- 관리자 작성
- 작성일
컨텐츠 정보
- 2,786 조회
- 0 추천
- 목록
본문
리눅스마스터1급: 시스템 업데이트를 위한 yum에 대하여
yum을 통한 시스템 업데이트
yum은 /etc/yum.conf 에 지정된 서버로부터 업데이트된 패키지들을 검사하고 다운로드하여 설치할 수 있는 콘솔용 프로그램이다
(이것은 SULinux, RockyLinux, Redhat, CentOS, Fedora 등 레드햇 계열의 리눅스에서 모두 사용한다).
그리고 이것을 기반으로 X 윈도우용 애플리케이션들이 사용되고 있다.
이 프로그램은 특정 소프트웨어 패키지의 의존성을 검사하여 의존성이 있는 소프트웨어 패키지들을 함께 설치하도록 하기 때문에 업데이트가 무척 수월하다.
게다가 cron을 이용하여 주기적인 업데이트 확인과 설치가 가능하기 때문에 관리자의 일을 상당부분 덜 수 있다.
1) yum의 설정
yum의 설정 파일은 /etc/yum.repos.d/디렉토리에 있다.
[root@RockyLinux01 ~]# ls -l /etc/yum.repos.d/ 합계 24 -rw-r--r-- 1 root root 1919 4월 28 10:56 docker-ce.repo -rw-r--r-- 1 root root 6586 12월 13 2022 rocky-addons.repo -rw-r--r-- 1 root root 1161 12월 13 2022 rocky-devel.repo -rw-r--r-- 1 root root 2379 12월 13 2022 rocky-extras.repo -rw-r--r-- 1 root root 3405 12월 13 2022 rocky.repo [root@RockyLinux01 ~]# |
|
|
|
| [main] cachedir=/var/cache/yum keepcache=0 debuglevel=2 logfile=/var/log/yum.log distroverpkg=redhat-release tolerant=1 exactarch=1 obsoletes=1 gpgcheck=1 plugins=1
# Note: yum-RHN-plugin doesn't honor this. metadata_expire=1h
# Default. # installonly_limit = 3
# PUT YOUR REPOS HERE OR IN separate files named file.repo # in /etc/yum.repos.d |
|
|
|
|
위 설정 파일 중 [main] 부분에서 yum 동작을 위한 옵션 설정을 할 수 있다.
이것에 대한 사항은 다음과 같다.
∙cachedir :
업데이트를 위해 다운받은 db 파일들과 패키지들을 임시로 저장하는 디렉토리 경로이다.
∙keepcache :
yum이 성공적인 설치 이후에 헤더와 패키지의 캐시를 유지할 것인지 결정한다.
1또는 0으로 지정할 수 있으며, 기본값은 1(유지)이다.
∙debuglevel :
debug 레벨로서 0부터 2까지 있다.
∙logfile :
업데이트 내역을 기록하는 로그 파일의 위치이다.
∙distroverpkg :
배포판의 버전을 결정하기 위해 사용하는 패키지. 기본 설정은 redhat- release로 되어 있다.
∙tolerant :
1 또는 0으로 설정한다.
명령에 대해 패키지들에 관한 에러 메시지를 출력할 지 여부를 결정한다.
1로 설정하면 메시지를 출력하지 않는다.
∙exactarch :
1또는 0으로 설정한다.
1로 설정하면, 인스톨한 패키지들의 아키텍처들만 업데이트한다.
i386 패키지를 업데이트하기 위해 i686 패키지를 설치하지는 않을 것이다.
∙obsoletes :
업데이트 동안 영향을 주는 것으로, yum의 obsoletes 프로세싱 로직을 활성화한다.
이것은 yum이 배포판 수준의 업그레이드를 수행할 때 유용하다.
∙gpgcheck :
yum이 패키지상의 GPG 시그너쳐를 확인할 것인지 설정한다.
1또는 0으로 설정할 수 있는데, 기본값은 0이다.
∙plugins :
1 또는 0으로 설정한다.
yum의 플러그인들을 활성화하거나 비활성화하는 전역 스위치이다.
기본값은 0(비활성화)이다.
∙metadata_expire=1h :
메타데이터가 만료되는 시간이다.
∙installonly_limit = 3 :
installonlypkgs에 열거된 것들 중에서 동시에 설치되는 패키지들의 수를 지정한다.
0으로 설정하면 이 기능이 비활성화된다.
이 설정 파일에는 다음과 같이 업데이트 주소를 지정할 수 있는데, 다음 설정은 [base]와 [update-released]로서 복수의 서버를 지정했다.
name에는 업데이트 서버들을 구별하는 명칭을, baseurl에는 업데이트 서버의 주소 및 경로를 지정한다.
|
|
|
| [base] name=SULinux - Base baseurl=ftp://ftp.sulinux.net/pub/linux/OS/RPMS
[updates-released] name=SULinux - Update baseurl=ftp://ftp.sulinux.net/pub/linux/UPDATE/RPMS |
|
|
|
|
이외에 /etc/yum.repos.d/ 에는 위 설정 파일에 더해서 추가적인 설정을 담은 파일들을 저장한다.
[root@RockyLinux01 ~]# cat /etc/yum.repos.d/rocky.repo # rocky.repo # # The mirrorlist system uses the connecting IP address of the client and the # update status of each mirror to pick current mirrors that are geographically # close to the client. You should use this for Rocky updates unless you are # manually picking other mirrors. # # If the mirrorlist does not work for you, you can try the commented out # baseurl line instead.
[baseos] name=Rocky Linux $releasever - BaseOS mirrorlist=https://mirrors.rockylinux.org/mirrorlist?arch=$basearch&repo=BaseOS-$releasever$rltype #baseurl=http://dl.rockylinux.org/$contentdir/$releasever/BaseOS/$basearch/os/ gpgcheck=1 enabled=1 countme=1 metadata_expire=6h gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-Rocky-9
[baseos-debug] name=Rocky Linux $releasever - BaseOS - Debug mirrorlist=https://mirrors.rockylinux.org/mirrorlist?arch=$basearch&repo=BaseOS-$releasever-debug$rltype #baseurl=http://dl.rockylinux.org/$contentdir/$releasever/BaseOS/$basearch/debug/tree/ gpgcheck=1 enabled=0 metadata_expire=6h gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-Rocky-9
[baseos-source] name=Rocky Linux $releasever - BaseOS - Source mirrorlist=https://mirrors.rockylinux.org/mirrorlist?arch=source&repo=BaseOS-$releasever-source$rltype #baseurl=http://dl.rockylinux.org/$contentdir/$releasever/BaseOS/source/tree/ gpgcheck=1 enabled=0 metadata_expire=6h gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-Rocky-9
[appstream] name=Rocky Linux $releasever - AppStream mirrorlist=https://mirrors.rockylinux.org/mirrorlist?arch=$basearch&repo=AppStream-$releasever$rltype #baseurl=http://dl.rockylinux.org/$contentdir/$releasever/AppStream/$basearch/os/ gpgcheck=1 enabled=1 countme=1 metadata_expire=6h gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-Rocky-9
[appstream-debug] name=Rocky Linux $releasever - AppStream - Debug mirrorlist=https://mirrors.rockylinux.org/mirrorlist?arch=$basearch&repo=AppStream-$releasever-debug$rltype #baseurl=http://dl.rockylinux.org/$contentdir/$releasever/AppStream/$basearch/debug/tree/ gpgcheck=1 enabled=0 metadata_expire=6h gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-Rocky-9
[appstream-source] name=Rocky Linux $releasever - AppStream - Source mirrorlist=https://mirrors.rockylinux.org/mirrorlist?arch=source&repo=AppStream-$releasever-source$rltype #baseurl=http://dl.rockylinux.org/$contentdir/$releasever/AppStream/source/tree/ gpgcheck=1 enabled=0 metadata_expire=6h gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-Rocky-9
[crb] name=Rocky Linux $releasever - CRB mirrorlist=https://mirrors.rockylinux.org/mirrorlist?arch=$basearch&repo=CRB-$releasever$rltype #baseurl=http://dl.rockylinux.org/$contentdir/$releasever/CRB/$basearch/os/ gpgcheck=1 enabled=0 countme=1 metadata_expire=6h gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-Rocky-9
[crb-debug] name=Rocky Linux $releasever - CRB - Debug mirrorlist=https://mirrors.rockylinux.org/mirrorlist?arch=$basearch&repo=CRB-$releasever-debug$rltype #baseurl=http://dl.rockylinux.org/$contentdir/$releasever/CRB/$basearch/debug/tree/ gpgcheck=1 enabled=0 metadata_expire=6h gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-Rocky-9
[crb-source] name=Rocky Linux $releasever - CRB - Source mirrorlist=https://mirrors.rockylinux.org/mirrorlist?arch=source&repo=CRB-$releasever-source$rltype #baseurl=http://dl.rockylinux.org/$contentdir/$releasever/CRB/source/tree/ gpgcheck=1 enabled=0 metadata_expire=6h gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-Rocky-9 [root@RockyLinux01 ~]# |
이 파일의 설정 방식도 위의 업데이트 주소 지정과 동일하게 하는데, 이외에도 mirrorlist에 URL을 지정하여 복수의 서버를 지정할 수 있고, gpgchek와 gpgkey를 지정할 수 있다.
|
|
|
| [base] name=SULinux-$releasever - Base mirrorlist=http://www.sulinux.net/mirrorlist/?release=$releasever&arch=$basearch&repo=os gpgcheck=1 gpgkey=ftp://ftp.sulinux.net/SULinux/RPM-GPG-KEY-SUL2
[update] name=SULinux-$releasever - Update mirrorlist=http://www.sulinux.net/mirrorlist/?release=$releasever&arch=$basearch&repo=updates gpgcheck=1 gpgkey=ftp://ftp.sulinux.net/SULinux/RPM-GPG-KEY-SUL2
[extras] name=SULinux-$releasever - Extras mirrorlist=http://www.sulinux.net/mirrorlist/?release=$releasever&arch=$basearch&repo=extras gpgcheck=1 gpgkey=ftp://ftp.sulinux.net/SULinux/RPM-GPG-KEY-SUL2 |
|
|
|
|
관련자료
-
이전
-
다음