首页 > 系统相关 >自建yum仓库,分别为网络源和本地源

自建yum仓库,分别为网络源和本地源

时间:2023-10-07 14:14:16浏览次数:42  
标签:centos 自建 mirrors 仓库 com basearch releasever yum os

网络yum源配置文件:


[14:42:19 root@centos8 cd]#cat /etc/yum.repos.d/base.repo
[BaseOS]
name=BaseOS
baseurl=https://mirrors.aliyun.com/centos/$releasever/BaseOS/$basearch/os/
      https://mirrors.huaweicloud.com/centos/$releasever/BaseOS/$basearch/os/
      https://mirrors.cloud.tencent.com/centos/$releasever/BaseOS/$basearch/os/
      https://mirrors.tuna.tsinghua.edu.cn/centos/$releasever/BaseOS/$basearch/os/
      http://mirrors.163.com//centos/$releasever/BaseOS/$basearch/os/
      http://mirrors.sohu.com/centos/$releasever/BaseOS/$basearch/os/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial

[AppStream]
name=AppStream
baseurl=https://mirrors.aliyun.com/centos/$releasever/AppStream/$basearch/os/
      https://mirrors.huaweicloud.com/centos/$releasever/AppStream/$basearch/os/
      https://mirrors.cloud.tencent.com/centos/$releasever/AppStream/$basearch/os/
      https://mirrors.tuna.tsinghua.edu.cn/centos/$releasever/AppStream/$basearch/os/
      http://mirrors.163.com/centos/$releasever/AppStream/$basearch/os/
      http://mirrors.sohu.com/centos/$releasever/AppStream/$basearch/os/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial

[EPEL]
name=EPEL
baseurl=https://mirrors.aliyun.com/epel/$releasever/Everything/$basearch/
      https://mirrors.huaweicloud.com/epel/$releasever/Everything/$basearch/
      https://mirrors.cloud.tencent.com/epel/$releasever/Everything/$basearch/
      https://mirrors.tuna.tsinghua.edu.cn/epel/$releasever/Everything/$basearch/
gpgcheck=1
gpgkey=https://mirrors.aliyun.com/epel/RPM-GPG-KEY-EPEL-$releasever

[extras]
name=extras
baseurl=https://mirrors.aliyun.com/centos/$releasever/extras/$basearch/os/
      https://mirrors.huaweicloud.com/centos/$releasever/extras/$basearch/os/
      https://mirrors.cloud.tencent.com/centos/$releasever/extras/$basearch/os/
      https://mirrors.tuna.tsinghua.edu.cn/centos/$releasever/extras/$basearch/os/
      http://mirrors.163.com/centos/$releasever/extras/$basearch/os/
      http://mirrors.sohu.com/centos/$releasever/extras/$basearch/os/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
enabled=1

[centosplus]
name=centosplus
baseurl=https://mirrors.aliyun.com/centos/$releasever/centosplus/$basearch/os/
      https://mirrors.huaweicloud.com/centos/$releasever/centosplus/$basearch/os/
      https://mirrors.cloud.tencent.com/centos/$releasever/centosplus/$basearch/os/
      https://mirrors.tuna.tsinghua.edu.cn/centos/$releasever/centosplus/$basearch/os/
      http://mirrors.163.com/centos/$releasever/centosplus/$basearch/os/
      http://mirrors.sohu.com/centos/$releasever/centosplus/$basearch/os/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial

本地yum源:


1. 首先插入光盘镜像
2. 可以手动挂载或者使用yum install -y autofs来自动挂载光盘
3. 编写配置文件,放在/etc/yum.repos.d目录下,以.repo后缀结尾即可
以安装autofs自动挂载为例。
[14:54:38 root@centos8 ~]#yum install -y autofs
[14:55:38 root@centos8 ~]#systemctl enabled --now autofs
[14:56:19 root@centos8 ~]#ls /misc/cd/AppStream/
Packages repodata
[14:57:03 root@centos8 ~]#cat /etc/yum.repos.d/CentOS-Linux-AppStream.repo
[cd.app]
name=cd.app
baseurl=file:///misc/cd/AppStream
#autofs自动挂载镜像到/misc/cd目录,指向/misc/cd/AppStream,可以看到repodata目录
gpgcheck=0
enabled=1
[14:59:45 root@centos8 ~]##cat /etc/yum.repos.d/CentOS-Linux-BaseOS.repo
[cd.baseos]
name=cd.baseos
baseurl=file:///misc/cd/BaseOS
gpgcheck=0
enable=1

标签:centos,自建,mirrors,仓库,com,basearch,releasever,yum,os
From: https://www.cnblogs.com/tanll/p/17746134.html

相关文章

  • 怎么更改git仓库地址
    1.显示当前Git仓库的远程仓库地址gitremote-V2.更改Git仓库的远程仓库地址gitremoteset-urlorigin[new-remote-url]3. 验证是否更改成功,显示Git仓库的远程仓库地址gitremote-v4.将更改后的代码提交到新的远程仓库地址gitpushoriginmaster参考:https......
  • 如何将Git仓库还原到之前的提交?
    内容来自DOChttps://q.houxu6.top/?s=如何将Git仓库还原到之前的提交?如何将当前状态还原到某个提交的快照?如果我执行gitlog,则我会得到以下输出:$gitlogcommita867b4af366350be2e7c21b8de9cc6504678a61b`Author:Me<[email protected]>Date:ThuNov418:59:412010-0400......
  • Maven05-maven仓库和nexus
    坐标和依赖是任何一个构件在Maven世界中的逻辑表示方式。而构件的物理表示方式是文件,Maven通过仓库来统一管理这些文件。1##......
  • 本地仓库通过git上传到gitee远程仓库
    1.本地新建vue3项目(vue-cli)2.gitee上新建远程仓库2.1.只选master一个分支2.2.新建的gitee远程仓库生成两个文件远程:2.3.把远程仓库的这两个文件下载并复制到本地项目文件中本地:tips:此时,gitee远程仓库里的文件被手动同步到了本地仓库项目文件夹中3.用命令行把本地仓......
  • 4.Maven配置本地仓库,阿里云远程仓库
    1.配置本地仓库Editmaven安装目录下->conf->settings文件配置<localRepository>D:\myinstall\apache-maven-3.9.4\repository</localRepository>  改地址为本地工作目录 2.配置aliyun中央仓库配置阿里云中央仓库的好处是下载jar包非常快(不配置默认在国外maven中央仓库下......
  • git远程空仓库创建以及本地项目关联远程仓库
    远程服务器上创建空仓库远程服务器:进入git仓库目录:cd/home/gitmkdirjava-test.gitcdjava-test.gitgitinit--barechown-Rgit:gitjava-test.git本地项目:cd 项目目录gitinitgitcheckout-b develop在项目里面,添加readme.md写一点内容gitadd.gitcommit......
  • 基于三菱Q系列cc-Link的立体仓库控制系统
    系统说明:    方案选择:  工艺流程:  触摸屏设计: 程序设计:采用SFC进行编程,结构清晰,逻辑明了   本文章为原创作品,转载请注明出处,否则将会追究法律责任。 ......
  • centos, 欧拉系统,yum保存rpm包
    两种方法:第一种:  用参数  如保存telnet的包yuminstall--downloadonly--downloaddir=/home/localrpm telnet  第二种:编辑/etc/yum.conf 文件文件里有一个keepcache 参数,改成1就代表保存了,cachedir 是指定存放的目录的,如果欧拉系统的文件里没有这个参......
  • MySQL安装--yum(CentOS7 + MySQL 5.7.35)
    Linux系统-部署-运维系列导航 MySQL常用安装方式有3种:rpm安装、yum安装、二进制文件安装。本文介绍yum安装方式。 组件安装操作步骤参考 组件安装部署手册模板,根据不同组件的安装目标,部分操作可以省略。本文将按照该参考步骤执行。 一、获取组件可执行程序库,包括主程......
  • RFID用于仓库盘点,省时省力
    RFID用于仓库盘点,省时省力RFID技术已经被广泛应用在工业制造和日常生活当中。它使用射频信号来识别和跟踪标签中的信息。RFID系统由两个主要组件组成:RFID标签和RFID读写器。RFID标签通常由一个芯片和一个天线组成。标签内的芯片存储着特定的数据,比如产品的序列号或其他识别信息。标......