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仓库既可以备份也可以与他人协作管理远程仓库以及根据需要推送或拉取 ...
随机推荐
- Redis解读(2):Redis的Java客户端
Redis的Java客户端 Redis不仅使用命令客户端来操作,而且可以使用程序客户端操作,其实配置和实现起来也非常容易. 现在基本上主流的语言都有客户端支持,比如Java.C.C#.C++.php. ...
- Day14_77_反射( newInstance() 方法)
newInstance() 方法 * 通过反射获取class类型的对象之后,可以通过该对象创建所对应的class类型的对象 * newInstance() 用来创建Class获取的类所表示的一个新实例 ...
- WordPress 函数do_action()详解和应用举例
do_action()函数: 我们经常能看到在一些WordPress函数中调用了do_action()函数,例如get_header(), get_footer()等调用模板的函数中经常调用do_ ...
- IDAPython类库---idaapi.py的源码
#ThisfilewasautomaticallygeneratedbySWIG(http://www.swig.org).#Version2.0.12##Donotmakechangestothis ...
- 19.Vuex详细使用说明-一篇文章涵盖所有知识点
vuex官网: https://vuex.vuejs.org/zh/ 一. 前言 不管是Vue,还是 React,都需要管理状态(state),比如组件之间都有共享状态的需要. 什么是共享状态? 比如 ...
- <JVM下篇:性能监控与调优篇>03-JVM监控及诊断工具-GUI篇
笔记来源:尚硅谷JVM全套教程,百万播放,全网巅峰(宋红康详解java虚拟机) 同步更新:https://gitee.com/vectorx/NOTE_JVM https://codechina.cs ...
- [花式栈溢出]栈上的 partial overwrite
[花式栈溢出]栈上的 partial overwrite 希望能在这几天对Pwn中的栈上的各种利用和其他一些较小的分支做一个收尾,以便全力投入学习堆的相关知识.初步计划是对照ctf-wiki查缺补漏. ...
- 【python】Leetcode每日一题-最大数
[python]Leetcode每日一题-最大数 [题目描述] 给定一组非负整数 nums,重新排列每个数的顺序(每个数不可拆分)使之组成一个最大的整数. 注意:输出结果可能非常大,所以你需要返回一个 ...
- composer update -- memory_limit
compsoer update取消memory_limit限制.取消扩展对于版本的限制 php -d memory_limit=-1 ./composer.phar update --ignore-p ...
- PHP解压压缩包文件到指定目录的实现
$src_file为文件路径,上传文件返回压缩包路径即可 public function unzip($src_file, $dest_dir=false, $create_zip_name_dir= ...