설명
YUM(Yellowdog Updater Modified)은 RPM 패키지를 관리하는 관리툴입니다.
Usage
yum [options] COMMAND or yum COMMAND [options]
Command - history
[root@localhost ~]# yum history
ID | Command line | Date and time | Action(s) | Altered
-------------------------------------------------------------------------------
7 | install yum-utils | 2020-07-31 16:36 | Install | 1
6 | -y install epel-release | 2020-07-31 16:15 | Install | 1
5 | -y install bind bind-chr | 2020-07-30 15:09 | Install | 7
4 | -y install policycoreuti | 2020-07-30 15:06 | Install | 6
3 | -y update | 2020-07-30 14:43 | I, U | 215 EE
2 | install net-tools | 2020-07-30 10:26 | Install | 1
1 | | 2020-07-30 10:10 | Install | 404 EE
[root@localhost ~]# yum history info 2
Transaction ID : 2
Begin time : Thu 30 Jul 2020 10:26:47 AM KST
Begin rpmdb : 401:1541256abb0af06e22f82ab3f5d807c669d1c337
End time : Thu 30 Jul 2020 10:26:48 AM KST (1 seconds)
End rpmdb : 402:0f48d81360bfb849c0b61df3411ce05bd59476f1
User : root <root>
Return-Code : Success
Releasever : 8
Command Line : install net-tools
Packages Altered:
Install net-tools-2.0-0.51.20160912git.el8.x86_64 @BaseOS
[root@localhost ~]# yum history undo 2
Last metadata expiration check: 0:03:42 ago on Fri 31 Jul 2020 05:33:57 PM KST.
Undoing transaction 2, from Thu 30 Jul 2020 10:26:47 AM KST
Install net-tools-2.0-0.51.20160912git.el8.x86_64 @BaseOS
Dependencies resolved.
================================================================================================
Package Architecture Version Repository Size
================================================================================================
Removing:
net-tools x86_64 2.0-0.51.20160912git.el8 @BaseOS 1.0 M
Transaction Summary
================================================================================================
Remove 1 Package
Freed space: 1.0 M
Is this ok [y/N]: y
...
Removed:
net-tools-2.0-0.51.20160912git.el8.x86_64
Complete!
[root@localhost ~]# yum history
ID | Command line | Date and time | Action(s) | Altered
-------------------------------------------------------------------------------
8 | history undo 2 | 2020-07-31 17:37 | Removed | 1
7 | install yum-utils | 2020-07-31 16:36 | Install | 1
6 | -y install epel-release | 2020-07-31 16:15 | Install | 1
5 | -y install bind bind-chr | 2020-07-30 15:09 | Install | 7
4 | -y install policycoreuti | 2020-07-30 15:06 | Install | 6
3 | -y update | 2020-07-30 14:43 | I, U | 215 EE
2 | install net-tools | 2020-07-30 10:26 | Install | 1
1 | | 2020-07-30 10:10 | Install | 404 EE
Command - repolist
아래와 같은 명령어로 리포지토리 전체 리스트와 활성화된 리스트, 비활성화된 리스트를 확인할 수 있습니다.
[root@localhost ~]# yum repolist --all
repo id repo name status
AppStream CentOS-8 - AppStream enabled
AppStream-source CentOS-8 - AppStream Sources disabled
BaseOS CentOS-8 - Base enabled
BaseOS-source CentOS-8 - BaseOS Sources disabled
Devel CentOS-8 - Devel WARNING! FOR BUILDROOT USE ONLY! disabled
HighAvailability CentOS-8 - HA disabled
PowerTools CentOS-8 - PowerTools disabled
base-debuginfo CentOS-8 - Debuginfo disabled
c8-media-AppStream CentOS-AppStream-8 - Media disabled
c8-media-BaseOS CentOS-BaseOS-8 - Media disabled
centosplus CentOS-8 - Plus disabled
centosplus-source CentOS-8 - Plus Sources disabled
cr CentOS-8 - cr disabled
extras CentOS-8 - Extras enabled
extras-source CentOS-8 - Extras Sources disabled
fasttrack CentOS-8 - fasttrack disabled
[root@localhost ~]# yum repolist --enabled
repo id repo name
AppStream CentOS-8 - AppStream
BaseOS CentOS-8 - Base
extras CentOS-8 - Extras
[root@localhost ~]# yum repolist --disabled
repo id repo name
AppStream-source CentOS-8 - AppStream Sources
BaseOS-source CentOS-8 - BaseOS Sources
Devel CentOS-8 - Devel WARNING! FOR BUILDROOT USE ONLY!
HighAvailability CentOS-8 - HA
PowerTools CentOS-8 - PowerTools
base-debuginfo CentOS-8 - Debuginfo
c8-media-AppStream CentOS-AppStream-8 - Media
c8-media-BaseOS CentOS-BaseOS-8 - Media
centosplus CentOS-8 - Plus
centosplus-source CentOS-8 - Plus Sources
cr CentOS-8 - cr
extras-source CentOS-8 - Extras Sources
fasttrack CentOS-8 - fasttrack
활용 - 외부 리포지터리 추가후 활성화 및 비활성화
외부 리포지토리인 EPEL을 설치하고 활성화 유무를 확인히 봅니다.
[root@localhost ~]# yum -y install epel-release
Last metadata expiration check: 1:37:37 ago on Fri 31 Jul 2020 02:37:49 PM KST.
Dependencies resolved.
================================================================================================
Package Architecture Version Repository Size
================================================================================================
Installing:
epel-release noarch 8-8.el8 extras 23 k
Transaction Summary
================================================================================================
Install 1 Package
...
Complete!
[root@localhost ~]# yum repolist --all | grep epel
epel Extra Packages for Enterprise Linux 8 - enabled
epel-debuginfo Extra Packages for Enterprise Linux 8 - disabled
epel-modular Extra Packages for Enterprise Linux Modu enabled
epel-modular-debuginfo Extra Packages for Enterprise Linux Modu disabled
epel-modular-source Extra Packages for Enterprise Linux Modu disabled
epel-playground Extra Packages for Enterprise Linux 8 - disabled
epel-playground-debuginfo Extra Packages for Enterprise Linux 8 - disabled
epel-playground-source Extra Packages for Enterprise Linux 8 - disabled
epel-source Extra Packages for Enterprise Linux 8 - disabled
epel-testing Extra Packages for Enterprise Linux 8 - disabled
epel-testing-debuginfo Extra Packages for Enterprise Linux 8 - disabled
epel-testing-modular Extra Packages for Enterprise Linux Modu disabled
epel-testing-modular-debuginfo Extra Packages for Enterprise Linux Modu disabled
epel-testing-modular-source Extra Packages for Enterprise Linux Modu disabled
epel-testing-source Extra Packages for Enterprise Linux 8 - disabled
비활성화되어 있는 리포지토리 활성화해 보겠습니다. 직접 리포지터리 파일을 편집할 수도 있지만, 간단한 명령어로도 활성화가 가능합니다. 명령어는 별도의 「yum-utils」라는 패키지가 필요하므로 설치한 후 실행해 보겠습니다.
[root@localhost ~]# yum repolist --all | grep epel-source
epel-source Extra Packages for Enterprise Linux 8 - disabled
[root@localhost ~]# yum -y install yum-utils
Last metadata expiration check: 0:04:11 ago on Fri 31 Jul 2020 04:32:00 PM KST.
Dependencies resolved.
================================================================================================
Package Architecture Version Repository Size
================================================================================================
Installing:
yum-utils noarch 4.0.12-3.el8 BaseOS 66 k
Transaction Summary
================================================================================================
Install 1 Package
...
Complete!
[root@localhost ~]# yum-config-manager --enable epel-source
[root@localhost ~]# yum repolist --all | grep epel-source
epel-source Extra Packages for Enterprise Linux 8 - enabled
「--disable」 옵션을 붙여서 다시 비활성화 할수도 있습니다.
[root@localhost ~]# yum-config-manager --disable epel-source
[root@localhost ~]# yum repolist --all | grep epel-source
epel-source Extra Packages for Enterprise Linux 8 - disabled
읽어주셔서 감사합니다.