Linux_yum仓库管理
一、yum配置本地仓库
1、挂载光盘
[root@localhost ~]# mount /dev/sr0 /mnt/
[root@localhost ~]# df -hT
文件系统 类型 容量 已用 可用 已用% 挂载点
devtmpfs devtmpfs 966M 0 966M 0% /dev
tmpfs tmpfs 983M 0 983M 0% /dev/shm
tmpfs tmpfs 983M 8.7M 974M 1% /run
tmpfs tmpfs 983M 0 983M 0% /sys/fs/cgroup
/dev/mapper/rhel-root xfs 50G 2.0G 49G 4% /
/dev/mapper/rhel-home xfs 67G 511M 67G 1% /home
/dev/nvme0n1p1 xfs 1014M 156M 859M 16% /boot
tmpfs tmpfs 197M 0 197M 0% /run/user/0
/dev/sr0 iso9660 7.4G 7.4G 0 100% /mnt
2、配置repo文件
[root@localhost ~]# cd /etc/yum.repos.d/
[root@localhost yum.repos.d]# touch dvd.repo
[root@localhost yum.repos.d]# ls
dvd.repo redhat.repo
[root@localhost yum.repos.d]# vim dvd.repo
[BaseOS]
name=baseos
baseurl=file:///mnt/BaseOS
gpgcheck=0
enabled=1 [AppStream]
name=appstream
baseurl=file:///mnt/AppStream
gpgcheck=0
enabled=1
3、清理本地缓存
[root@localhost yum.repos.d]# yum clean all
Updating Subscription Management repositories.
Unable to read consumer identity
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
12 文件已删除
4、建立元数据
[root@localhost yum.repos.d]# yum makecache
Updating Subscription Management repositories.
Unable to read consumer identity
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
baseos 11 MB/s | 2.2 MB 00:00
appstream 30 MB/s | 5.6 MB 00:00
上次元数据过期检查:0:00:01 前,执行于 2020年08月13日 星期四 15时05分23秒。
元数据缓存已建立。
5、检测本地yum仓库
[root@localhost yum.repos.d]# yum repolist all
Updating Subscription Management repositories.
Unable to read consumer identity
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
上次元数据过期检查:0:00:51 前,执行于 2020年08月13日 星期四 15时05分23秒。
仓库标识 仓库名称 状态
AppStream appstream 启用: 4,820
BaseOS baseos 启用: 1,661
6、列出本地yum仓库所有的软件包
[root@localhost yum.repos.d]# yum list all
Updating Subscription Management repositories.
Unable to read consumer identity
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
上次元数据过期检查:0:03:52 前,执行于 2020年08月13日 星期四 15时05分23秒。
已安装的软件包
NetworkManager.x86_64 1:1.20.0-3.el8 @anaconda
NetworkManager-libnm.x86_64 1:1.20.0-3.el8 @anaconda
NetworkManager-team.x86_64 1:1.20.0-3.el8 @anaconda
NetworkManager-tui.x86_64 1:1.20.0-3.el8 @anaconda
PackageKit.x86_64 1.1.12-3.el8 @AppStream
PackageKit-glib.x86_64 1.1.12-3.el8 @AppStream
abattis-cantarell-fonts.noarch 0.0.25-4.el8 @AppStream
acl.x86_64 2.2.53-1.el8 @anaconda
adcli.x86_64 0.8.2-3.el8 @anaconda
..................
二、yum配置网络仓库
1、网络仓库源
- 阿里云yum仓库
- 163yum仓库
- epel源
- xx大学yum仓库
- 官方网络yum仓库(国外)
2、下载阿里云yum仓库
阿里云镜像官网:https://developer.aliyun.com/mirror
[root@localhost ~]# wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo
--2020-08-13 15:16:56-- https://mirrors.aliyun.com/repo/Centos-7.repo
正在解析主机 mirrors.aliyun.com (mirrors.aliyun.com)... 153.99.248.248, 218.98.31.240, 218.98.31.244, ...
正在连接 mirrors.aliyun.com (mirrors.aliyun.com)|153.99.248.248|:443... 已连接。
已发出 HTTP 请求,正在等待回应... 200 OK
长度:2523 (2.5K) [application/octet-stream]
正在保存至: “/etc/yum.repos.d/CentOS-Base.repo” /etc/yum.repos.d/CentOS-Base.repo 100%[====================================================================================================>] 2.46K --.-KB/s 用时 0s 2020-08-13 15:16:57 (20.1 MB/s) - 已保存 “/etc/yum.repos.d/CentOS-Base.repo” [2523/2523])
[root@localhost ~]# ls /etc/yum.repos.d/
CentOS-Base.repo dvd.repo redhat.repo
3、安装阿里云epel源
[root@localhost ~]# wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo
--2020-08-13 15:20:46-- http://mirrors.aliyun.com/repo/epel-7.repo
正在解析主机 mirrors.aliyun.com (mirrors.aliyun.com)... 218.98.31.243, 218.98.31.241, 153.99.248.248, ...
正在连接 mirrors.aliyun.com (mirrors.aliyun.com)|218.98.31.243|:80... 已连接。
已发出 HTTP 请求,正在等待回应... 200 OK
长度:664 [application/octet-stream]
正在保存至: “/etc/yum.repos.d/epel.repo” /etc/yum.repos.d/epel.repo 100%[====================================================================================================>] 664 --.-KB/s 用时 0s 2020-08-13 15:20:46 (46.2 MB/s) - 已保存 “/etc/yum.repos.d/epel.repo” [664/664])
[root@localhost ~]# ls /etc/yum.repos.d/
CentOS-Base.repo dvd.repo epel.repo redhat.repo
4、安装软件官方仓库
//示例安装一个nginx官方的仓库
[root@localhost yum.repos.d]# touch nginx.repo
[root@localhost yum.repos.d]# ls
dvd.repo nginx.repo redhat.repo
//首先创建一个rngin.epo文件
[root@localhost yum.repos.d]# vim nginx.repo
[nginx]
name=nginx repo
baseurl=http://nginx.org/Packahges/centos/7/$basearch
gpgcheck=0
enable=1
//配置nginx网络源仓库完成,接着清理缓存,建立元数据,查看nginx仓库是否启用
[root@localhost yum.repos.d]# yum clean all
Updating Subscription Management repositories.
Unable to read consumer identity
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
12 文件已删除 [root@localhost yum.repos.d]# yum clean all
Updating Subscription Management repositories.
Unable to read consumer identity
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
12 文件已删除
[root@localhost yum.repos.d]# yum makecache
Updating Subscription Management repositories.
Unable to read consumer identity
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
baseos 101 MB/s | 2.2 MB 00:00
appstream 120 MB/s | 5.6 MB 00:00
nginx repo 52 kB/s | 73 kB 00:01
元数据缓存已建立。 [root@localhost yum.repos.d]# yum repolist all
Updating Subscription Management repositories.
Unable to read consumer identity
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
上次元数据过期检查:0:00:18 前,执行于 2020年08月13日 星期四 15时27分51秒。
仓库标识 仓库名称 状态
AppStream appstream 启用: 4,820
BaseOS baseos 启用: 1,661
nginx nginx repo 启用: 162
5、下载安装base和epel仓库
[root@localhost ~]# cd /etc/yum.repos.d/
[root@localhost yum.repos.d]# ls
dvd.repo redhat.repo
[root@localhost yum.repos.d]# wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo
--2020-08-13 15:38:07-- https://mirrors.aliyun.com/repo/Centos-7.repo
正在解析主机 mirrors.aliyun.com (mirrors.aliyun.com)... 218.98.31.240, 221.6.157.215, 218.98.31.241, ...
正在连接 mirrors.aliyun.com (mirrors.aliyun.com)|218.98.31.240|:443... 已连接。
已发出 HTTP 请求,正在等待回应... 200 OK
长度:2523 (2.5K) [application/octet-stream]
正在保存至: “/etc/yum.repos.d/CentOS-Base.repo” /etc/yum.repos.d/CentOS-Base.repo 100%[====================================================================================================>] 2.46K --.-KB/s 用时 0s 2020-08-13 15:38:07 (39.6 MB/s) - 已保存 “/etc/yum.repos.d/CentOS-Base.repo” [2523/2523])
[root@localhost ~]# sed -i 's#\$releasever#7#g' /etc/yum.repos.d/CentOS-Base.repo [root@localhost yum.repos.d]# wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo
--2020-08-13 15:38:33-- http://mirrors.aliyun.com/repo/epel-7.repo
正在解析主机 mirrors.aliyun.com (mirrors.aliyun.com)... 221.6.157.214, 218.98.31.249, 218.98.31.244, ...
正在连接 mirrors.aliyun.com (mirrors.aliyun.com)|221.6.157.214|:80... 已连接。
已发出 HTTP 请求,正在等待回应... 200 OK
长度:664 [application/octet-stream]
正在保存至: “/etc/yum.repos.d/epel.repo” /etc/yum.repos.d/epel.repo 100%[====================================================================================================>] 664 --.-KB/s 用时 0s 2020-08-13 15:38:33 (58.1 MB/s) - 已保存 “/etc/yum.repos.d/epel.repo” [664/664]) [root@localhost yum.repos.d]# ls
CentOS-Base.repo dvd.repo epel.repo redhat.repo
Linux_yum仓库管理的更多相关文章
- Dynamics AX 2012 R3 仓库和运输管理系列 - 仓库管理模块安装与配置
在AX 2012 R3版本中,新增了仓库和运输管理模块,同时提供了一个在移动设备上进行仓库管理工作的网站.在这个系列里,与Reinhard一起,了解仓库和运输管理模块吧. 需要注意的是 ...
- Maven仓库管理-Nexus
Maven仓库管理-Nexus @import url(http://www.blogjava.net/CuteSoft_Client/CuteEditor/Load.ashx?type=style& ...
- PDA手持终端在ERP系统仓库管理出入库盘点环节的应用
PDA手持终端在ERP系统仓库管理出入库盘点环节的应用 传统库存管理的数据录入过程,常采用PC机录入数据,或在电脑上结合条码枪扫描条码进行管理(非实时),造成管理上的不便.因而,采用无线(WIFI)手 ...
- 使用仓库管理器——Sonatype Nexus的九大理由
目前有很多组织使用了一些工具依赖于Maven仓库,但他们并没有采用一个仓库管理器,对于这一点我十分惊讶.可能没人提出来这一点,没人站出来告诉别人使用一个仓库管理器能带来什么好处.我经常能从很多不使用M ...
- 4.Maven概念模型,maven的生命周期,Maven坐标,依赖管理(依赖范围,依赖声明),仓库管理,私服概念
1 maven概念模型 2 maven的生命周期,项目构建过程 watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvdG90b3R1enVvcXVhbg== ...
- 前端项目模块化的实践1:搭建 NPM 私有仓库管理源码及依赖
以下是关于前端项目模块化的实践,包含以下内容: 搭建 NPM 私有仓库管理源码及依赖: 使用 Webpack 打包基础设施代码: 使用 TypeScript 编写可靠类库 使用 TypeScript ...
- 【Docker】第四篇 Docker仓库管理
一.仓库概述 仓库(Repository):Docker仓库主要用于镜像的存储,它是镜像分发.部署的关键.仓库分为公共仓库和私有仓库. 注册服务器(Registry)和仓库区别:注册服务器上往往存放着 ...
- git多仓库管理
使用git建立多仓库管理 以下操作为命令行下操作 一:先创建服务器端口,总仓库和子仓库: ssh git@192.168.1.110 连接git服务器 输入密码 mkdir iOSPro ...
- Git系列四之在本地服务器搭建gitlab仓库管理
1.Git仓库管理 现在本地已经创建了git仓库,又在gitlab上创建了一个git仓库,并且让这两个仓库进行远程同步,这样gitlab仓库既可以备份也可以与他人协作管理远程仓库以及根据需要推送或拉取 ...
随机推荐
- 关于ArrayList 中子方法 -- contains 疑惑解决
写之前先看下 ArrayList 子函数 contains 的Api 怎么介绍: boolean contains(Object o) 如果此列表中包含指定的元素,则返回 true ...
- 用递归求出n的全排列
1 include<cstdio> 2 const int maxn = 11; 3 int n,p[maxn], hashTable[maxn] = { false };//hashta ...
- Floyd算法C++实现与模板题应用
简介 Floyd算法算是最简单的算法,没有之一. 其状态转移方程如下map[i , j] =min{ map[i , k] + map[k , j] , map[i , j] }: map[i , j ...
- Updating a Dictionary UVA - 12504
In this problem, a dictionary is collection of key-value pairs, where keys are lower-case letters, a ...
- 数据结构之队列(JavaScript描述)
队列数据结构 队列遵循先进先出原则的一组有序的项.对可在尾部添加新元素并从顶部移除元素.最新添加的元素必须排在队列的末尾 队列类似栈的例子 创建队列 创建一个类表示队列 队列内应该有一些方法 添加 ...
- js时间对象Date()
Date ()是一个专门用来创建时间对象的,是一个复杂数据类型,具有读写属性 语法: var time = new Date() 返回值:当前终端的时间 // 1.创建当前时间对象 var time ...
- 基于MATLAB的手写公式识别(9)
基于MATLAB的手写公式识别(9) 1.2图像的二值化 close all; clear all; Img=imread('drink.jpg'); %灰度化 Img_Gray=rgb2gray(I ...
- hdu4499 搜索
题意: 给你一个棋盘,最大是5*5的,问你最多可以放多少个炮,炮和炮之间不可以相互攻击,这块只的是只能走一步,不存在两个炮中间三个棋子的情况.. 思路: 刚开始想的是把所有的空位置都 ...
- POJ1201基础差分约束
题意: 有一条直线,直线上做多有50000个点,然后给你组关系 a b c表明a-b之间最少有c个点,问直线上最少多少个点. 思路: a-b最少有c个点可以想象a到b+1的距 ...
- Mybatis-Plus02 CRUD
先将快速开始01看完,再看这个文档 配置日志 我们所有的sql现在都是不可见的,我们希望知道它是怎么执行的,所以我们就必须看日志,开发的时候打开,上线的时候关闭 在application.proper ...