Welcome 微信登录

首页 / 操作系统 / Linux / CentOS 6.4配置本地源yum

在当我们安装CentOS 6.4而又不能联网时,那么我们的yum命令是用不了的,这是我们可以配置本地源使用yum命令  1.配置repo文件,
 cd /etc/yum.repos.d
 备份好原有的配置文件
 mv CentOS-Base.repo CentOS-Base.repo.bak
 mv  CentOS-Debuginfo.repo  CentOS-Debuginfo.repo.bak
 mv  CentOS-Vault.repo CentOS-Vault.repo.bak
 mv  CentOS-Media.repo CentOS-Media.repo.bak 创建新的配置文件 vim CentOS-Debuginfo.repo[debug]
name=centos
baseurl=file:///mnt
enabled=1
gpgcheck=0
gpgkey=file:///mnt/RPM-GPG-KEY-RedHat-release
 
  :wq 保存  2.配置yumRepo.py文件,
 
 cd /usr/lib/python2.6/site-packages/yum
 vim yumRepo.py  将 remote = url + ‘/’ + relative 
  改为 remote = "/mnt" + "/" + relative  :wq 保存修改  3 配置iso挂载文件  mount /dev/cdrom /mnt
  4 验证测试(使用vsftpd)
  rpm -qa |grep vsftpd
  yum list |grep vsftpd[root@hsj2 yum]# yum list |grep vsftpd
vsftpd.i686                              2.2.2-11.el6_3.1                  @debug  yum install  vsftpd.i686 [root@hsj2 yum]# yum install vsftpd.i686
Loaded plugins: fastestmirror, refresh-packagekit, security
Loading mirror speeds from cached hostfile
Setting up Install Process
Resolving Dependencies
There are unfinished transactions remaining. You might consider running yum-complete-transaction first to finish them.
--> Running transaction check
---> Package vsftpd.i686 0:2.2.2-11.el6_3.1 will be installed
--> Finished Dependency ResolutionDependencies Resolved=================================================================================================================
 Package               Arch                  Version                              Repository              Size
=================================================================================================================
Installing:
 vsftpd                  i686                  2.2.2-11.el6_3.1                   debug                  157 kTransaction Summary
=================================================================================================================
Install     1 Package(s)Total download size: 157 k
Installed size: 344 k
Is this ok [y/N]: y
Downloading Packages:
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Warning: RPMDB altered outside of yum.
** Found 2 pre-existing rpmdb problem(s), "yum check" output follows:
glibc-2.12-1.107.el6_4.4.i686 is a duplicate with glibc-2.12-1.107.el6.i686
glibc-common-2.12-1.107.el6_4.4.i686 is a duplicate with glibc-common-2.12-1.107.el6.i686
  Installing : vsftpd-2.2.2-11.el6_3.1.i686                                                                  1/1
  Verifying  : vsftpd-2.2.2-11.el6_3.1.i686                                                                  1/1Installed:
  vsftpd.i686 0:2.2.2-11.el6_3.1Complete!验证ok,成功相关阅读:yum的配置文件说明 http://www.linuxidc.com/Linux/2013-04/83298.htmRedHat 6.1下安装yum(图文) http://www.linuxidc.com/Linux/2013-06/86535.htmYUM 安装及清理 http://www.linuxidc.com/Linux/2013-07/87163.htm更多CentOS相关信息见CentOS 专题页面 http://www.linuxidc.com/topicnews.aspx?tid=14Nautilus-Open-Terminal : 可随处打开终端的 Nautilus 插件RHEL6.4 配置本地yum的源相关资讯      yum  CentOS 6.4 yum  CentOS配置本地 
  • yum安装与卸载软件常见命令  (05月24日)
  • 升级Python导致yum报错  (12/21/2015 15:14:23)
  • RHEL7.0配置CD-ROM为本地YUM  (12/10/2015 09:24:47)
  • CentOS 6.5下YUM仓库的部署  (03月11日)
  • 从CentOS安装R中看yum、rpm、repo  (12/18/2015 14:48:10)
  • Linux Study之--CentOS 创建本地  (12/03/2015 19:47:40)
本文评论 查看全部评论 (0)
表情: 姓名: 字数