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仓库既可以备份也可以与他人协作管理远程仓库以及根据需要推送或拉取 ...
随机推荐
- 在ASP.NET Core中使用ViewComponent
前言 在之前的开发过程中,我们对于应用或者说使用一些小的组件,通常使用分布页(partial view),再往前在Web Form中我们会进行应用WEB Control,好吧提及一个关键性代码TagP ...
- 面试官:Java中线程是按什么顺序执行的?
摘要:Java中多线程并发的执行顺序历来是面试中的重点,掌握Java中线程的执行顺序不仅能够在面试中让你脱颖而出,更能够让你在平时的工作中,迅速定位由于多线程并发问题导致的"诡异" ...
- Spring (二)SpringIoC和DI注解开发
1.Spring配置数据源 1.1 数据源(连接池)的作用 数据源(连接池)是提高程序性能出现的 事先实例化数据源,初始化部分连接资源 使用连接资源时从数据源中获取 使用完毕后将连接资源归还给数据源 ...
- ArrayList、CopyOnWriteArrayList源码解析(JDK1.8)
本篇文章主要是学习后的知识记录,存在不足,或许不够深入,还请谅解. 目录 ArrayList源码解析 ArrayList中的变量 ArrayList构造函数 ArrayList中的add方法 Arra ...
- JAVAEE_Servlet_14_HttpServletRequest接口以及常用方法(一)
HttpServletRequest接口 * javax.servlet.http.HttpServletRequest 接口 * 继承关系 HttpServletRequest---继承---> ...
- Vue3发布半年我不学,摸鱼爽歪歪,哎~就是玩儿
是从 Vue 2 开始学基础还是直接学 Vue 3 ?尤雨溪给出的答案是:"直接学 Vue 3 就行了,基础概念是一模一样的." 以上内容源引自最新一期的<程序员>期刊 ...
- k8s新手必看
转载自https://juejin.im/post/6844903840139968520 Kubernetes零基础快速入门!初学者必看! 起源 Kubernetes 源自于 google 内部的服 ...
- Pandas的loc,iloc与ix的用法及区别
1.先来谈一谈loc,loc这个方法就是你有啥我就用啥,你没有的我不用,pandas对象的index,columns有什么,pd.loc[index,column],index就是pd.index的其 ...
- tp5 composer phpexcel使用方法
1.compser 安装phpexcel.在windows命令行下输入:进入网站根目录,compser phpoffice/phpexcel 2.页面引入两个类: use PHPExcel_IOFac ...
- hdu5105给你一个方程,让你求极值(直接暴力)
题意: 给你一个方程f[x] = abss(a * x * x * x + b * x * x + c * x + d); 然后给你各个参数还有x(-100<x<100)的取值 ...