CentOS7 首先导入 oracle的 GPG key。
# wget https://yum.oracle.com/RPM-GPG-KEY-oracle-ol7 -O /etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
# gpg --quiet --with-fingerprint /etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
pub 2048R/EC551F03 2010-07-01 Oracle OSS group (Open Source Software group) <build@oss.oracle.com>
Key fingerprint = 4214 4123 FECF C55B 9086 313D 72F9 7B74 EC55 1F03
# gpg --quiet --with-fingerprint /etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
pub 2048R/EC551F03 2010-07-01 Oracle OSS group (Open Source Software group) <build@oss.oracle.com>
Key fingerprint = 4214 4123 FECF C55B 9086 313D 72F9 7B74 EC55 1F03
CentOS7创建临时仓库文件
vi /etc/yum.repos.d/ol7-temp.repo
[ol7_latest]
name=Oracle Linux $releasever Latest ($basearch)
baseurl=https://yum.oracle.com/repo/OracleLinux/OL7/latest/$basearch/
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
gpgcheck=1
enabled=1
name=Oracle Linux $releasever Latest ($basearch)
baseurl=https://yum.oracle.com/repo/OracleLinux/OL7/latest/$basearch/
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
gpgcheck=1
enabled=1
安装甲骨文的仓库源
yum install oraclelinux-release-el7
然后禁用临时仓库,删除CentOS自带的仓库文件。
mv /etc/yum.repos.d/ol7-temp.repo /etc/yum.repos.d/ol7-temp.repo.disabled
CentOS8 首先导入 oracle的 GPG key。
wget https://yum.oracle.com/RPM-GPG-KEY-oracle-ol8 -O /etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
# gpg --import --import-options show-only /etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
pub rsa4096 2019-04-09 [SC] [expires: 2039-04-04]
76FD3DB13AB67410B89DB10E82562EA9AD986DA3
uid Oracle OSS group (Open Source Software group)
sub rsa4096 2019-04-09 [E] [expires: 2039-04-04]
# gpg --import --import-options show-only /etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
pub rsa4096 2019-04-09 [SC] [expires: 2039-04-04]
76FD3DB13AB67410B89DB10E82562EA9AD986DA3
uid Oracle OSS group (Open Source Software group)
sub rsa4096 2019-04-09 [E] [expires: 2039-04-04]
创建临时仓库文件
vi /etc/yum.repos.d/ol8-temp.repo
[ol8_baseos_latest]
name=Oracle Linux 8 BaseOS Latest ($basearch)
baseurl=https://yum.oracle.com/repo/OracleLinux/OL8/baseos/latest/$basearch/
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
gpgcheck=1
enabled=1
name=Oracle Linux 8 BaseOS Latest ($basearch)
baseurl=https://yum.oracle.com/repo/OracleLinux/OL8/baseos/latest/$basearch/
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
gpgcheck=1
enabled=1
安装甲骨文的仓库源
dnf install oraclelinux-release-el8
然后禁用临时仓库,删除CentOS8自带的仓库文件。
mv /etc/yum.repos.d/ol8-temp.repo /etc/yum.repos.d/ol8-temp.repo.disabled
如果文章对您有帮助,给个赞赏吧!