在linux操作系统中,yum服务器是一种重要的配置,其可以分两种,一种是在本地;另一种是通过远程比如ftp或者http服务器进行访问,yum能够很好地解决linux中数据安装包依赖的关系,让我们看看在linux中是怎样实现yum配置的吧。。。。。


首先来看看本地yum的配置:

编辑文件[root@localhost ~]# vim  /etc/yum.repos.d/rhel-debuginfo.repo,其中包括各种服务仓库,注释,访问方式,等等......

linux yum安装stress linuxyum怎么安装_Red

详细的配置命令如下,只要加到/etc/yum.repos.d/rhel-debuginfo.repo中就可以实现本地yum了

[rhel-Server]
name=Red Hat Enterprise Server $releasever - $basearch - Debug
baseurl=file:///mnt/cdrom/Server
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
[rhel-VT]
name=Red Hat Enterprise VT $releasever - $basearch - Debug
baseurl=file:///mnt/cdrom/VT
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
[rhel-Cluster]
name=Red Hat Enterprise Cluster $releasever - $basearch - Debug
baseurl=file:///mnt/cdrom/Cluster
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
[rhel-ClusterStorage]
name=Red Hat Enterprise ClusterStorage $releasever - $basearch – Debug
baseurl=file:///mnt/cdrom/ClusterStorage
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release

 

接下来就是通过远程服务访问yum的配置了,为什么要通过远程服务去访问yum呢?众所周知,如果在一个局域网中有很多台linux操作平台,如果在每一台上都配置yum这是一件既浪费时间又浪费资源的事情,而通过远程访问就能够很好的解决这个问题,就是在一台linux操作平台上配置yum服务仓库,让其作为一台服务器,其它的作为客户端进行访问..........

 

现在来配置通过ftp访问的yum服务器端

1.配置作为服务器端的ip地址       输入命令:[root@localhost ~]# setup

出现如下界面

linux yum安装stress linuxyum怎么安装_操作系统_02

linux yum安装stress linuxyum怎么安装_Red_03

linux yum安装stress linuxyum怎么安装_运维_04

linux yum安装stress linuxyum怎么安装_操作系统_05

接下来安装ftp服务器    挂载RedHat光盘:

[root@localhost ~]# mount /dev/cdrom /mnt/cdrom

linux yum安装stress linuxyum怎么安装_linux yum安装stress_06

启动ftp服务后把/mnt/cdrom中的所有文件拷贝到/var/ftp文件夹下,客户端通过ftp可以直接访问到该文件夹

这时候,作为服务器端的yum已经配置好了

接下来就是配置客户端,和本地yum配置一样,只是访问方式不同

依旧在该文件下配置文件

[root@localhost ~]# vim/etc/yum.repos.d/rhel-debuginfo.repo

linux yum安装stress linuxyum怎么安装_操作系统_07


这时候客户端也配置好了,可以通过ftp进行访问了。。。。。。。。。。


这时候yum就全部配置好了



 


转载于:https://blog.51cto.com/slayr/1259559