- sudo yum install yum-plugin-downloadonly yum-utils createrepo
- mkdir /var/tmp/maria
- mkdir /var/tmp/maria-installroot
- [mariadb]
- name = MariaDB
- baseurl = http://yum.mariadb.org/10.3/centos7-amd64
- gpgkey = https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
- gpgcheck = 1
- sudo yum install --downloadonly --installroot=/var/tmp/maria-installroot --releasever=7 --downloaddir=/var/tmp/maria MariaDB-server MariaDB-client
- sudo curl https://yum.mariadb.org/RPM-GPG-KEY-MariaDB -o /etc/pki/rpm-gpg/RPM-GPG-KEY-MariaDB
- createrepo --database /var/tmp/maria
- sudo rm -rf /var/tmp/maria-installroot
- [mariadb-offline]
- name = MariaDB-offline
- baseurl = file:///var/tmp/maria
- enabled = 0
- checkgpg = 1
- gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 file:///etc/pki/rpm-gpg/RPM-GPG-KEY-MariaDB
- repoclosure --repoid=mariadb-offline
- tar -cvf mariadb-offline.tar /var/tmp/maria
- tar -xvf mariadb-offline.tar -C /
- sudo yum --disablerepo=\* --enablerepo=mariadb-offline install MariaDB-server MariaDB-client
- systemctl start mariadb
java-1.8.0-openjdk 類似的過程:雖然官方 yum 有收此套件,省了多一組 GPG-KEY 的問題,但可能另外遇到目標主機沒有經過 yum update,以致 nss 比 openjdk 所需版本要舊。解決之道二選一:
- 出貨端要求各被安裝系統需求為「近日曾做過 yum update」,而且每次出貨前都先 yum update 再包離線安裝檔。(顯然是個爛方法)
- 離線安裝包增加 nss nss-tools(如果有需要的話,可能也要納入更多版本不符的套件),並且在安裝時額外指定一併安裝 nss 套件。
沒有留言:
張貼留言