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源的檔案
- 【Linux】Linux軟體安裝管理2 使用安裝光碟配置本地yum倉庫Linux
- 不需上網,本地光碟yum源的搭建
- 小凡帶你搭建本地的光碟yum源
- linux配置本地yum安裝--FTP yumLinuxFTP
- 本地yum源搭建
- 本地搭建yum源
- oracle linux使用安裝盤製作本地yumOracleLinux
- 本地yum庫製作及本地安裝DockerDocker
- RedHat Linux 本地Yum源安裝RedhatLinux
- Linux學習-通過光碟配置本地yum源Linux
- 配置本地yum源及安裝必要的包
- Puppet+foreman 本地yum安裝手冊REM
- 12C安裝及本地YUM源配置
- 在Linux作業系統上使用光碟搭建yum源Linux作業系統
- 【Linux】Linux軟體安裝管理5 掛載本地iso光碟映象、配置yum軟體倉庫Linux
- yum安裝及使用全集
- yum如何解除安裝已安裝的rpm並安裝本地rpm包
- Linux安裝MySQL(使用yum)LinuxMySql
- 使用yum安裝oracle的包Oracle
- RHEL7安裝本地離線yum源倉庫
- yum安裝
- mysql安裝 (yum 安裝)MySql
- 《Openstack的搭建》RHEL6.5
- CentOS 7.0下使用yum安裝MySQLCentOSMySql
- 使用Yum安裝MongoDB Linux版MongoDBLinux
- 使用yum 命令安裝 dotnet 6
- centos7中使用yum安裝NGINX安裝CentOSNginx
- yum 安裝 PHPPHP
- mysql yum 安裝MySql
- yum安裝nginxNginx
- yum安裝lampLAMP
- yum安裝mysqlMySql
- centos7.5利用yum快取搭建本地源CentOS快取
- Firewalld共享上網及本地yum倉庫搭建
- mysql5.7.17 64位rhel6.5下安裝MySql
- MySQL 原始碼安裝及yum的使用MySql原始碼
- 拿到了SAP安裝光碟