1. local repo에 사용할 패키지 가져오기
2. create repo
3. 안쓰는 repo disable
4. local repo를 이용해서 package 설치하기
[root@localhost ~]# pwd
/root
scp -r centos@192.168.10.:/home/centos/files-repo ./files_repo
[root@localhost ~]# ls -l
total 8
-rw-------. 1 root root 1347 2월 8 23:24 anaconda-ks.cfg
drwxr-xr-x. 3 root root 4096 2월 13 03:48 files_repo
cd ~/files_repo
dnf install createrepo -y # creatrepo가 없다면
createrepo ./
export LOCAL_REPO_PATH=$PWD
dnf config-manager --add-repo file://${LOCAL_REPO_PATH}
dnf repolist
[root@localhost files_repo]# yum repolist
repo id repo name
AppStream CentOS-8 - AppStream
BaseOS CentOS-8 - Base
extras CentOS-8 - Extras
root_files_repo created by dnf config-manager from file:///root/files_repo
local repo만 사용할 것이므로 다른 repository들은 disable 상태로 변경시켜준다.
$ dnf config-manager --set-disabled <repo-id>
[root@localhost files_repo]# yum repolist
repo id repo name
root_files_repo created by dnf config-manager from file:///root/files_repo
이제 files_repo 안에 있는 패키지중 하나를 아무거나 골라서 설치한다.
[root@localhost files_repo]# dnf install sshpass-1.06-9.el8.x86_64 -y
created by dnf config-manager from file:///root/files_repo 3.0 MB/s | 3.0 kB 00:00
Dependencies resolved.
=====================================================================================================
Package Architecture Version Repository Size
=====================================================================================================
Installing:
sshpass x86_64 1.06-9.el8 root_files_repo 27 k
Transaction Summary
=====================================================================================================
Install 1 Package
Total size: 27 k
Installed size: 40 k
Downloading Packages:
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
Preparing : 1/1
Installing : sshpass-1.06-9.el8.x86_64 1/1
Running scriptlet: sshpass-1.06-9.el8.x86_64 1/1
Verifying : sshpass-1.06-9.el8.x86_64 1/1
Installed:
sshpass-1.06-9.el8.x86_64
Complete!
만약 gpg check 에러가 발생한다면 gpgcheck를 하지않음으로 설정
echo "gpgcheck=0" >> /etc/yum.repos.d/root_files_repo.repo