bobbai 发表于 2018-5-11 08:23:14

redhat实现光盘yum

  实验环境
  redhat 6.5-x64
  实验软件
  createrepo-0.9.9-18.el6.noarch.rpm
  python-deltarpm-3.5-0.5.20090913git.el6.x86_64.rpm
  deltarpm-3.5-0.5.20090913git.el6.x86_64.rpm
  vsftpd-2.2.2-11.el6_4.1.x86_64.rpm
  
  软件安装
  rpm -ivh createrepo-0.9.9-18.el6.noarch.rpm
  rpm -ivh python-deltarpm-3.5-0.5.20090913git.el6.x86_64.rpm
  rpm -ivh deltarpm-3.5-0.5.20090913git.el6.x86_64.rpm
  rpm -ivh vsftpd-2.2.2-11.el6_4.1.x86_64.rpm
  
  mount /dev/cdrom/mnt/挂载光盘镜像,也可以使用mount-o loop为镜像挂载
mkdir -p /var/ftp/pub
  cp-rv /mnt/Packages/* /var/ftp/pub/
  cp-rv /mnt/repodata/* /var/ftp/pub/
  

  cd /var/ftp/pub/repodata/
  cp -p 6221039e7e3dabf7d538c76571d82aaf42b6292b8f6fe6cf56b8fcf1cff3d3ab-comps-rhel6-Server.xml ~
  cd ..
  rm -rf repodata
  

  createrepo -g./6221039e7e3dabf7d538c76571d82aaf42b6292b8f6fe6cf56b8fcf1cff3d3ab-comps-rhel6-Server.xml .
  cd /etc/yum.repos.d/
  cp -p rhel-source.repo rhel.repo
  

  vim rhel.repo
  
  name=Red Hat Enterprise Linux $releasever -$basearch - Source
  baseurl=file:///var/ftp/pub
  enabled=1
  gpgcheck=0
  
  yum clean all清除yum头部数据
  Loaded plugins: product-id,refresh-packagekit, security, subscription-manager
  This system is not registered to Red HatSubscription Management. You can use subscription-manager to register.
  Cleaning repos: rhel
  Cleaning up Everything
  
  yum list 列出安装的文件
  yum makecache -y yum缓存到本地
# yum install -y httpd*
  Loaded plugins: product-id,refresh-packagekit, security, subscription-manager
  This system is not registered to Red HatSubscription Management. You can use subscription-manager to register.
  Setting up Install Process
  Resolving Dependencies
  --> Running transaction check
  ---> Package httpd.x86_640:2.2.15-29.el6_4 will be installed
  --> Processing Dependency: apr-util-ldapfor package: httpd-2.2.15-29.el6_4.x86_64
  --> Processing Dependency:libaprutil-1.so.0()(64bit) for package: httpd-2.2.15-29.el6_4.x86_64
  --> Processing Dependency:libapr-1.so.0()(64bit) for package: httpd-2.2.15-29.el6_4.x86_64
  ---> Package httpd-devel.x86_640:2.2.15-29.el6_4 will be installed
  --> Processing Dependency:apr-util-devel for package: httpd-devel-2.2.15-29.el6_4.x86_64
  --> Processing Dependency: apr-devel forpackage: httpd-devel-2.2.15-29.el6_4.x86_64
  ---> Package httpd-manual.noarch0:2.2.15-29.el6_4 will be installed
  ---> Package httpd-tools.x86_640:2.2.15-29.el6_4 will be installed
  --> Running transaction check
  ---> Package apr.x86_64 0:1.3.9-5.el6_2will be installed
  ---> Package apr-devel.x86_640:1.3.9-5.el6_2 will be installed
  ---> Package apr-util.x86_640:1.3.9-3.el6_0.1 will be installed
  ---> Package apr-util-devel.x86_640:1.3.9-3.el6_0.1 will be installed
  --> Processing Dependency:openldap-devel for package: apr-util-devel-1.3.9-3.el6_0.1.x86_64
  --> Processing Dependency: expat-develfor package: apr-util-devel-1.3.9-3.el6_0.1.x86_64
  ---> Package apr-util-ldap.x86_640:1.3.9-3.el6_0.1 will be installed
  --> Running transaction check
  ---> Package expat-devel.x86_640:2.0.1-11.el6_2 will be installed
  ---> Package openldap-devel.x86_640:2.4.23-32.el6_4.1 will be installed
  --> Processing Dependency:cyrus-sasl-devel >= 2.1 for package: openldap-devel-2.4.23-32.el6_4.1.x86_64
  --> Running transaction check
  ---> Package cyrus-sasl-devel.x86_640:2.1.23-13.el6_3.1 will be installed
  --> Finished Dependency Resolution
  Dependencies Resolved
  ===============================================================================================
  Package                  Arch             Version                      Repository      Size
  ===============================================================================================
  Installing:
  httpd                      x86_64         2.2.15-29.el6_4            rhel         821 k
  httpd-devel                x86_64         2.2.15-29.el6_4            rhel         150 k
  httpd-manual               noarch         2.2.15-29.el6_4            rhel         783 k
  httpd-tools                x86_64         2.2.15-29.el6_4            rhel            73 k
  Installing for dependencies:
  apr                        x86_64         1.3.9-5.el6_2                rhel         123 k
  apr-devel                  x86_64         1.3.9-5.el6_2                rhel         176 k
  apr-util                   x86_64         1.3.9-3.el6_0.1            rhel            87 k
  apr-util-devel             x86_64         1.3.9-3.el6_0.1            rhel            69 k
  apr-util-ldap            x86_64         1.3.9-3.el6_0.1            rhel            15 k
  cyrus-sasl-devel         x86_64         2.1.23-13.el6_3.1            rhel         302 k
  expat-devel                x86_64         2.0.1-11.el6_2               rhel         120 k
  openldap-devel             x86_64         2.4.23-32.el6_4.1            rhel         1.1 M
  Transaction Summary
  ===============================================================================================
  Install   12 Package(s)
  Total download size: 3.7 M
  Installed size: 15 M
  Downloading Packages:
  -----------------------------------------------------------------------------------------------
  Total                                                          35 MB/s | 3.7 MB   00:00
  Running rpm_check_debug
  Running Transaction Test
  Transaction Test Succeeded
  Running Transaction
  Warning: RPMDB altered outside of yum.
  Installing : apr-1.3.9-5.el6_2.x86_64                                                1/12
  Installing : apr-util-1.3.9-3.el6_0.1.x86_64                                           2/12
  Installing : apr-devel-1.3.9-5.el6_2.x86_64                                          3/12
  Installing : apr-util-ldap-1.3.9-3.el6_0.1.x86_64                                       4/12
  Installing : httpd-tools-2.2.15-29.el6_4.x86_64                                       5/12
  Installing : httpd-2.2.15-29.el6_4.x86_64                                              6/12
  Installing : expat-devel-2.0.1-11.el6_2.x86_64                                          7/12
  Installing : cyrus-sasl-devel-2.1.23-13.el6_3.1.x86_64                                  8/12
  Installing : openldap-devel-2.4.23-32.el6_4.1.x86_64                                    9/12
  Installing : apr-util-devel-1.3.9-3.el6_0.1.x86_64                                     10/12
  Installing : httpd-devel-2.2.15-29.el6_4.x86_64                                        11/12
  Installing : httpd-manual-2.2.15-29.el6_4.noarch                                       12/12
  Verifying:apr-devel-1.3.9-5.el6_2.x86_64                                          1/12
  Verifying:cyrus-sasl-devel-2.1.23-13.el6_3.1.x86_64                                  2/12
  Verifying: httpd-manual-2.2.15-29.el6_4.noarch                                        3/12
  Verifying:httpd-2.2.15-29.el6_4.x86_64                                              4/12
  Verifying:apr-util-ldap-1.3.9-3.el6_0.1.x86_64                                       5/12
  Verifying:apr-1.3.9-5.el6_2.x86_64                                                6/12
  Verifying:apr-util-devel-1.3.9-3.el6_0.1.x86_64                                    7/12
  Verifying:expat-devel-2.0.1-11.el6_2.x86_64                                       8/12
  Verifying:httpd-devel-2.2.15-29.el6_4.x86_64                                       9/12
  Verifying:openldap-devel-2.4.23-32.el6_4.1.x86_64                                 10/12
  Verifying: httpd-tools-2.2.15-29.el6_4.x86_64                                        11/12
  Verifying:apr-util-1.3.9-3.el6_0.1.x86_64                                          12/12
  Installed:
  httpd.x86_64 0:2.2.15-29.el6_4               httpd-devel.x86_640:2.2.15-29.el6_4
  httpd-manual.noarch 0:2.2.15-29.el6_4          httpd-tools.x86_640:2.2.15-29.el6_4
  Dependency Installed:
  apr.x86_64 0:1.3.9-5.el6_2                  apr-devel.x86_640:1.3.9-5.el6_2
  apr-util.x86_64 0:1.3.9-3.el6_0.1         apr-util-devel.x86_640:1.3.9-3.el6_0.1
  apr-util-ldap.x86_64 0:1.3.9-3.el6_0.1      cyrus-sasl-devel.x86_640:2.1.23-13.el6_3.1
  expat-devel.x86_64 0:2.0.1-11.el6_2         openldap-devel.x86_640:2.4.23-32.el6_4.1
页: [1]
查看完整版本: redhat实现光盘yum