RHEL6.5使用安裝光碟搭建本地YUM
1、掛載光碟
[root@linuxclient ~]# mount /dev/cdrom /media/
mount: block device /dev/sr0 is write-protected, mounting read-only
mount: block device /dev/sr0 is write-protected, mounting read-only
2、備份系統的repo檔案
[root@linuxclient ~]# cd /etc/yum.repos.d/
[root@linuxclient yum.repos.d]# ls
CentOS6-Base-163.repo rhel-source.repo
[root@linuxclient yum.repos.d]# mkdir bak
[root@linuxclient yum.repos.d]# mv *.repo bak/
[root@linuxclient yum.repos.d]# ls
bak
[root@linuxclient yum.repos.d]# ls
CentOS6-Base-163.repo rhel-source.repo
[root@linuxclient yum.repos.d]# mkdir bak
[root@linuxclient yum.repos.d]# mv *.repo bak/
[root@linuxclient yum.repos.d]# ls
bak
3、建立本地的repo檔案
[root@linuxclient yum.repos.d]# cat local.repo
[Local]
baseurl=file:///media/Server
gpgcheck=1
enabled=1
[Local]
baseurl=file:///media/Server
gpgcheck=1
enabled=1
4、匯入金鑰(如果上面的gpgcheck=0,這一步可以跳過)
5、清除快取
[root@linuxclient yum.repos.d]# yum clean all
Loaded plugins: product-id, refresh-packagekit, security, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
Repository 'Local' is missing name in configuration, using id
Cleaning repos: Local
Cleaning up Everything
Loaded plugins: product-id, refresh-packagekit, security, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
Repository 'Local' is missing name in configuration, using id
Cleaning repos: Local
Cleaning up Everything
6、重新生成快取
[root@linuxclient yum.repos.d]# yum makecache
Loaded plugins: product-id, refresh-packagekit, security, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
Repository 'Local' is missing name in configuration, using id
Local | 3.9 kB 00:00 ...
Local/group_gz | 204 kB 00:00 ...
Local/filelists_db | 3.8 MB 00:00 ...
Local/primary_db | 3.1 MB 00:00 ...
Local/other_db | 1.6 MB 00:00 ...
Metadata Cache Created
Loaded plugins: product-id, refresh-packagekit, security, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
Repository 'Local' is missing name in configuration, using id
Local | 3.9 kB 00:00 ...
Local/group_gz | 204 kB 00:00 ...
Local/filelists_db | 3.8 MB 00:00 ...
Local/primary_db | 3.1 MB 00:00 ...
Local/other_db | 1.6 MB 00:00 ...
Metadata Cache Created
7、根據以上步驟編寫指令碼
[root@precise ~]# cat createlocalyum.sh
#!/bin/bash
cd /etc/yum.repos.d/
mkdir bak
mv *.repo bak/
cat << EOF > local.repo
[Local]
baseurl=file:///media/Server
gpgcheck=1
enabled=1
EOF
rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-*
yum clean all
yum makecache
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/28536251/viewspace-1750096/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 搭建本地yum源,使用安裝光碟的rpm作為yum源的檔案
- 不需上網,本地光碟yum源的搭建
- 小凡帶你搭建本地的光碟yum源
- oracle linux使用安裝盤製作本地yumOracleLinux
- 本地yum源搭建
- Linux學習-通過光碟配置本地yum源Linux
- Linux安裝MySQL(使用yum)LinuxMySql
- yum如何解除安裝已安裝的rpm並安裝本地rpm包
- 使用yum 命令安裝 dotnet 6
- RHEL6.5安裝supervisor-3.3.1-py2.6.egg
- RHEL7安裝本地離線yum源倉庫
- centos7中使用yum安裝NGINX安裝CentOSNginx
- CentOS 7.0下使用yum安裝MySQLCentOSMySql
- linux 安裝yum 安裝phpLinuxPHP
- Linux 安裝 yumLinux
- yum安裝ansible
- yum 安裝 jenkinsJenkins
- yum安裝nginxNginx
- mysql yum 安裝MySql
- yum 安裝 PHPPHP
- Centos6下使用yum安裝MariaDBCentOS
- linux yum下載依賴包到本地,不進行安裝Linux
- CentOS安裝配置yumCentOS
- AIX的yum安裝AI
- 【Linux】yum 安裝nginxLinuxNginx
- postgres yum源安裝
- Firewalld共享上網及本地yum倉庫搭建
- centos7.5利用yum快取搭建本地源CentOS快取
- centos7安裝mysql5.7 使用yumCentOSMySql
- Linux 使用Yum安裝Go和配置環境LinuxGo
- centos7使用yum安裝lnmp環境CentOSLNMP
- 安裝最新版MySQL(yum安裝)MySql
- 使用nexus搭建yum倉庫
- yum安裝與原始碼安裝比較原始碼
- Linux下安裝java及配置(yum安裝)LinuxJava
- PostgreSQL 10.12 安裝系列 - Yum+rpm 安裝SQL
- 一鍵安裝yum-utils安裝包
- CentOS下使用yum方式安裝percona xtrabackup步驟CentOS
- yum安裝kubeadm、kubelet、kubectl