redhat本地yum源配置

Posted 求知若饥,虚心若愚。

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了redhat本地yum源配置相关的知识,希望对你有一定的参考价值。

1.每次手动挂载

/dev/sr0是光驱的设备名,/dev/cdrom代表光驱

/dev/sr0 与/dev/cdrom

/dev/cdrom 只是一个到sr0的符号链接

mount /dev/sr0   /mnt   挂载
umount  /dev/sr0 /mnt  卸载
vi /etc/yum.repos.d/rhel-rource.repos
yum list

 

 

2.上传iso包,自动挂载

 

[root@node2 software]# grep iso /etc/fstab 
/software/redhat6.8.iso	/mnt	iso9660	loop	0 0

  

[root@node2 software]# ll
total 3787780
-rw-r--r-- 1 root root 3878682624 May 15 06:44 rhel-server-6.8-x86_64-dvd.iso
[root@node2 software]# mv rhel-server-6.8-x86_64-dvd.iso  redhat6.8.iso
[root@node2 software]# ll
total 3787780
-rw-r--r-- 1 root root 3878682624 May 15 06:44 redhat6.8.iso
[root@node2 software]# mount /software/redhat6.8.iso /mnt
mount: /software/redhat6.8.iso is not a block device (maybe try `-o l
oop\'?)[root@node2 software]# mount /software/redhat6.8.iso /mnt -o loop
[root@node2 software]# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/sda3              45G   29G   14G  68% /
tmpfs                 1.9G  483M  1.4G  26% /dev/shm
/dev/sda1             283M   39M  229M  15% /boot
/software/redhat6.8.iso
                      3.7G  3.7G     0 100% /mnt
[root@node2 software]# umount /mnt/
[root@node2 software]# df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/sda3        45G   29G   14G  68% /
tmpfs           1.9G  483M  1.4G  26% /dev/shm
/dev/sda1       283M   39M  229M  15% /boot
[root@node2 software]# vi /etc/fstab 
[root@node2 software]# grep iso /etc/fstab 
/software/redhat6.8.iso	/mnt	iso9660	loop	0 0
[root@node2 software]# mount -a
[root@node2 software]# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/sda3              45G   29G   14G  68% /
tmpfs                 1.9G  483M  1.4G  26% /dev/shm
/dev/sda1             283M   39M  229M  15% /boot
/software/redhat6.8.iso
                      3.7G  3.7G     0 100% /mnt
[root@node2 software]# yum install gcc
Loaded plugins: product-id, refresh-packagekit, search-disabled-repos, security, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
Setting up Install Process
rhel-source                                                                                                                                                                               | 4.1 kB     00:00 ... 
Package gcc-4.4.7-17.el6.x86_64 already installed and latest version
Nothing to do
[root@node2 software]# 

 参考资料:

  1.Linux软件安装管理:挂载本地iso光盘镜像、配置yum软件仓库

以上是关于redhat本地yum源配置的主要内容,如果未能解决你的问题,请参考以下文章

redhat配置yum静态源

redhat 配置本地yum源163yum源epel 源,无需卸载yum!无须拷贝ISO

如何设置redhat为centos yum 源

redhat配置本地yum源

如何设置redhat yum 源

redhat系列yum本地源配置