基于http构建yum网络源 和‘/mnt/packages/*’: No such file or directory问题?

  1. 挂载光盘镜像文件到 /mnt
    mount /dev/cdrom /mnt/

  2. 复制 /mnt/Packages目录下的所有软件包到 /var/www/html/centos/
    mkdir -p /var/www/centos/
    cp -R /mnt/Packages/* /var/www/html/centos/

3.使用createrepo创建本地源
yum install createrepo * -y
cd /var/www/html
createrepo centos/

4.用http发布yum源
yum install httpd httpd-devel-y
useradd apache -g apache
systemctl restart httpd.service
setenforce 0
systemctl stop firewalld.server
ps -ef|greap httpd

5.在yum源,创建/etc/yum.repo.d/http.repo文件
[base]
name=“CentOS7 HTTP YUM”
baseurl=http://192.168.91.128/centos/
gpgcheck=0
enable=1
[updatas]
name=“CentOS HTTP YUM”
baseurl=http://192.168.91.128/centos/
gpgcheck=0
enable=1

6.在yum客户端执行下面命令
yum clean all
yum install ntpdate-y

问题:
第二步
[root@localhost ~]# cp -R /mnt/packages/* /Var/www/html/centos/
cp: cannot stat ‘/mnt/packages/*’: No such file or directory
解决方法:
1.cat /etc/sysconfig/network-scripts/ifcfg-ens33
查看ONBOOT=yes 是否是yes 开启状态
2.ping www.baidu.com 是否ping通
3.yum install tree 是否能用yum
4.ls /mnt/Packages 是否有这个包

  • 2
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值