温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

centos7配置本地yum源

发布时间:2020-07-18 17:08:01 来源:网络 阅读:672 作者:xingq55 栏目:系统运维

RHEL7 配置yum 源

1、挂载DVD光盘到/mnt 因为配置时候路径名里面不能有空格,否则不能识别 [root@ mnt]# mount /dev/cdrom /mnt

2、在目录/etc/yum.repos.d/创建文件文件名.repo

3、配置本地yum源

cd /etc/yum.repos.d/ #进入yum配置目录

touch rhel7.repo #建立yum配置文件

vim rhel7.repo #编辑配置文件,添加以下内容

[rhel-yum]

name=rhel7 #自定义名称

baseurl=file:///mnt#本地光盘挂载路径

enabled=1 #启用yum源,0为不启用,1为启用

gpgcheck=0 #检查GPG-KEY,0为不检查,1为检查

:wq! #保存退出

RHEL7 本地yum源配置
centos7配置本地yum源
4、、测试使用yum命令自动安装软件

yum clean all #清除yum缓存

yum makecache #缓存本地yum源中的软件包信息
centos7配置本地yum源
yum install httpd #安装apache

rpm -ql httpd #查询所有安装httpd的目录和文件
centos7配置本地yum源
systemctl start httpd.service #启动apache

systemctl stop httpd.service #停止apache

systemctl restart httpd.service #重启apache

systemctl enable httpd.service #设置开机启动

RHEL 7.0默认使用的是firewall作为防火墙,这里改为iptables防火墙。

5、通过yum安装GUI图形界面# yum -y groupinstall "Server with GUI"可以执行startx看下效果。

通过yum卸载软件 yum -y remove httpd(移除httpd软件)

向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

AI