ftp方式搭建云仓库
服务端:192.168.1.100
客户端:192.168.1.200
服务端
1.服务端安装vsftp服务
root@localhost ~]#yum install vsftpd.x86_64 -y
2.服务端切换到 ftp目录下新建一个centos7目录
[root@localhost ~]#cd /var/ftp/
[root@localhost /var/ftp]#ls
pub
[root@localhost /var/ftp]#mkdir centos7
[root@localhost /var/ftp]#ls
centos7 pub
3.将光驱挂载到 centos7目录
[root@localhost ~]#mount /dev/sr0 /var/ftp/centos7/
mount: /dev/sr0 写保护,将以只读方式挂载
如果提示找不到进入虚拟机里设置
4.开启vsftpd服务
[root@localhost ~]#systemctl start vsftpd 开启vsftpd 服务
[root@localhost ~]#systemctl status vsftpd 查看服务状态
客户端
[root@localhost ~]# cd /etc/yum.repos.d/ 进入客户端yum指定目录
[root@localhost yum.repos.d]# ls 查看网络源
CentOS-Base.repo CentOS-Debuginfo.repo CentOS-Media.repo CentOS-Vault.repo
CentOS-CR.repo CentOS-fasttrack.repo CentOS-Sources.repo
[root@localhost yum.repos.d]# mkdir bak 创建新文件夹
[root@localhost yum.repos.d]# ls 查看文夹是否创建成功
bak CentOS-CR.repo CentOS-fasttrack.repo CentOS-Sources.repo
CentOS-Base.repo CentOS-Debuginfo.repo CentOS-Media.repo CentOS-Vault.repo
[root@localhost yum.repos.d]# mv *repo bak/ 将网络源移动到bak防止网络源干扰造成失败
[root@localhost yum.repos.d]# ls 查看是否移动成功
bak
[root@localhost yum.repos.d]# vim ftp.repo 创建以。repo结尾的文件
[root@localhost yum.repos.d]# yum clean all 清理缓存
已加载插件:fastestmirror, langpacks
正在清理软件源: gy
Cleaning up everything
Maybe you want: rm -rf /var/cache/yum, to also free up space taken by orphaned data from disabled or removed repos
[root@localhost yum.repos.d]# yum makecache 建立元数据
已加载插件:fastestmirror, langpacks
gy | 3.6 kB 00:00:00
(1/4): gy/group_gz | 156 kB 00:00:00
(2/4): gy/filelists_db | 3.1 MB 00:00:00
(3/4): gy/primary_db | 3.1 MB 00:00:00
(4/4): gy/other_db | 1.2 MB 00:00:00
Determining fastest mirrors
元数据缓存已建立
验证
[root@localhost yum.repos.d]# yum install tree.x86_64 -y标签:ftp,00,CentOS,仓库,repo,yum,root,localhost,搭建 From: https://www.cnblogs.com/sl08/p/17617455.html
yum安装tree