第四章部署yum仓库服务

1.笔记

systemctl start 命令 :重启

systemctl enable 命令 :开机自启动

netstat -anput | grep 命令:查看是否开启

echo $ ?:判断上条命令是否执行成功,是0执行成功,非0不成功

yum provides 包:查看包名

2.基于ftp://的本地光盘创建yum仓库过程

yum -y install ftp (安装ftp 软件包)

umount /dev/sr0      (卸载光盘 /dev/sr0)

mkdir /var/ftp/centos7  (建立目录,在/var/ftp/centos7)

mount /dev/sr0 /var/ftp/centos7/(挂载/dev/sr0 挂载/var/ftp/centos7)

vim /etc/yum.repos.d/local.repo  (编辑/etc/yum.repos.d/local.repo)

[local](仓库名称)

name=local(仓库名称)

baseurl=ftp://192.168.203.4(本机地址)/centos7(指定rpm包的位置)

gpgcheck=0(禁用gpg 校验)

enabled=1(启用本地yum仓库)

yum  -y clean all(清空缓存)

yum makecache(重建缓存)

3.centos7配置在线yum仓库yum源和EPEL源

http://rpm.pbone.net/

http://rpmfind.net/

rpm-Uvhhttps://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm

  1. 挂载完镜像后进入与/etc/yum.repos.d下创建一个文件夹把文件备份后

cd /etc/yum.r*

mkdir a/

mv C* a/

2.下载新的CentOS-Base.repo 到/etc/yum.repos.d/或下载后将文件传输到虚拟机的/etc/yum.repos.dxia下

wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo

3、之后运行yum -y clean all 清除缓存,运行 yum makecache 生成新的缓存

[root@bogon yum.repos.d]# yum -y clean all

[root@bogon yum.repos.d]# yum makecache

安装EPEL源

[root@bogon yum.repos.d]# yum list | grep epel-release

epel-release.noarch 7-9 extras
[root@bogon yum.repos.d]# yum install -y epel-release
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: mirrors.aliyun.com
* extras: mirrors.aliyun.com
* updates: mirrors.aliyun.com
Resolving Dependencies
--> Running transaction check
---> Package epel-release.noarch 0:7-9 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

==================================================================================================================================
Package Arch Version Repository Size
==================================================================================================================================
Installing:
epel-release noarch 7-9 extras 14 k

Transaction Summary
==================================================================================================================================
Install 1 Package

Total download size: 14 k
Installed size: 24 k
Downloading packages:
epel-release-7-9.noarch.rpm | 14 kB 00:00:00
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : epel-release-7-9.noarch 1/1
Verifying : epel-release-7-9.noarch 1/1

Installed:
epel-release.noarch 0:7-9

Complete!
[root@bogon yum.repos.d]# ls

#多了epel.repo和epel-testing.repo
CentOS-Base.repo epel.repo epel-testing.repo repo_bak

运行yum clean all 清除缓存,运行 yum makecache 生成新的缓存

[root@bogon yum.repos.d]# yum repolist enabled #查看启用的仓库
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: mirrors.aliyun.com
* epel: mirrors.ustc.edu.cn
* extras: mirrors.aliyun.com
* updates: mirrors.aliyun.com
repo id repo name status
base/7/x86_64 CentOS-7 - Base - mirrors.aliyun.com 9,591
epel/x86_64 Extra Packages for Enterprise Linux 7 - x86_64 12,277
extras/7/x86_64 CentOS-7 - Extras - mirrors.aliyun.com 388
updates/7/x86_64 CentOS-7 - Updates - mirrors.aliyun.com 1,929
repolist: 24,185
[root@bogon yum.repos.d]# yum repolist all #查看所有的仓库
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: mirrors.aliyun.com
* epel: mirrors.ustc.edu.cn
* extras: mirrors.aliyun.com
* updates: mirrors.aliyun.com
repo id repo name status
base/7/x86_64 CentOS-7 - Base - mirrors.aliyun.com enabled: 9,591
centosplus/7/x86_64 CentOS-7 - Plus - mirrors.aliyun.com disabled
contrib/7/x86_64 CentOS-7 - Contrib - mirrors.aliyun.com disabled
epel/x86_64 Extra Packages for Enterprise Linux 7 - x86_64 enabled: 12,277
epel-debuginfo/x86_64 Extra Packages for Enterprise Linux 7 - x86_64 - Debug disabled
epel-source/x86_64 Extra Packages for Enterprise Linux 7 - x86_64 - Source disabled
epel-testing/x86_64 Extra Packages for Enterprise Linux 7 - Testing - x86_64 disabled
epel-testing-debuginfo/x86_64 Extra Packages for Enterprise Linux 7 - Testing - x86_64 - Debug disabled
epel-testing-source/x86_64 Extra Packages for Enterprise Linux 7 - Testing - x86_64 - Source disabled
extras/7/x86_64 CentOS-7 - Extras - mirrors.aliyun.com enabled: 388
updates/7/x86_64 CentOS-7 - Updates - mirrors.aliyun.com enabled: 1,929
repolist: 24,185

Linux网络服务第四章部署yum仓库的更多相关文章

  1. Linux网络服务第六章PXE高效能批量网络装机

    1.IP地址配置 2.关闭防火墙以及selinux状态如下 systemctl  stop     firewalld Iptables -F Setenforce 0 三.部署FTP服务 1.安装F ...

  2. Linux网络服务第七章DNS域名解析服务

    端口:53 一.DNS服务器 正向解析:根据域名查IP地址,即将指定的域名解析为相对应的IP地址.域名的正向解析是DNS服务器最基本的功能,也是最常用的功能. 反向解析:根据IP地址查域名,即将指定的 ...

  3. Linux网络服务第五章NFS共享服务

    1.笔记 NFS一般用在局域网中,网络文件系统c/s格式 服务端s:设置一个共享目录 客户端c:挂载使用这个共享目录 rpc:111远程过程调用机制 Showmount -e:查看共享目录信息 def ...

  4. Linux网络服务第三章远程访问及控制

    1.笔记 655355:端口限制 监听地址:对外提供服务的地址 AllowUsers:仅允许用户登录 DenyUsers:仅禁止用户登录 AllowUsers-用户名-公网地址 ssh/id_rsa. ...

  5. 第五章、Linux网络服务之yum仓库

    目录 一.yum仓库简介 二.yum配置文件 1yum主配置文件 2日志文件 三.yum命令详解 1查询软件包命令 2查询软件包组命令 3yum安装升级 4 软件卸载 四.搭建yum仓库 本地仓库 h ...

  6. (四)跟我一起玩Linux网络服务:DHCP服务配置之中继代理

    继第三部分的DHCP服务器的设置成功,我们来做一个中继代理服务器的配置吧. 我们的虚拟机结构如图: 具体参考: (一)跟我一起玩Linux网络服务:DNS服务——BIND(/etc/named.con ...

  7. Linux网络服务01——Linux网络基础设置

    Linux网络服务01--Linux网络基础设置 一.查看及测试网络 1.使用ifconfig命令查看网络接口 (1)查看活动的网络接口 ifconfig命令 [root@crushlinux ~]# ...

  8. Linux网络服务10——远程访问及控制

    Linux网络服务10--远程访问及控制 一.SSH概述 1.SSH简介 SSH(Secure Shell)是一种安全通道协议,主要用来实现字符界面的远程登录.远程复制等功能.SSH协议对通信双方的数 ...

  9. 部署yum仓库以及NFS共享服务

    目录: 一.YUM概述 二.准备安装源 三.访问YUM仓库 四.本地YUM仓库 五.YUM工具概述 六.软件包查询.安装.卸载 七.NFS共享 一.YUM概述 YUM(Yellow dog Updat ...

随机推荐

  1. 1+X Web前端开发(初级)理论考试样题(附答案)

    传送门 教育部:职业教育将启动"1+X"证书制度改革 职业教育改革1+X证书制度试点启动 1+X成绩/证书查询入口 一.单选题(每题 2 分,共 60 分) 1.在 HTML 中, ...

  2. java 第六周上机练习 04.09

    1.编写一个简单程序,要求数组长度为5,静态赋值10,20,30,40,50,在控制台输出该数组的值. int [] arr= {10,20,30,40,50}; for(int i=0;i<a ...

  3. 解决POST乱码

    在web.xml中添加字符过滤器 问题即可解决 <!--如何整合过滤器处理中文乱码问题?--> <filter> <filter-name>EncodingFilt ...

  4. JDBC下Date类型转换问题

    一.前言 在学过MVC后,其中的DAO层是负责与数据库进行进行数据交互,而service层个servlet层需要数据时,不允许直接向数据库要,而是通过Dao层来获取相关数据.这个时候,就引出一个规定& ...

  5. 《SEMI-SUPERVISED CLASSIFICATION WITH GRAPH CONVOLUTIONAL NETWORKS》论文阅读

    背景简介 GCN的提出是为了处理非结构化数据(相对于image像素点而言).CNN处理规则矩形的网格像素点已经十分成熟,其最大的特点就是利用卷积进行①参数共享②局部连接,如下图: 那么类比到非结构数据 ...

  6. 记录一次简单的springboot发送邮件功能

    场景:经常在我们系统中有通过邮件功能找回密码,或者发送生日祝福等功能,今天记录下springboot发送邮件的简单功能 1.引入maven <!-- 邮件开发--><dependen ...

  7. VLAN、Trunk,以太通道及DHCP

    VLAN.Trunk,以太通道及DHCP 案例1:Vlan的划分 案例2:配置trunk中继链路 案例3:以太通道配置 案例4:DHCP服务配置 1 案例1:Vlan的划分 1.1 问题 VLAN(虚 ...

  8. 21 static 静态的使用及特点

    /* * static:他是一个关键字,用来修饰成员变量和成员方法 * static特点: * 被所有的对象所共享 * 可以直接使用类名来调用 * 静态所修饰的成员加载优先于对象,随着类的加载而加载 ...

  9. 文件密码忘记了怎么办,教你如何使用Python破解密码

    前言 文的文字及图片来源于网络,仅供学习.交流使用,不具有任何商业用途,版权归原作者所有,如有问题请及时联系我们以作处理. 作者:轻松学编程小梁 PS:如有需要Python学习资料的小伙伴可以加点击下 ...

  10. 抠脚大叔如何改变性别,Python实现变声器功能

    前言 本文的文字及图片来源于网络,仅供学习.交流使用,不具有任何商业用途,版权归原作者所有,如有问题请及时联系我们以作处理. 作者: 乔柯 PS:如有需要Python学习资料的小伙伴可以加点击下方链接 ...