redhat 的 yum 配置
2012-07-28 11:02
495 查看
yum分为服务器端和客户端
本例子为ftp服务器
yum安装软件只要提供想要安装的软件名,即可安装软件,排斥了rpm安装时的各种依赖关系(依赖起来可是很纠结了=。=)。
1、服务器端要安装createrepo-0.4.11-3.el5.noarch.rpm和yum-3.2.22-26.el5.noarch.rpm
[root@gg pub]# rpm -ivh createrepo-0.4.11-3.el5.noarch.rpm
[root@gg pub]# rpm -ivh yum-3.2.22-26.el5.noarch.rpm
2、挂载ISO光盘和复制所以的rpm包到/var/ftp/pub
[root@gg pub]# mount /dev/cdrom /media
[root@gg pub]# mkdir /var/ftp/pub/rpm
[root@gg pub]# cp -va /media/Server/* /var/ftp/pub/rpm/
3、重建索引
[root@gg pub]# createrepo -v /var/ftp/pub/rpm
4、yum配置文件路径 /etc/yum.repos.d/rhel-debuginfo.repo
新建出的yum配置文件必须以repo为后缀,并把原来的配置文件改名
[root@gg yum.repos.d]# cd
[root@gg ~]# cd /etc/yum.repos.d/
[root@gg yum.repos.d]# cp rhel-debuginfo.repo yum.repo
[root@gg yum.repos.d]# mv rhel-debuginfo.repo11 rhel-debuginfo.repo
[root@gg yum.repos.d]# vi yum.repo
我的yum.repo配置文件的内容
[rhel-debuginfo]
name=MyYum #名字
baseurl=ftp://192.168.0.99/pub/rpm #yum源的路径IP是我本机IP
enabled=1 #1为开启上面yum源
gpgcheck=0 #0为关闭GPG签名(用来验证要安装的包是不是REDHAT官方的)
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
#密钥位置,因为上面已经关闭了GPG签名验证所以没用.可以删除
5、关闭yum自动更新(开启的话很容易出错,或匹配不上)
[root@gg ~]# /etc/init.d/yum-updatesd stop
6、开启ftp服务
[root@gg ~]# service vsftpd start
7、开始用yum安装软件
[root@gg yum.repos.d]# yum -y install zsh*
Loading "rhnplugin" plugin
Loading "installonlyn" plugin
This system is not registered with RHN.
RHN support will be disabled.
Setting up Install Process
Setting up repositories
Reading repository metadata in from local files
Parsing package install arguments
Resolving Dependencies
--> Populating transaction set with selected packages. Please wait.
---> Downloading header for zsh-html to pack into transaction set.
zsh-html-4.2.6-3.el5.i386 100% |=========================| 15 kB 00:00
---> Package zsh-html.i386 0:4.2.6-3.el5 set to be updated
--> Running transaction check
Dependencies Resolved
=============================================================================
Package Arch Version Repository Size
=============================================================================
Installing:
zsh-html i386 4.2.6-3.el5 rhel-debuginfo 372 k
Transaction Summary
=============================================================================
Install 1 Package(s)
Update 0 Package(s)
Remove 0 Package(s)
Total download size: 372 k
Downloading Packages:
(1/1): zsh-html-4.2.6-3.e 100% |=========================| 372 kB 00:00
Running Transaction Test
warning: zsh-html-4.2.6-3.el5: Header V3 DSA signature: NOKEY, key ID 1e5e0159
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
Installing: zsh-html ######################### [1/1]
Installed: zsh-html.i386 0:4.2.6-3.el5
Complete!
补充:
yum常用命令
yum clean all
yum list
yum -y install 包名
yum remove 包名
本例子为ftp服务器
yum安装软件只要提供想要安装的软件名,即可安装软件,排斥了rpm安装时的各种依赖关系(依赖起来可是很纠结了=。=)。
1、服务器端要安装createrepo-0.4.11-3.el5.noarch.rpm和yum-3.2.22-26.el5.noarch.rpm
[root@gg pub]# rpm -ivh createrepo-0.4.11-3.el5.noarch.rpm
[root@gg pub]# rpm -ivh yum-3.2.22-26.el5.noarch.rpm
2、挂载ISO光盘和复制所以的rpm包到/var/ftp/pub
[root@gg pub]# mount /dev/cdrom /media
[root@gg pub]# mkdir /var/ftp/pub/rpm
[root@gg pub]# cp -va /media/Server/* /var/ftp/pub/rpm/
3、重建索引
[root@gg pub]# createrepo -v /var/ftp/pub/rpm
4、yum配置文件路径 /etc/yum.repos.d/rhel-debuginfo.repo
新建出的yum配置文件必须以repo为后缀,并把原来的配置文件改名
[root@gg yum.repos.d]# cd
[root@gg ~]# cd /etc/yum.repos.d/
[root@gg yum.repos.d]# cp rhel-debuginfo.repo yum.repo
[root@gg yum.repos.d]# mv rhel-debuginfo.repo11 rhel-debuginfo.repo
[root@gg yum.repos.d]# vi yum.repo
我的yum.repo配置文件的内容
[rhel-debuginfo]
name=MyYum #名字
baseurl=ftp://192.168.0.99/pub/rpm #yum源的路径IP是我本机IP
enabled=1 #1为开启上面yum源
gpgcheck=0 #0为关闭GPG签名(用来验证要安装的包是不是REDHAT官方的)
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
#密钥位置,因为上面已经关闭了GPG签名验证所以没用.可以删除
5、关闭yum自动更新(开启的话很容易出错,或匹配不上)
[root@gg ~]# /etc/init.d/yum-updatesd stop
6、开启ftp服务
[root@gg ~]# service vsftpd start
7、开始用yum安装软件
[root@gg yum.repos.d]# yum -y install zsh*
Loading "rhnplugin" plugin
Loading "installonlyn" plugin
This system is not registered with RHN.
RHN support will be disabled.
Setting up Install Process
Setting up repositories
Reading repository metadata in from local files
Parsing package install arguments
Resolving Dependencies
--> Populating transaction set with selected packages. Please wait.
---> Downloading header for zsh-html to pack into transaction set.
zsh-html-4.2.6-3.el5.i386 100% |=========================| 15 kB 00:00
---> Package zsh-html.i386 0:4.2.6-3.el5 set to be updated
--> Running transaction check
Dependencies Resolved
=============================================================================
Package Arch Version Repository Size
=============================================================================
Installing:
zsh-html i386 4.2.6-3.el5 rhel-debuginfo 372 k
Transaction Summary
=============================================================================
Install 1 Package(s)
Update 0 Package(s)
Remove 0 Package(s)
Total download size: 372 k
Downloading Packages:
(1/1): zsh-html-4.2.6-3.e 100% |=========================| 372 kB 00:00
Running Transaction Test
warning: zsh-html-4.2.6-3.el5: Header V3 DSA signature: NOKEY, key ID 1e5e0159
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
Installing: zsh-html ######################### [1/1]
Installed: zsh-html.i386 0:4.2.6-3.el5
Complete!
补充:
yum常用命令
yum clean all
yum list
yum -y install 包名
yum remove 包名
ok!yum的配置就到这里,我这只是很简单的步骤,能让yum运行起来。
具体的配置信息就找度娘去吧....
相关文章推荐
- redhat6.2相关配置(yum,,r,rstudio,ipythonnotebook)
- RedHat配置YUM 从centos5源与光盘源更新软件
- RedHat 5.5配置YUM 从centos5源与光盘源更新软件
- redhat5.9配置yum
- Redhat 配置网易yum
- redhat系统中yum仓库配置出现问题
- redhat 6 配置 yum 源的两种方法
- redhat 6 配置 yum 源的两种方法
- redhat 下安装配置 yum
- REDHAT 6.5 配置本地YUM 源
- RedHat LinuxEnterprise 5 yum 配置
- Linux - redhat6.4 配置centos6 yum替换
- RedHat安装yum+配置国内yum源
- RedHat Linux Enterprise 5 yum 配置
- RedHat5上配置YUM方法以及YUM的使用方法
- 【推荐】在RedHat Server 5.4上安装YUM【利用网易免费yum源,配置和更新yum】
- redhat 6 配置 yum 源的两种方法
- 五.为RedHat配置yum功能
- Redhat多版本通用的yum配置
- RedHat 6.3 配置163 yum 升级源