RHEL 5 , 用安装CD作为YUM的Repository

本文介绍如何使用ISO镜像及Yum工具离线升级Red Hat Enterprise Linux系统。包括创建挂载目录、挂载ISO镜像、配置Yum源及更新系统等步骤。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

官方文档写的非常好

14.5. Upgrading the System Off-line with ISO and Yum

  1. Create a target directory to mount your ISO image. This directory is not automatically created when mounting, so create it before proceeding to the next step, as  root, type:
    mkdir mount_dir
    Replace  mount_dir with a path to the mount directory. Typicaly, users create it as a subdirectory in the  /media/ directory.
  2. Mount the Red Hat Enterprise Linux 5 installation ISO image to the previously created target directory. As  root, type:
    mount -o loop iso_name mount_dir
    Replace  iso_name with a path to your ISO image and  mount_dir with a path to the target directory. Here, the  -o  loop option is required to mount the file as a block device.
  3. Check the numeric value found on the first line of the  .discinfo file from the mount directory:
    head -n1 mount_dir/.discinfo
    The output of this command is an identification number of the ISO image, you need to know it to perform the following step.
  4. Create a new file in the  /etc/yum.repos.d/ directory, named for instance  new.repo, and add a content in the following form. Note that configuration files in this directory must have the .repo extension to function properly.
    [repository] 
    mediaid=media_id 
    name=repository_name
    baseurl=repository_url
    gpgkey=gpg_key 
    enabled=1 
    gpgcheck=1
    
    Replace  media_id with the numeric value found in  mount_dir/.discinfo. Set the repository name instead of repository_name, replace  repository_url with a path to a repository directory in the mount point and  gpg_key with a path to the GPG key.
    For example, the repository settings for Red Hat Enterprise Linux 5 Server ISO can look as follows:
    [rhel5-Server] 
    mediaid=1354216429.587870 
    name=RHEL5-Server
    baseurl=file:///media/rhel5/Server 
    gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release 
    enabled=1 
    gpgcheck=1
    
  5. Update all yum repositories including  /etc/yum.repos.d/new.repo created in previous steps. As  root, type:
    yum update

RHEL 7

转载于:https://www.cnblogs.com/johnsonshu/p/5760703.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值