【内网搭建http yum源】

一、将镜像上传至服务器
二、挂载本地安装vsftp

[root@ ~]# mkdir /yum
[root@ ~]# mv /home/4ajr/CentOS-7-x86_64-DVD-2009.iso /
[root@ ~]# mount -o loop /CentOS-7-x86_64-DVD-2009.iso /yum
mount: /dev/loop0 is write-protected, mounting read-only
[root@ ~]# yum repolist
Loaded plugins: product-id, search-disabled-repos, subscription-manager
This system is not registered with an entitlement server. You can use subscription-manager to register.
Repodata is over 2 weeks old. Install yum-cron? Or run: yum makecache fast
repo id                                                                                      repo name                                                                                    status
!rhel7.6                                                                                     rhel7.6                                                                                      5,152
repolist: 5,152
[root@ ~]# vim /etc/yum.repos.d/
redhat.repo  centos.repo    
[root@ ~]# vim /etc/yum.repos.d/centos.repo 
[centos]
name=centos
baseurl=file:///yum
enabled=1
gpgcheck=0

三、安装httpd并挂载镜像

[root@ ~]# yum -y install httpd
[root@ ~]# cd /var/www/html
[root@  pub]# mkdir centos7
[root@ pub]# mount -o loop /CentOS-7-x86_64-DVD-2009.iso 
/var/www/html/centos7
mount: /dev/loop2 is write-protected, mounting read-only
[root@ ]# service httpd restart

四、客户端验证

[root@ ~]# vim /etc/yum.repos.d/RHEL.repo 
[http]
name=http
baseurl=http://1.1.1.1/centos7
enabled=1
gpgcheck=0
[root@ ~]# yum clean all
[root@ ~]# yum repolist
Loaded plugins: product-id, search-disabled-repos, subscription-manager
This system is not registered with an entitlement server. You can use subscription-manager to register.
http                                                                                                                                                                     | 3.6 kB  00:00:00     
(1/2): http/group_gz                                                                                                                                                     | 153 kB  00:00:00     
(2/2): http/primary_db                                                                                                                                                   | 3.3 MB  00:00:00     
repo id                                                                                       repo name                                                                                   status
http                                                                                          http                                                                                        4,070
repolist: 4,070
[root@ ~]# yum -y install telnet
Loaded plugins: product-id, search-disabled-repos, subscription-manager
This system is not registered with an entitlement server. You can use subscription-manager to register.
Resolving Dependencies
--> Running transaction check
---> Package telnet.x86_64 1:0.17-65.el7_8 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================================================================================================================================
 Package                                     Arch                                        Version                                                Repository                                 Size
================================================================================================================================================================================================
Installing:
 telnet                                      x86_64                                      1:0.17-65.el7_8                                        http                                       64 k

Transaction Summary
================================================================================================================================================================================================
Install  1 Package

Total download size: 64 k
Installed size: 113 k
Downloading packages:
telnet-0.17-65.el7_8.x86_64.rpm                                                                                                                                          |  64 kB  00:00:00     
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : 1:telnet-0.17-65.el7_8.x86_64                                                                                                                                                1/1 
  Verifying  : 1:telnet-0.17-65.el7_8.x86_64                                                                                                                                                1/1 

Installed:
  telnet.x86_64 1:0.17-65.el7_8       
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值