Linux Study之--CentOS 创建本地yum库

Linux Study之--CentOS 创建本地yum库

系统环境:

     操作系统:CentOS 65(64)


一、挂载系统光盘

[[email protected] yum.repos.d]# mount /dev/cdrom /media

[[email protected] yum.repos.d]# ls /media/

EFI               images                    RELEASE-NOTES-hi-IN.html  RELEASE-NOTES-te-IN.html
EULA              isolinux                  RELEASE-NOTES-it-IT.html  RELEASE-NOTES-zh-CN.html
EULA_de           LoadBalancer              RELEASE-NOTES-ja-JP.html  RELEASE-NOTES-zh-TW.html
EULA_en           media.repo                RELEASE-NOTES-kn-IN.html  repodata
EULA_es           Packages                  RELEASE-NOTES-ko-KR.html  ResilientStorage
EULA_fr           README                    RELEASE-NOTES-ml-IN.html  RPM-GPG-KEY-redhat-beta
EULA_it           RELEASE-NOTES-as-IN.html  RELEASE-NOTES-mr-IN.html  RPM-GPG-KEY-redhat-release
EULA_ja           RELEASE-NOTES-bn-IN.html  RELEASE-NOTES-or-IN.html  ScalableFileSystem
EULA_ko           RELEASE-NOTES-de-DE.html  RELEASE-NOTES-pa-IN.html  Server
EULA_pt           RELEASE-NOTES-en-US.html  RELEASE-NOTES-pt-BR.html  TRANS.TBL
EULA_zh           RELEASE-NOTES-es-ES.html  RELEASE-NOTES-ru-RU.html
GPL               RELEASE-NOTES-fr-FR.html  RELEASE-NOTES-si-LK.html
HighAvailability  RELEASE-NOTES-gu-IN.html  RELEASE-NOTES-ta-IN.html

二、查看yum库配置文件
[[email protected] yum.repos.d]# ls -l
total 20
-rw-r--r--. 1 root root 1926 Dec  3 11:57 CentOS-Base.repo
-rw-r--r--. 1 root root  638 Nov 27  2013 CentOS-Debuginfo.repo
-rw-r--r--. 1 root root  629 Dec  3 12:01 CentOS-Media.repo
-rw-r--r--. 1 root root  630 Dec  3 12:04 CentOS-Media.repo.bak
-rw-r--r--. 1 root root 3664 Nov 27  2013 CentOS-Vault.repo

如果只使用本地yum库,可只需要CentOS-Media.repo配置文件:
[[email protected] yum.repos.d]# ls -l
total 20
-rw-r--r--. 1 root root 1926 Dec  3 11:57 CentOS-Base.repo.bak
-rw-r--r--. 1 root root  638 Nov 27  2013 CentOS-Debuginfo.repo.bak
-rw-r--r--. 1 root root  629 Dec  3 12:19 CentOS-Media.repo
-rw-r--r--. 1 root root  630 Dec  3 12:04 CentOS-Media.repo.bak
-rw-r--r--. 1 root root 3664 Nov 27  2013 CentOS-Vault.repo.bak

编辑yum配置文件:
[[email protected] yum.repos.d]# vi CentOS-Media.repo

# CentOS-Media.repo
#
#  This repo can be used with mounted DVD media, verify the mount point for
#  CentOS-6.  You can use this repo and yum to install items directly off the
#  DVD ISO that we release.
#
# To use this repo, put in your DVD and use it with the other repos too:
#  yum --enablerepo=c6-media [command]
#
# or for ONLY the media repo, do this:
#
#  yum --disablerepo=\* --enablerepo=c6-media [command]
[c6-media]
name=CentOS-$releasever - Media
baseurl=file:///media/Server
        file:///media/cdrom/
        file:///media/cdrecorder/
gpgcheck=0
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6

~
三、通过yum安装软件
[[email protected] yum.repos.d]# yum install -y perl-IO-Socket-SSL* --enablerepo=c6-media

Loaded plugins: fastestmirror, refresh-packagekit, security
Loading mirror speeds from cached hostfile
 * c6-media: 
base                                                                                | 3.9 kB     00:00 ... 
base/primary_db                                                                     | 3.1 MB     00:00 ... 
c6-media                                                                            | 3.9 kB     00:00 ... 
c6-media/primary_db                                                                 | 3.1 MB     00:00 ... 
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package perl-IO-Socket-SSL.noarch 0:1.31-2.el6 will be installed
--> Processing Dependency: perl(Net::SSLeay) >= 1.21 for package: perl-IO-Socket-SSL-1.31-2.el6.noarch
--> Processing Dependency: perl(Net::LibIDN) for package: perl-IO-Socket-SSL-1.31-2.el6.noarch
--> Running transaction check
---> Package perl-Net-LibIDN.x86_64 0:0.12-3.el6 will be installed
---> Package perl-Net-SSLeay.x86_64 0:1.35-9.el6 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
===========================================================================================================
 Package                          Arch                 Version                    Repository          Size
===========================================================================================================
Installing:
 perl-IO-Socket-SSL               noarch               1.31-2.el6                 base                69 k
Installing for dependencies:
 perl-Net-LibIDN                  x86_64               0.12-3.el6                 base                35 k
 perl-Net-SSLeay                  x86_64               1.35-9.el6                 base               173 k
Transaction Summary
===========================================================================================================
Install       3 Package(s)
Total download size: 276 k
Installed size: 807 k
Downloading Packages:
-----------------------------------------------------------------------------------------------------------
Total                                                                      2.6 MB/s | 276 kB     00:00     
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Warning: RPMDB altered outside of yum.
  Installing : perl-Net-LibIDN-0.12-3.el6.x86_64                                                       1/3 
  Installing : perl-Net-SSLeay-1.35-9.el6.x86_64                                                       2/3 
  Installing : perl-IO-Socket-SSL-1.31-2.el6.noarch                                                    3/3 
  Verifying  : perl-Net-SSLeay-1.35-9.el6.x86_64                                                       1/3 
  Verifying  : perl-Net-LibIDN-0.12-3.el6.x86_64                                                       2/3 
  Verifying  : perl-IO-Socket-SSL-1.31-2.el6.noarch                                                    3/3 
Installed:
  perl-IO-Socket-SSL.noarch 0:1.31-2.el6                                                                   
Dependency Installed:
  perl-Net-LibIDN.x86_64 0:0.12-3.el6                  perl-Net-SSLeay.x86_64 0:1.35-9.el6                 
Complete!

[[email protected] yum.repos.d]# yum install -y perl-TermReadKey*  --enablerepo=c6-media

Loaded plugins: fastestmirror, refresh-packagekit, security
Loading mirror speeds from cached hostfile
 * c6-media: 
c6-media                                                                            | 3.9 kB     00:00 ... 
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package perl-TermReadKey.x86_64 0:2.30-13.el6 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
===========================================================================================================
 Package                       Arch                Version                     Repository             Size
===========================================================================================================
Installing:
 perl-TermReadKey              x86_64              2.30-13.el6                 c6-media               31 k
Transaction Summary
===========================================================================================================
Install       1 Package(s)
Total download size: 31 k
Installed size: 62 k
Downloading Packages:
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Warning: RPMDB altered outside of yum.
  Installing : perl-TermReadKey-2.30-13.el6.x86_64                                                     1/1 
  Verifying  : perl-TermReadKey-2.30-13.el6.x86_64                                                     1/1 
Installed:
  perl-TermReadKey.x86_64 0:2.30-13.el6                                                                    
Complete!

[[email protected] mysql]# rpm -ivh percona-toolkit-2.2.10-1.noarch.rpm
warning: percona-toolkit-2.2.10-1.noarch.rpm: Header V4 DSA/SHA1 Signature, key ID cd2efd2a: NOKEY
Preparing...                ########################################### [100%]
   1:percona-toolkit        ########################################### [100%]

时间: 2024-10-10 22:38:33

Linux Study之--CentOS 创建本地yum库的相关文章

为RedHat创建本地yum库

RedHat安装完成后默认是无法直接安装rpm包的,需要自己修改yum库配置文件.本文记录我配置本地yum库的过程. step1:在home目录下创建目录repo,挂载安装镜像文件 mount /dev/cdrom /mnt/repo step2:复制镜像文件到磁盘 cp -rf /mnt/repo /home step3:备份原始yum库配置文件 cp /etc/yum.repos.d/rhel-source.repo /etc/yum.repos.d/rhel-source.repo .ba

centos 创建本地yum源搭建本地yum仓库 亲测可用

现在如果我们需要大规模部署洗个系统,或者系统需要安装一个什么软件如nginx之类的软件.有的时候你的环境限制你上外网,或者是外网很慢的时候.我们考虑搭建本地yum仓库,内网机器可以直接快速安装所需的软件,解决linux下面的包的依赖,方便,快捷. 下面我们来搭建一下根底yum仓库: 系统:centos6.5 搭建yum仓库有很多种方法,我们这里使用yum插件yum-downloadonly插件来下载我们所需的rpm包.使用createrepo来创建仓库文件. 开始: 我们需要安装zabbix监控

centos创建本地yum仓库

怎样发布自己软件的安装和更新YUM源 在创建之前,我们先了解些相关的内容: yum仓库可以支持三种途径提供给yum在安装的时候下载rpm包 第一种:  ftp服务  ftp:// 第二种:  http服务  http:// 第三种:  本地文件  file:// 我们暂且可以将yum的安装分为客户端和服务器端,当然你的客户端和服务器端可以是一台主机 1. 首先,假定我们应用的名字叫helloworld(可以参考简单 RPM 包制作来创建两个版本helloworld安装RPM包,helloworl

RedHat Enterprise版本搭建本地Yum库

RedHat  Enterprise版本目前广泛的应用在各种生产环境中.由于没有购买正式的授权,导致无法正常使用yum安装,或者由于网络限制也导致无法使用Yum安装.而手动安装rpm包又会引来很多依赖关系的问题.故有时我们需要创建本地yum库.本文介绍创建本地yum库的方法.测试环境: RedHat Enterprise 6.4和RedHat Enterprise 6.5 步骤如下:(1)将系统安装光盘挂载到系统中 mount /dev/cdrom /mnt/(2)cd /mnt/Package

[转载]CentOS 7 创建本地YUM源

本文中的“本地YUM源”包括三种类型:一是直接使用CentOS光盘作为本地yum源,优点是简单便捷,缺点是光盘软件包可能不完整(centos 7 Everything 总共才6.57G):二是同步CentOS官方源到本地(相当于创建了一个公共镜像),优点是最靠谱,缺点是占空间费流量:三是创建完全自定义的本地源,优点是灵活性最大,缺点是只是作为其他源的补充. 一.使用CentOS光盘作为本地yum源 (1) 实体机上直接放入光盘(2) VMware Workstation 虚拟机:虚拟机-->可移

redhat linux 5上创建本地yum源

1.挂载光驱 [[email protected] ~]#mkdir -p /mnt/cdrom [[email protected] ~]#mount /dev/cdrom /mnt/cdrom 2.将redhat光盘内容复制至本地硬盘 因为创建yum源的目录,必须是可以写入的的目录,所以需要将光盘中的文件全部复制到本地目录,如果在/mnt/cdrom光驱挂载目录执行创建yum源,会报"Directory /mnt/cdrom must be writable."错误 [[email

CentOS7.3 创建本地YUM源和局域网YUM源

由于某某公司针对安全这一块做的比较严谨,服务器全部都不可以连接外网.由于开发环境只有局域网,没法使用网上的各种YUM源,来回拷贝rpm包安装麻烦,还得解决依赖问题.想着在CentOS7.3搭建个本地/局域网YUM源,方便自己跟同事安装软件. 创建本地YUM源 环境: [[email protected] ~]# cat /etc/centos-release CentOS Linux release 7.3.1611 (Core) 并且是Minimal Install. 准备rpm包 : 挂载C

更换yum源、创建本地yum源

系统版本: [[email protected] ~]# cat /etc/redhat-release CentOS release 6.7 (Final) [[email protected] ~]# uname -r 2.6.32-573.el6.x86_64 [[email protected] ~]# cat /etc/redhat-release CentOS Linux release 7.1.1503 (Core) [[email protected] ~]# uname -r

centos7创建本地 yum源 epel源

centos7创建本地 yum源 epel源 1.安装httpd服务,提供网页浏览 yum-y install httpd systemctlstart httpd systemctlenable httpd 2.创建yum仓库目录和epel目录 mkdir/var/www/html/yum 3.安装创建仓库软件包:createrepo yum-y install createrepo 4.初始化仓库索引文件 createrepo-p -d -o /var/www/html/yum/ /var/