zoukankan      html  css  js  c++  java
  • centos5.8本地安装yum资源,安装软件包

    首先

    [root@mode media]# cd /etc/yum.repos.d/
    [root@mode yum.repos.d]# ll
    total 16
    -rw-r--r-- 1 root root  560 Dec 19 01:20 CentOS-Media.repo
    drwxr-xr-x 2 root root 4096 Dec 18 20:03 bak
    drwxr-xr-x 2 root root 4096 Jan 28 19:17 ncurses-devel
    drwxr-xr-x 2 root root 4096 Mar 12 18:32 openssl-devel
    [root@mode yum.repos.d]# cat CentOS-Media.repo 
    # CentOS-Media.repo
    #
    # This repo is used to mount the default locations for a CDROM / DVD on
    #  CentOS-5.  You can use this repo and yum to install items directly off the
    #  DVD ISO that we release.
    #
    # To use this repo, put in your DVD and use it with the other repos too:
    #  yum --enablerepo=c5-media [command]
    #  
    # or for ONLY the media repo, do this:
    #
    #  yum --disablerepo=* --enablerepo=c5-media [command]
     
    [c5-media]
    name=CentOS-$releasever - Media
    baseurl=file:///mnt/cdrom/
    gpgcheck=1
    enabled=1
    gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5

    看到CentOS-Media.repo中的 baseurl=file:///mnt/cdrom/了吗

    假设指定了CentOS-meida源,系统会依据路径查找安装 所须要的包

    然后创建文件夹文件,将镜像挂载到那个文件夹中

    [root@mode yum.repos.d]# mkdir -p /mnt/cdrom
    [root@mode yum.repos.d]# mount -o loop /dev/cdrom /mnt/cdrom
    然后就能够安装须要安装的软件了:

    [root@mode yum.repos.d]# yum --disablerepo=* --enablerepo=c5-media install xinetd
    Loaded plugins: fastestmirror, security
    Loading mirror speeds from cached hostfile
    Setting up Install Process
    Resolving Dependencies
    --> Running transaction check
    ---> Package xinetd.x86_64 2:2.3.14-16.el5 set to be updated
    --> Finished Dependency Resolution
    
    Dependencies Resolved
    
    =======================================================================================================================================================================
     Package                              Arch                                 Version                                        Repository                              Size
    =======================================================================================================================================================================
    Installing:
     xinetd                               x86_64                               2:2.3.14-16.el5                                c5-media                               127 k
    
    Transaction Summary
    =======================================================================================================================================================================
    Install       1 Package(s)
    Upgrade       0 Package(s)
    
    Total download size: 127 k
    Is this ok [y/N]: y
    Downloading Packages:
    Running rpm_check_debug
    Running Transaction Test
    Finished Transaction Test
    Transaction Test Succeeded
    Running Transaction
      Installing     : xinetd                                                                                                                                          1/1 
    
    Installed:
      xinetd.x86_64 2:2.3.14-16.el5                                                                                                                                        
    
    Complete!
    [root@mode yum.repos.d]# 


    版权声明:本文博客原创文章,博客,未经同意,不得转载。

  • 相关阅读:
    .net com
    Json树递归Js查询Json父子节点
    Angular中使用$watch监听object属性值的变化
    教程
    JS格式化Thu May 12 2016 08:00:00 GMT+0800 (中国标准时间)
    js中获取时间new Date()详细介绍
    select默认空白问题。。
    angular先加载页面再执行事件,特别在动态生成id,然后做echarts等图表
    详解angularJs中自定义directive的数据交互
    Angularjs ng-table的使用(可以加button)以及angularjs学习资料
  • 原文地址:https://www.cnblogs.com/zfyouxi/p/4712595.html
Copyright © 2011-2022 走看看