반응형
# 경로 이동
cd /etc/yum.repos.d
# 백업 폴더 생성
mkdir old_repo
# 기존 파일 이동
mv CentOS-* old_repo
# 폴더 이동
mv old_repo /opt/apps/
# 새 레포지토리 파일 생성
# original이 기존, new가 새로운 URL입니다.
# mirrorlist 부분은 모두 주석하였습니다.
vi CentOS-Base.repo
[base]
name=CentOS-$releasever - Base
# original
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os&infra=$infra
#baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/
# new
baseurl=http://centos.mirror.cdnetworks.com/7/os/x86_64
gpgcheck=1
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
#released updates
[updates]
name=CentOS-$releasever - Updates
# original
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates&infra=$infra
#baseurl=http://mirror.centos.org/centos/$releasever/updates/$basearch/
# new
baseurl=http://centos.mirror.cdnetworks.com/7/updates/x86_64
gpgcheck=1
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
#additional packages that may be useful
[extras]
name=CentOS-$releasever - Extras
# original
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras&infra=$infra
#baseurl=http://mirror.centos.org/centos/$releasever/extras/$basearch/
# new
baseurl=http://centos.mirror.cdnetworks.com/7/extras/x86_64
gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-$releasever - Plus
# original
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus&infra=$infra
#baseurl=http://mirror.centos.org/centos/$releasever/centosplus/$basearch/
# new
baseurl=http://centos.mirror.cdnetworks.com/7/centosplus/x86_64
gpgcheck=1
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
# yum cache 삭제
yum clean all
# 테스트
yum install -y libtool
반응형
'운영체제 이야기 > Linux(CentOS)' 카테고리의 다른 글
[CentOS7] 자주 사용 명령어 - 2 (4) | 2024.10.02 |
---|---|
[Centos7] node js 설치 (0) | 2024.06.06 |
[centos7] centos7 gitlab 17.0.1 백업 및 복원 (0) | 2024.05.30 |
[CentOS7] jenkins 설치 및 gitlab 연동, 빌드 및 원격지 배포 - 1편 (0) | 2024.05.22 |
[CentOS 7] yum update 이후 이슈 (0) | 2024.04.20 |
댓글