RHEL7 本地yum源配置
2016-09-10 16:47
375 查看
配置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 .repo #建立yum配置文件
vi dvd.repo #编辑配置文件,添加以下内容
[rhel-yum]
name=dvd #自定义名称
baseurl=file:///mnt#本地光盘挂载路径
enabled=1 #启用yum源,0为不启用,1为启用
gpgcheck=1 #检查GPG-KEY,0为不检查,1为检查
gpgkey=file:///media/cdrom/RPM-GPG-KEY-redhat-release #GPG-KEY路径
:wq! #保存退出
4、、测试使用yum命令自动安装软件
yum clean all #清除yum缓存
yum makecache #缓存本地yum源中的软件包信息
yum install httpd #安装apache
rpm -ql httpd #查询所有安装httpd的目录和文件
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软件)
1、挂载DVD光盘到/mnt 因为配置时候路径名里面不能有空格,否则不能识别 [root@ mnt]# mount /dev/cdrom /mnt
2、在目录/etc/yum.repos.d/创建文件文件名.repo
3、配置本地yum源
cd /etc/yum.repos.d/ #进入yum配置目录
touch .repo #建立yum配置文件
vi dvd.repo #编辑配置文件,添加以下内容
[rhel-yum]
name=dvd #自定义名称
baseurl=file:///mnt#本地光盘挂载路径
enabled=1 #启用yum源,0为不启用,1为启用
gpgcheck=1 #检查GPG-KEY,0为不检查,1为检查
gpgkey=file:///media/cdrom/RPM-GPG-KEY-redhat-release #GPG-KEY路径
:wq! #保存退出
4、、测试使用yum命令自动安装软件
yum clean all #清除yum缓存
yum makecache #缓存本地yum源中的软件包信息
yum install httpd #安装apache
rpm -ql httpd #查询所有安装httpd的目录和文件
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软件)
相关文章推荐
- RHEL6.1配置光盘为本地yum源
- RHEL 6.2配置本地yum源
- 配置本地yum源安装RHEL6.x图形化界面
- centos6配置本地光盘yum源、rhel7修改网卡名称为eth0
- LInux学习笔记---RHEL6配置本地yum源
- 配置光盘为本地yum源(rhel6.1)
- RHEL6.2服务器本地yum源配置
- RHEL6.3配置本地yum源
- RHEL5与CentOS本地yum源baseurl配置区别
- RHEL 6.2配置本地yum源
- [zz]RHEL 6.2配置本地yum源
- rhel5.5配置本地yum源
- RHEL6 配置本地YUM源
- RHEL6.4配置光盘为本地yum源
- RHEL 配置本地YUM源
- RHEL 6.2配置本地yum源
- [Linux] RHEL配置本地YUM源
- rhel6.0 配置本地yum源
- RHEL6.5服务器本地yum源配置
- RHEL6.1配置光盘为本地yum源