重庆思庄Oracle、Redhat认证学习论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 8810|回复: 11
打印 上一主题 下一主题

[分享]配置yum

[复制链接]
跳转到指定楼层
楼主
发表于 2013-5-6 20:02:56 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

创建一个挂载目录

#mkdir /mnt/iso

挂载光盘,df检查光盘挂载位置

[root@whj ~]# df

Filesystem           1K-blocks      Used Available Use% Mounted on

/dev/sda1             28439328  21995704   4975688  82% /

tmpfs                   513040         0    513040   0% /dev/shm

/dev/hdc               4028944   4028944         0 100% /media/RHEL_5.8 x86_64 DVD

当前光盘是挂到/media/RHEL_5.8 x86_64 DVD这个目录的,把光盘挂载到/mnt/iso这个目录上
#mount -o loop /dev/hdc /mnt/iso

到/etc/yum.repos.d/目录下
#cd /etc/yum.repos.d/

创建repo文件
#mkdir repo

把后缀是.repo的文件拷进repo文件夹里
# mv *.repo repo/

编辑/etc/yum.repos.d/iso.repo文件
#vi /etc/yum.repos.d/iso.repo

添加以下内容
[Server]
baseurl=file:///mnt/iso/Server
gpgcheck=1
enabled=1

导入GPG密钥
#rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-*

清除yum缓存
#yum clean all

测试能不能正常安装
#yum -y install gcc

[此贴子已经被作者于2015-07-22 20:17:46编辑过]
分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏 支持支持 反对反对
回复

使用道具 举报

沙发
发表于 2013-5-6 23:40:29 | 只看该作者
问一下,yum的软件来自哪里,光盘,还是网络?
回复 支持 反对

使用道具 举报

板凳
 楼主| 发表于 2013-5-7 09:20:35 | 只看该作者

光盘里的

回复 支持 反对

使用道具 举报

地板
发表于 2013-5-7 22:46:54 | 只看该作者

与直接安装rpm -ivh 包名字,有什么区别?

回复 支持 反对

使用道具 举报

5#
 楼主| 发表于 2013-5-9 20:56:49 | 只看该作者
加上了[em50]
回复 支持 反对

使用道具 举报

6#
发表于 2013-5-10 13:22:20 | 只看该作者

[root@dbserver tools]# yum -y install gcc

 

Loaded plugins: security
Repository 'Server' is missing name in configuration, using id
Setting up Install Process
Package gcc-4.1.2-48.el5.i386 already installed and latest version
Nothing to do

 

这个红色的部分,是什么意思,如何解决.

回复 支持 反对

使用道具 举报

7#
 楼主| 发表于 2013-5-9 17:29:46 | 只看该作者
yum可以解决依赖性问题
回复 支持 反对

使用道具 举报

8#
发表于 2013-5-9 17:32:09 | 只看该作者
要是对每一步骤是做什么的增加一个描述就好了。
回复 支持 反对

使用道具 举报

9#
发表于 2013-5-16 15:57:44 | 只看该作者
[root@localhost yum.repos.d]# yum clean all
Loaded plugins: product-id, security, subscription-manager
Updating Red Hat repositories.
Repository 'Server' is missing name in configuration, using id
Cleaning up Everything
[root@localhost yum.repos.d]# yum -y install gcc
Loaded plugins: product-id, security, subscription-manager
Updating Red Hat repositories.
Repository 'Server' is missing name in configuration, using id
file:///mnt/iso/Server/repodata/repomd.xml: [Errno 5] OSError: [Errno 2] No such file or directory: '/mnt/iso/Server/repodata/repomd.xml'
Trying other mirror.
Error: Cannot retrieve repository metadata (repomd.xml) for repository: Server. Please verify its path and try again

我这个错在哪里
回复 支持 反对

使用道具 举报

10#
发表于 2014-6-15 17:42:04 | 只看该作者
QUOTE:
以下是引用easonqian在2013-05-16 15:57:44的发言:
[root@localhost yum.repos.d]# yum clean all
Loaded plugins: product-id, security, subscription-manager
Updating Red Hat repositories.
Repository 'Server' is missing name in configuration, using id
Cleaning up Everything
[root@localhost yum.repos.d]# yum -y install gcc
Loaded plugins: product-id, security, subscription-manager
Updating Red Hat repositories.
Repository 'Server' is missing name in configuration, using id
file:///mnt/iso/Server/repodata/repomd.xml: [Errno 5] OSError: [Errno 2] No such file or directory: '/mnt/iso/Server/repodata/repomd.xml'
Trying other mirror.
Error: Cannot retrieve repository metadata (repomd.xml) for repository: Server. Please verify its path and try again

我这个错在哪里
 
你这个错误是: 你的安装盘的位置不对,
你找找你的repodata 目录在哪个位置,是否直接在光盘根目录,如果是,就应该为
#vi /etc/yum.repos.d/iso.repo

添加以下内容
[Server]
baseurl=file:///mnt/iso/Server

QUOTE:
 
QUOTE:
为:

[Server]
baseurl=file:///mnt/iso

这样,你再试一下。


 

回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|手机版|小黑屋|重庆思庄Oracle、Redhat认证学习论坛 ( 渝ICP备12004239号-4 )

GMT+8, 2024-5-4 14:05 , Processed in 0.093134 second(s), 20 queries .

重庆思庄学习中心论坛-重庆思庄科技有限公司论坛

© 2001-2020

快速回复 返回顶部 返回列表