ITPub博客

首页 > Linux操作系统 > Linux操作系统 > linux 学习笔记 2:yum本地源环境配置

linux 学习笔记 2:yum本地源环境配置

原创 Linux操作系统 作者:yadangsmith 时间:2011-01-01 00:13:44 0 删除 编辑

1.编辑配置文件

[root@smith rht5_0530]# vi /etc/yum
yum/         yum.conf     yum.repos.d/
[root@smith rht5_0530]# cd /etc/yum.repos.d/
[root@smith yum.repos.d]# ls
dag.repo.bak  rhel-debuginfo.repo  rhel-debuginfo.repo.bak
[root@smith yum.repos.d]# vi rhel-debuginfo.repo

[disk]
name=Red Hat Enterprise Linux
baseurl=file:///home/rht5_0530/Server
enabled=1
gpgcheck=1
gpgkey=file:///home/rht5_0530/RPM-GPG-KEY-redhat-release

2.复制/mnt/cdrom源文件到/home/rht5_0530/Server下

3.[root@smith Server]# rm -rvf repodata   ----删除源库元文件

  [root@smith Server]# createrepo  /home/rht5_0530/Server   ---重新重建库元文件,路径不能弄错

4.[root@smith yum.repos.d]# yum list gcc*
Loading "installonlyn" plugin
Loading "rhnplugin" plugin
This system is not registered with RHN.
RHN support will be disabled.
Setting up repositories
Reading repository metadata in from local files
Installed Packages
gcc.i386                                 4.1.1-52.el5           installed      
gcc-c++.i386                             4.1.1-52.el5           installed      
gcc-gfortran.i386                        4.1.1-52.el5           installed      
gcc-gnat.i386                            4.1.1-52.el5           installed      
gcc-java.i386                            4.1.1-52.el5           installed      
gcc-objc.i386                            4.1.1-52.el5           installed      
gcc-objc++.i386                          4.1.1-52.el5           installed      

如果出现media:类似的错误,是由于缓存引起,执行下面命令即可修正。

  [root@smith Server]# yum clean all

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/22804047/viewspace-683103/ ,如需转载,请注明出处,否则将追究法律责任。

上一篇: git安装
请登录后发表评论 登录
全部评论

注册时间:2009-11-01

  • 博文量
    12
  • 访问量
    14260