1. 挂载iso镜像,进入Packages目录下安装FTP服务

#rpm -ivh vsftpd-3.0.2-10.el7.x86_64.rpm

2. 修改vsftpd配置文件如下

[root@rusky Packages]# cat /etc/vsftpd/vsftpd.conf  | grep -v "#"
anonymous_enable=YES
local_enable=YES
write_enable=YES
local_umask=022
anon_upload_enable=YES
anon_mkdir_write_enable=YES
dirmessage_enable=YES
xferlog_enable=YES
connect_from_port_20=YES
xferlog_std_format=YES
ftpd_banner=Welcome to blah FTP service.
chroot_local_user=YES
chroot_list_enable=YES
chroot_list_file=/etc/vsftpd/chroot_list
listen=NO
listen_ipv6=YES
pam_service_name=vsftpd
userlist_enable=YES
tcp_wrappers=YES
anon_root=/yum_repo/rhel7.2 #匿名用户默认目录为/var/ftp/pub,此外修改为/yum_repo/rhel7.2
local_root=/yum_repo

创建匿名用户目录:mkdir -p /yum_repo/rhel7.2

3. 拷贝操作系统iso镜像中的Packages,repodata,RPM-GPG-KEY-redhat-release到/yum_repo/rhel7.2目录下

#cp -rf Packages  repodata  RPM-GPG-KEY-redhat-release /yum_repo/rhel7.2

[root@rusky rhel7.2]# pwd
/yum_repo/rhel7.2
[root@rusky rhel7.2]# ls
Packages repodata RPM-GPG-KEY-redhat-release

4. 停止防火墙、修改selinux为disabled

# systemctl start firewalld

#chkconfig firewalld off

#vi /etc/selinux/config

SELINUX=disabled

5. 创建repo库

# createrepo -g /yum_repo/rhel7.2/repodata/81c149ffb2267c59a3e6405766b5ff3dc78e0637033e9f5aef564538359ff281-comps-Server.x86_64.xml /yum_repo/rhel7.2/Packages/

6. 创建local.repo文件

[root@rhel7Oracle yum.repos.d]# vi /etc/yum.repos.d/local.repo

[RHEL7.2]
name=rhel7_repo
baseurl=ftp://192.168.1.202/Packages
enabled=1
gpgcheck=1
gpgkey=ftp://192.168.1.202/RPM-GPG-KEY-redhat-release

7. 启动vsftpd服务

#systemctl start vsftpd

#chkconfig vsftpd on --开机启动

8. 测试

ftp匿名访问

yum命令测试

[root@rusky rhel7.2]# yum list gcc
Loaded plugins: langpacks, product-id, search-disabled-repos, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
Installed Packages
gcc.x86_64 4.8.5-4.el7 @RHEL7.2
[root@rusky rhel7.2]# yum groups list
Loaded plugins: langpacks, product-id, search-disabled-repos, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
There is no installed groups file.
Maybe run: yum groups mark convert (see man yum)
Available Environment Groups:
Minimal Install
Infrastructure Server
File and Print Server
Basic Web Server
Virtualization Host
Server with GUI
Available Groups:
Compatibility Libraries
Console Internet Tools
Development Tools
Graphical Administration Tools
Legacy UNIX Compatibility
Scientific Support
Security Tools
Smart Card Support
System Administration Tools
System Management
Done
[root@rusky rhel7.2]#

 

Linux FTP YUM源搭建简单记录的更多相关文章

  1. 【Linux】YUM源搭建

    YUM是什么? YUM是什么 基于rpm但更胜于rpm的软件管理工具: YUM有服务端和客户端: 如果服务端和客户端在同一台机器,这是本地YUM: 如果服务端和客户端不在同一台机器,这是网络YUM. ...

  2. Linux 本地yum源搭建和网络yum源搭建

    一.本地yum源搭建 首先挂载上光盘 [root@www /]# mount /dev/cdrom /media/cdrom/ 系统默认已经安装了可使用yum的软件包,所以可以直接配置: [root@ ...

  3. linux服务搭建----ftp与ftp yum源搭建

    ftp服务     如果没有ftp         yum -y install  vsftpd (前提是你在有yum源的情况下才可以使用这条命令)     service vsftpd  resta ...

  4. linux 光盘yum源搭建

    1.挂载光盘 2.进入 /etc/yum.repos.d 目录,修改其它配置文件后缀名 mv CentOS-Base.repo CentOS-Base.repo.bakmv CentOS-CR.rep ...

  5. linux shell 自动判断操作系统release 然后连接FTP yum源的脚本

    如何搭建本地yum源见附录① 如何搭建FTP yum源见附录② 脚本正文: #!/bin/sh# CenterOS config yumOSV=`rpm -q --qf %{version} cent ...

  6. Linux光盘yum源软件安装

    关于Linux中的软件安装,有三种方法,个人认为比较方便的就是yum安装,有网的话比较简单,暂且不提.本文主要记录在没有外网的情况下,如何以本地光盘搭建yum源来实现yum安装. 主要包括以下几步: ...

  7. linux配置yum源

    yum(全称为 Yellow dog Updater, Modified)是一个在Fedora和RedHat以及SUSE中的Shell前端软件包管理器.基於RPM包管理,能够从指定的服务器自动下载RP ...

  8. 基于VSFTP的本地YUM源及光盘YUM源搭建

    基于VSFTP的本地YUM源及光盘YUM源搭建  一.yum环境的本地源搭建(基于VSFTP):  1)安装vsftp;     *********************************** ...

  9. linux替换yum源及配置本地源

    linux系统安装后自带的bash源由于在国外,安装软件包的时候会非常慢,最好替换一下yum源. ​关于yum源的简单介绍 ​           yum的主要功能是更方便地添加,删除和更新rpmba ...

随机推荐

  1. Nginx fastcgi_param解释

    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;#脚本文件请求的路径 fastcgi_param QUERY_STRI ...

  2. C语言学习笔记(二):指针的用法

    与其说指针是一种工具,不如先说指针是一种数据类型. -------------------------------------------------------------华丽的分割线------- ...

  3. 写个自己的Xcode4插件(二)

    补充上一篇: 一.在XCode5里面,要在info.plist里面再加入以下两个字段: 1. 内容要保持一致喔,别问我为什么,我也不知道,是参考其他许多插件发现的,那些插件都用了这个字段,而且内容一样 ...

  4. run_command函数分析

    一.概述 位置:common/main.c 功能:根据传入参数(命令),在命令存储区(.u_boot_cmd)中查找对应的命令,找到命令并调用对应的函数执行 流程: 二.分析 1.函数说明信息 /** ...

  5. 转:关于PHP性能优化

    原文来自于:http://www.cnblogs.com/qq78292959/archive/2012/12/28/2837272.html 1.升级硬件的一般规则:对于 PHP 脚本而言,主要的瓶 ...

  6. oracle中的exists 和not exists 用法详解(转)

    有两个简单例子,以说明 “exists”和“in”的效率问题 1) select * from T1 where exists(select 1 from T2 where T1.a=T2.a) ; ...

  7. HDU4681 String(dp)

    题目链接. #include <iostream> #include <cstdio> #include <cstring> #include <cstdli ...

  8. -_-#【jQuery插件】Colorpicker 颜色选择器

    Spectrum - The No Hassle jQuery Colorpicker (jQuery 插件) Color Picker jQuery plugins (jQuery 插件) colo ...

  9. (转载)mysql中百万级数据插入速度测试

    (转载)http://www.111cn.net/database/mysql/42453.htm 100W的数据对于很多朋友来说算小菜了,但今天我就想到创建一个大量数据的测试环境,于是找了一下怎么插 ...

  10. 数位DP:SPOJ KPSUM - The Sum

    KPSUM - The Sum One of your friends wrote numbers 1, 2, 3, ..., N on the sheet of paper. After that ...