基于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 是否有这个包

发布了7 篇原创文章 · 获赞 2 · 访问量 52

猜你喜欢

转载自blog.csdn.net/qq_45645003/article/details/104325290