linux配置centos的yum源本地仓库搭建

1.放置iso文件,并挂载iso文件,永久挂载,修改/etc/fstab
参考:https://blog.csdn.net/qq_36119192/article/details/82222175#%E4%B8%80%EF%BC%9A%E9%85%8D%E7%BD%AE%E6%9C%AC%E5%9C%B0yum%E6%BA%90
或者搜索:Linux配置yum源(本地源和网络源) - 谢公子的博客

2.到该目录/etc/yum.repos.d删除所有文件rm -rf *,并创建base.repo

[bash]
name=my new repo
baseurl=file:///Archive/RedHat-Enterprise-Linux/7.4
enabled=1
gpgcheck=0   

解读如下

[name]               #括号中的名称为仓库源名称,要对应上,通常为字母和数字,必须填写
name=my new repo     #对yum的描述,可写可不写
baseurl=file:///mnt/cdrom    #baseurl表示声明yum可以管理并使用的rpm包路径,必须填写
enabled=1            #enabled表示当前仓库是否开启,1为开启,0为关闭,此项不写默认为开启
gpgcheck=0           #gpgcheck表示安装rpm包时,是否基于公私钥对匹配包的安全信息,1表示开启,
                     #0表示关闭,此项不写默认为验证

下面每一步都要做
3.清空

[[email protected] yum.repos.d]# yum clean all
Loaded plugins: product-id, search-disabled-repos, subscription-manager
This system is not registered with an entitlement server. You can use subscription-manager to register.
Cleaning repos: base
Cleaning up everything
Maybe you want: rm -rf /var/cache/yum, to also free up space taken by orphaned data from disabled or removed repos

4.查看一下repolist

[[email protected] yum.repos.d]# yum repolist
Loaded plugins: product-id, search-disabled-repos, subscription-manager
This system is not registered with an entitlement server. You can use subscription-manager to register.
base                                            | 4.1 kB     00:00
(1/2): base/group_gz                              | 137 kB   00:00
(2/2): base/primary_db                            | 4.0 MB   00:00
repo id                           repo name                      status
base                              Base                           4,986
repolist: 4,986

5.yum包存储到本地

[[email protected] yum.repos.d]# yum makecache
Loaded plugins: product-id, search-disabled-repos, subscription-manager
This system is not registered with an entitlement server. You can use subscription-manager to register.
base                                            | 4.1 kB     00:00
Metadata Cache Created

6.列出yum包

[[email protected] yum.repos.d]# yum list |wc -l
5096

原文地址:https://blog.51cto.com/weiruoyu/2453166

时间: 2024-08-26 04:57:07

linux配置centos的yum源本地仓库搭建的相关文章

Red Hat Enterprise Linux 6配置CentOS的yum源

前言: 由于使用redhat官方yum源需要注册购买server服务,否则就会提示注册,或者根本找不到rehat的源.但是CentOS是redhat的免费版,除了log和一些无关紧要的东西,其他都是一样的.甚至kernel源代码都是一样的.所以我们可以使用CentOS的yum源代替redhat的yum源. <<<<< <<<<<<<本文笔者亲测成功>>>>>>>>>>>

Redhalt配置Centos的yum源 详细步骤

  大家都应该都清楚,redhalt 刚装完系统之后的yum是不好使的,有时我们像安装vsftp 这样的软件时用yum安装很方便.为此我们需要利用centos的yum源进行配置.现在这个源更新速度很快. 这是网易的资源总库http://mirror.centos.org/.里面应有尽有.废话不多说: 具体安装步骤: 1.删除redhat原有的yum源 # rpm -aq | grep yum|xargs rpm -e –nodeps 2.重新从网上获取yum的安装包  以root登陆到redha

redhat配置centos网络yum源

方案一: 配置网络yum源rpm -ivh vsftpd-2.2.2-6.el6_0.1.x86_64service vsftpd restartchkconfig --level 35 vsftpd oncd /var/ftp/pub/mkdir yum把上面的挂载点改成/var/ftp/pub/yumvim /etc/yum.repos.d/rhel-source.repo[server]name=serverbaserul=ftp://pub/yum/Server/  #(注意要挂载光驱)

redhat配置centos的yum源

redhat默认不支持第三方的yum源,要求有rhn账号,下面就rhel5和rhel6改为centos源 一.rhel5.5 X86_64更改为centos的yum源 查看系统自带的yum相关的rpm包  rpm -qa|grep yum 删掉系统自带的yum相关的包 rpm -e --nodeps yum-updatesd-0 rpm -e --nodeps yum-security   rpm -e --nodeps yum-metadata-p rpm -e --nodeps yum-rh

redhat 系统和centos系统配置yum 源的几种方法

          红帽或centos系统配置yum源 本地配置yum 源:光驱仓库,ISO仓库(一般适用于红帽linux,(因为它没有配不然怎么收钱)或者没有联网的centos系统, (都是配好的网源,只要可以联网就可以进行yum操作)) 文档带图片链接    http://pan.baidu.com/s/1c2G6Xyg    (https://yunpan.cn/Oc6mzj4mLwgDzC  访问密码 d35c ) 一.虚拟机中有光驱(虚拟机中光盘的位置)挂载的情况: (1)找到光驱的位

CentOS更新yum源的方法

一.下载国内比较稳定的yum源,我这里下载163的源 同时我使用的是CentOS6.2的x86_64版本,所以下载的是CentOS6-Base-163.repo 请根据,如下方法确认自己系统的版本 [[email protected] ~]# lsb_release -a LSB Version: :core-4.0-amd64:core-4.0-noarch:graphics-4.0-amd64:graphics-4.0-noarch:printing-4.0-amd64:printing-4

RHEL6.5系统更换Centos系统YUM源

##引言##:由于RHEL的yum在线更新是收费的,如果没有注册的话是不能使用的,即不能在线安装软件.那么要想用yum在线安装软件我们可以使用centos的yum源,具体办法见下面内容. 一.删除RHEL原有的yum [[email protected] ~]# rpm -aq|grep yum|xargs rpm -e --nodeps    ##删除 二.下载centos的yum安装包 [[email protected] ~]# wget http://vault.centos.org/6

CentOS使用yum源中自带的rpm包安装LAMP环境

CentOS使用yum源中自带的rpm包安装LAMP环境.这是Linux下安装LAMP的环境一种最基本最简便的方式.新手可以从容安装使用. 1. 安装基础包(可选安装)yum install -y wget zip unzip gzipyum install -y python ruby perlyum install -y gc gcc gcc-c++ 2. 安装php及其相关组件yum install -y php php-gdyum install -y php-mbstring php-

Red Hat 5.6配置Cent OS yum源

先进入yum源配置目录cd /etc/yum.repos.d 163的yum源:wget http://mirrors.163.com/.help/CentOS5-Base-163.repo下载到本地把"$releasever",替换成"5" RedHat5.6使用CentOS yum源更新的方法 ----------------------------------------------------------------------------- 由于RedHa