当前位置:网站首页>RadHat搭建内网YUM源服务器
RadHat搭建内网YUM源服务器
2022-07-01 16:49:00 【星哥玩云】
前言:随着内网Linux服务器越来越多,在每台服务器上安装软件,都要先把安装盘上传上去,在配置本地yum服务,即麻烦又费时。可以在内网的一台Linux服务器上安装yum服务,然后其他服务器直接修改repo文件使用yum服务就可以了。
安装步骤如下:
Linux系统环境
1.RHEL版本
[[email protected] pub]# cat /etc/issue Red Hat Enterprise Linux Server release 6.5 (Santiago)
2.内核版本
[[email protected] pub]# uname -a
Linux localhost40.localdomain 2.6.32-431.el6.x86_64
搭建服务器本地YUM
1.上传RHEL安装光盘文件到Home目录,命名为RHEL.ISO
2.创建目录/home/RHEL/
#mkdir /home/RHEL/
3.挂在安装光盘ISO文件
#mount -o loop /home/RHEL.ISO /home/RHEL/
4.进入/etc/yum.repos.d/目录,备份原有的repo文件,创建新的repo文件,RHEL.repo
#cd /etc/yum.repos.d/ #mkdir bak/ #cp * bak/ #vi RHEL.repo ############################# [rhel6] name=rhel6 baseurl=file:///home/RHEL enabled=1 gpgcheck=0 #############################
5.保存RHEL.repo后执行
# yum clean all # yum update
# yum makecache
安装并配置vsftpd服务
1.安装vsftpd服务
yum install vsftpd*
2.安装完成后,复制/home/RHEL/ 目录下的所有文件到/var/ftp/pub 目录中
#cd /home/RHEL #cp -rv * /var/ftp/pub
3、切换到 /var/ftp/pub目录
删除*.html 删除CentOS/repodata/TRANS.TBL #cd /var/ftp/pub #rm -rf *.html
#rm -rf repodata/TRANS.TBL
安装createrepo工具,生成YUM通用数据库
1. 安装createrepo
#yum -y install createrepo #createrepo -g /var/ftp/pub/repodata/6221039e7e3dabf7d538c76571d82aaf42b6292b8f6fe6cf56b8fcf1cff3d3ab-comps-rhel6-Server.xml /var/ftp/pub/
注:这里6221039e7e3dabf7d538c76571d82aaf42b6292b8f6fe6cf56b8fcf1cff3d3ab-comps名称可能每个系统不一样,找准后面是comps-rhel6-Server.xml就行了。
重启vsftp,配置完成。
#/etc/init.d/vsftpd restart 或者
#service vsftpd restart
客户端yum配置
1.进入/etc/yum.repos.d/目录,备份原有的repo文件,创建新的repo文件,RHEL.repo
#cd /etc/yum.repos.d/ #mkdir bak/ #cp * bak/ #vi RHEL.repo ############################# [rhel6] name=rhel6 baseurl=ftp://192.9.169.99/pub/ enabled=1 gpgcheck=0 #############################
2.注意上面的baseurl是刚才安装yum服务器的ftp地址,安装完成后执行
# yum clean all # yum update
# yum makecache
常用的yum命令
1.安装
yum install package 安装指定的安装包package1 yum localinstall package 本地安装软件包
2.更新和升级
yum update 全部更新 yum update package 更新指定程序包package yum check-update 检查可更新的程序
3.查找和显示
yum info <package> 显示安装包信息 yum list 显示所有已经安装和可以安装的程序包 yum list <package> 显示指定程序包安装情况 yum search <keyword>查找软件包
4.删除程序
yum remove | erase package1 删除程序包 yum 会把下载的软件包和header存储在cache中,而不会自动删除。如果我们觉得它们占用了磁盘空间,可以使用yum clean指令进行清除. yum clean headers清除header yum clean packages清除下载的rpm包 yum clean all 清除header与rpm包
边栏推荐
- Judge whether the binary tree is a binary search tree
- Babbitt | yuan universe daily must read: Naixue coin, Yuan universe paradise, virtual stock game Do you understand Naixue's tea's marketing campaign of "operation pull full"
- Template engine velocity Foundation
- Research and investment strategy report of neutral protease industry in China (2022 Edition)
- Shenyu gateway development: enable and run locally
- Transition technology from IPv4 to IPv6
- China carbon disulfide industry research and investment strategy report (2022 Edition)
- 中国锦纶长丝缝纫线发展预测与投资方向研究报告(2022版)
- How to repair the laptop that cannot connect to the wireless network
- Installation and use of sqoop
猜你喜欢
vulnhub靶场-Hacker_Kid-v1.0.1
Basic usage of Frida
Computed property “xxx“ was assigned to but it has no setter.
整形数组合并【JS】
Redis 分布式鎖
In aks, use secret in CSI driver mount key vault
SQL question brushing 1050 Actors and directors who have worked together at least three times
Template engine velocity Foundation
Exclusive news: Alibaba cloud quietly launched RPA cloud computer and has opened cooperation with many RPA manufacturers
Installation and use of sqoop
随机推荐
sql刷题586. 订单最多的客户
如何使用 etcd 实现分布式 /etc 目录
What are the differences between PHP and DW
Shenyu gateway development: enable and run locally
China nylon 11 industry research and future forecast report (2022 Edition)
mysql -- explain性能优化
剑指 Offer 20. 表示数值的字符串
Detailed explanation of activity life cycle and startup mode
vulnhub靶场-Hacker_Kid-v1.0.1
Gaussdb (for MySQL):partial result cache, which accelerates the operator by caching intermediate results
Activity的生命周期和启动模式详解
中国一次性卫生用品生产设备行业深度调研报告(2022版)
《中国智慧环保产业发展监测与投资前景研究报告(2022版)》
Redis6.0 新功能
Template engine velocity Foundation
存在安全隐患 起亚召回部分K3新能源
【牛客网刷题系列 之 Verilog快速入门】~ 优先编码器电路①
中国乙腈市场预测与战略咨询研究报告(2022版)
[kotlin] Introduction to higher-order functions
中国氮化硅陶瓷基板行业研究与投资前景报告(2022版)