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 protected] ~]#mkdir -p /soft/redhat

[[email protected] /]# cp -rp /mnt/cdrom/ /soft/redhat/

[[email protected] /]# cd /soft/redhat

[[email protected] redhat]# ls

cdrom

3、安装createrepo包

[[email protected] cdrom]# cd /soft/redhat/cdrom/Server/

[[email protected] Server]# ls -l |grep createrepo

-r--r--r-- 1 root root    60901 Apr 21  2008 createrepo-0.4.11-3.el5.noarch.rpm

[[email protected] Server]# rpm -ivh createrepo-0.4.11-3.el5.noarch.rpm

4、在/etc/yum.repos.d目录下创建server.repo文件

[[email protected] Server]# cd /etc/yum.repos.d/

[[email protected] yum.repos.d]# pwd

/etc/yum.repos.d

[[email protected] yum.repos.d]# vi server.repo


[Server]

name=Server

baseurl=file:///soft/redhat/cdrom/Server

enabled=1

gpgcheck=0

[Cluster]

name=Cluster

baseurl=file:///soft/redhat/cdrom/Cluster

enabled=1

gpgcheck=0

[ClusterStorage]

name=ClusterStorage

baseurl=file:///soft/redhat/cdrom/ClusterStorage

enabled=1

gpgcheck=0

[VT]

name=VT

baseurl=file:///var/redhat/cdrom/VT

enabled=1

gpgcheck=0

5、使用createrepo创建yum库

[[email protected] yum.repos.d]# cd /soft/redhat/cdrom/Server/

[[email protected] Server]# createrepo /soft/redhat/cdrom

3389/3389 - ClusterStorage/gfs-utils-0.1.20-10.el5.x86_64.rpm                   pm_64.rpm

Saving Primary metadata

Saving file lists metadata

Saving other metadata

6、安装测试

[[email protected] /]# rpm -qa |grep sysstat

[[email protected] /]#

[[email protected] /]# yum -y install sysstat


Loaded plugins: product-id, security, subscription-manager

Updating Red Hat repositories.

Cluster                                                                                       | 1.5 kB     00:00

Cluster/primary                                                                               | 6.5 kB     00:00

Cluster                                                                                                        32/32

ClusterStorage                                                                                | 1.5 kB     00:00

ClusterStorage/primary                                                                        | 8.7 kB     00:00

ClusterStorage                                                                                                 39/39

Server                                                                                        | 1.5 kB     00:00

Server/primary                                                                                | 913 kB     00:00

Server                                                                                                     3261/3261

VT                                                                                            | 1.3 kB     00:00

VT/primary                                                                                    |  18 kB     00:00

VT                                                                                                             57/57

Setting up Install Process

Resolving Dependencies

--> Running transaction check

---> Package sysstat.x86_64 0:7.0.2-11.el5 set to be updated

--> Finished Dependency Resolution

Dependencies Resolved

=====================================================================================================================

Package                   Arch                     Version                           Repository                Size

=====================================================================================================================

Installing:

sysstat                   x86_64                   7.0.2-11.el5                      Server                   187 k

Transaction Summary

=====================================================================================================================

Install       1 Package(s)

Upgrade       0 Package(s)

Total download size: 187 k

Downloading Packages:

Running rpm_check_debug

Running Transaction Test

Finished Transaction Test

Transaction Test Succeeded

Running Transaction

Installing: sysstat                                                                                       1/1

Cluster/productid                                                                             | 1.7 kB     00:00

ClusterStorage/productid                                                                      | 1.8 kB     00:00

Server/productid                                                                              | 1.7 kB     00:00

duration: 661(ms)

Installed products updated.

Installed:

sysstat.x86_64 0:7.0.2-11.el5

Complete!

[[email protected] /]# rpm -qa |grep sysstat

sysstat-7.0.2-11.el5

测试成功。

7、删除yum源

[[email protected] Server]# yum clean all

Loaded plugins: product-id, security, subscription-manager

Updating Red Hat repositories.

Cleaning up Everything

本文作者:黎俊杰(网名:踩点),从事”系统架构、操作系统、存储设备、数据库、中间件、应用程序“六个层面系统性的性能优化工作

欢迎加入 系统性能优化专业群,共同探讨性能优化技术。群号:258187244

redhat linux 5上创建本地yum源,布布扣,bubuko.com

时间: 2024-12-23 10:43:16

redhat linux 5上创建本地yum源的相关文章

在linux上搭建本地yum源

准备yum仓库的光盘镜像IOS文件: 设置光驱加载本地磁盘的yum仓库的光盘镜像文件: 在linux的命令行输入setup命令打开设置窗口,选择"System Service": 在打开的系统服务列表中找到httpd服务,确保它处于选中状态: 然后重启机器,使httpd服务启动生效,待虚拟机启动后,在浏览器中访问此机器的主机名,比如我的这台机器的主机名为hadoop01,那么就在浏览器中访问http://hadoop01/,如果出现如下界面,说明httpd服务成功启动: 然后使用SSH

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/

linux 下载rpm包到本地,createrepo:创建本地YUM源

如何下载rpm包到本地 设置yum安装时,保留rpm包. 1.编辑 /etc/yum.conf 将keepcache的值设置为1; 这样就可以将yum安装时的rpm包保存在 /var/cache/yum下面 2.或者使用yum-plugin-downloadonly插件, sudo yum install yum-plugin-downloadonly 用法:sudo yum install ceph-0.87.1-0.el7.centos.x86_64.rpm --downloadonly -

LINUX创建本地yum源

1.创建一个文件夹,把光盘中所有的RPM安装包都拷贝进来 # mkdir /rpms_yum 2.把光盘上的RPM包全部复制到rpms_yum中 # cd /mnt/cdrom/Packages/ # cp * /rpms_yum/ 3.安装createrepo软件,以便使用该软件制作YUM索引数据库 # cd /rpms_yum/ # rpm -ivh createrepo-0.9.9-17.el6.noarch.rpm 4.使用createrepo在RPM包的路径下创建YUM索引数据库 #

linux上samba+本地yum源最简单的配置

本地yum源配置: 1.以挂载光盘的形式配置yum源 mkdir /mnt/cdrom mount /dev/cdrom /mnt/cdrom 配置yum配置文件 vim /etc/yum.repos.d/rhel-debuginfo.repo [rhel-debuginfo] name=Red Hat Enterprise Linux $releasever - $basearch - Debug baseurl=file:///mnt/cdrom/Server enabled=1 gpgch

redhat7.2创建本地yum源

1.系统说明 Red Hat Enterprise Linux Server release 7.2 (Maipo) 2.操作方法 1)将服务器光驱中镜像挂在到服务器,并拷贝到服务器硬盘目录/var/mirror 判断光驱是否使用 [[email protected] yum.repos.d]# ls -l /dev/cdrom lrwxrwxrwx 1 root root 3 Sep 27  2016 /dev/cdrom -> sr0 将光驱挂在到/mnt下 [[email protecte

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

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

Redhat 6.9下搭建本地yum源

前段时间因项目和学习需要,要在本地安装Oracle数据库,用来学习和验证有关Oracle数据库的问题,于是就在本地的VMware虚拟机上搭建了Linux操作系统,用来安装Oracle11g数据库. 在安装一些包时,按照以前学习的知识无法安装和搭建yum源,发现网上的教程貌似有些出入,这里把自己的一些方法写出,希望能有所帮助. 1.先挂载光盘: 2.创建挂载路径并挂载[[email protected] ~]# mkdir -p /mnt/cdrom/[[email protected] ~]#

Linux虚拟机配至本地yum源

刚开始使用Linux,自己构建了一个Linux虚拟机之后,在使用yum install的时候,经常是出错,提示连接不上. 一直以为是自己构建的虚拟机的问题,后来在网上查找了一些资料,才发现:需要配置本地yum源. 下面是网上的重复不断的博客,我这里也为了备忘将内容引用一下. ----------------- 虚拟机中的linux有时不能连接上外网,为了能够方便的安装各种packages,于是调查配置本地yum安装的方法. 首先,将作为源的iso的挂载到系统上. 代码如下: mount -o l