局域网Yum源的配置

xiaoxiao2025-09-19  24

服务器:提供软件仓库的服务,提供网络服务。客户端:与服务端要在同一个网络内,能够访问服务器,需要配置自己的yum源的配置文件。

准备服务器:service httpd status #查看httpd状态,发现不存在这个服务。所以要先安装安装httpd服务。

安装httpd服务

yum list | grep httpd ##查找yum -y install httpd.x86_64 ##安装http服务测试: service httpd start 浏览器页面访问192.168.91.3 把httpd设置为开机自启:chkconfig httpd on

准备软件包

将软件包放入http服务的根目录 /var/www/html

创建一个挂载点 mkdir /mnt/centos将镜像文件挂载到挂载点 mount -t iso9660 -o loop /dev/cdrom /mnt/centos将软件包拷贝到/var/www/html/centos中

ln -s /mnt/centos /var/www/html ##软连接到http服务的根目录中

配置局域网的yum源配置文件

cd /etc/yum.repos.drename .repo .repo.bak ./*cp CentOS-Base.repo.bak innet.repovi innet.repo 配置成这样 [innet]name=innetbaseurl=http://hadoop01/centosenabled=1gpgcheck=1gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6 yum clean allyum repolist 出现这样的结果: repo idrepo namestatusinnetinnet6,575repolist: 6,575
转载请注明原文地址: https://www.6miu.com/read-5036599.html

最新回复(0)