CentOS7.2配置FTP yum源

CentOS7.2配置FTP yum源

0 安装准备

192.168.137.129 centos yum源\FTP服务器
192.168.137.130 centos1 客户端

1 安装vsftp

在centos主机执行命令:

yum install -y vsftpd
systemctl start vsftpd
systemctl enable vsftpd

2 关闭防火墙

在centos主机执行命令

iptables -P INPUT ACCEPT #修改默认策略为ACCEPT
iptables -F
systemctl stop firewalld.service
systemctl disable firewalld.service

3 查看共享目录

在centos主机执行命令

rpm -ql vsftpd

查询结果

/var/ftp
/var/ftp/pub

4 拷贝rpm包

以配置glusterfs yum源为例
在/var/ftp/pub目录下新建glusterfs

mkdir -p /var/ftp/pub/glusterfs
cp -p rpm包 /var/ftp/pub/glusterfs

5 生成repodata

####5.1 安装createrepo

yum install -y createrepo
5.2 生产repodata
cd /var/ftp/pub/glusterfs
createrepo ./

生成结果:
Spawning worker 0 with 8 pkgs
Workers Finished
Saving Primary metadata
Saving file lists metadata
Saving other metadata
Generating sqlite DBs
Sqlite DBs complete

6 配置yum源

在centos1主机上执行命令

cat << EOF > /etc/yum.repos.d/glusterfs.repo
[glusterfs]
name=glusterfs
baseurl=ftp://192.168.137.129/pub/glusterfs
pgpcheck=0
EOF

7 测试yum源

在centos1主机上执行

yum makecache
yum list | grep glusterfs
1.查看系统本身存在的版本 rpm -qa | grep yum 2.卸载centos7上存在的yum安装源包 rpm -e 源包 --nodeps 3.下载yum源包(http://mirrors.163.com/centos/7/os/x86_64/Packages/) yum-metadata-parser-1.1.4-10.el7.x86_64 PackageKit-yum-1.0.7-6.el7.centos.x86_64 yum-utils-1.1.31-40.el7.noarch 下方两个一起装 yum-plugin-fastestmirror-1.1.31-40.el7.noarch yum-langpacks-0.4.2-7.el7.noarch yum-3.4.3-150.el7.centos.noarch yum-rhn-plugin-2.0.1-6.el7.noarch 4.安装yum源包 rpm -ivh yum* 5.创建配置文件(/etc/yum.repos.d/CentOS-Base.repo) vi /etc/yum.repos.d/CentOS-Base.repo [base] name=CentOS-$releasever - Base - 163.com #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch;=$basearch&repo=os baseurl=http://mirrors.163.com/centos/(系统版本号)7/os/$basearch/ gpgcheck=1 gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-7 #released updates [updates] name=CentOS-$releasever - Updates - 163.com #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch;=$basearch&repo=updates baseurl=http://mirrors.163.com/centos/7/updates/$basearch/ gpgcheck=1 gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-7 #additional packages that may be useful [extras] name=CentOS-$releasever - Extras - 163.com #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch;=$basearch&repo=extras baseurl=http://mirrors.163.com/centos/7/extras/$basearch/ gpgcheck=1 gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-7 #additional packages that extend functionality of existing packages [centosplus] name=$releasever - Plus - 163.com baseurl=http://mirrors.163.com/centos/7/centosplus/$basearch/ gpgcheck=1 enabled=0 gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-7 每一个baseurl的centos后都改成自己系统的版本号 6.执行命令 yum clean all yum makecache yum install telnet
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值