The simplest way for Linux systems to configure local yum sources using ISO image files or discs

Source: Internet
Author: User
Tags gpg

1. Assign Optical Drive

Select the local ISO system image file, or put the system installation disk in the optical drive. After that, you can see the Rhel-7.2-server disc icon on the desktop.

2. View the location of the optical drive mount

Use the df-h command to see where the optical drive or image file is mounted.

3, modify the local Yum source configuration file

[Email protected] ~]# Mv/etc/yum.repos.d/redhat.repo/etc/yum.repos.d/redhat.repo_bak---back up the original configuration file [[email protected]~]# Cat/etc/yum.repos.d/cdrom.repo---Create a new Cdrom.repo with the VI command and add the following [Cdrom]name=Cdrombaseurl= File:///run/media/root/rhel-7.2\ server.x86_64/----Note that the path cannot be directly used in the Mount path shown, because there are spaces in the middle, and you want to add a backslash escape. Gpgcheck =0Enable=1[[Email protected]~]# DF-hfilesystem Size used Avail use%mounted on/dev/mapper/rhel-root8.5G3.1G5.5G $% /Devtmpfs 986M0986M0% /Devtmpfs 1001M 192K 1001M1%/dev/Shmtmpfs 1001M8.8M992M1% /Runtmpfs 1001M01001M0%/sys/fs/Cgroup/DEV/SDA1 497M 140M 358M in% /Boottmpfs 201M4.0K 201M1%/run/user/ thetmpfs 201M 20K 201M1%/run/user/0/dev/sr03.8G3.8G0  -%/run/media/root/rhel-7.2Server.x86_64[[email protected]~]# cd/run/media/root/rhel-7.2server.x86_64 BASH:CD:/run/media/root/rhel-7.2: No Such file or Directory[[email protected]~]# cd/run/media/root/rhel-7.2\ server.x86_64/[[email protected] RHEL-7.2server.x86_64]# lsaddons GPL LiveOS release-notes rpm-gpg-key-redhat-releaseefi images Media.repo repodata TRANS. Tbleula isolinux Packages RPM-gpg-key-redhat-Beta[[email protected] RHEL-7.2server.x86_64]#

4. Test if the Yum source is available

[Email protected] rhel-7.2server.x86_64]# Yum Install httpdloaded plugins:langpacks, product-id, Search-disabled-repos, subscription-managerthis System isNot registered to Red Hat Subscription Management. can use subscription-Manager to register. Resolving Dependencies-Running Transaction Check---> Package httpd.x86_640:2.4.6- +. EL7 'll be installed--Processing Dependency:httpd-tools =2.4.6- +. el7 forpackage:httpd-2.4.6- +. el7.x86_64--Processing Dependency:/etc/mime.types forpackage:httpd-2.4.6- +. el7.x86_64-Processing dependency:libapr-1. So.0() (64bit) forpackage:httpd-2.4.6- +. el7.x86_64-Processing dependency:libaprutil-1. So.0() (64bit) forpackage:httpd-2.4.6- +. el7.x86_64-Running Transaction Check---> Package apr.x86_640:1.4.8-3. EL7 'll be installed---> Package apr-util.x86_640:1.5.2-6. EL7 'll be installed---> Package httpd-tools.x86_640:2.4.6- +. EL7 'll be installed---> Package mailcap.noarch0:2.1. A-2. EL7 'll be installed-finished Dependency resolutiondependencies resolved=============================================================================================================== =================Package Arch Version Repository Size=============================================================================================================== =================installing:httpd x86_642.4.6- +. EL7 CDROM1.2minstalling forDEPENDENCIES:APR x86_641.4.8-3. EL7 CDROM103k Apr-util x86_641.5.2-6. EL7 CDROM thek httpd-tools x86_642.4.6- +. EL7 CDROM thek Mailcap Noarch2.1. A-2. EL7 CDROM toktransaction Summary=============================================================================================================== =================Install1Package (+4Dependent Packages) Total Download size:1.5minstalled Size:4.3MIs ThisOK [y/d/n]:
......

But the disadvantage of the local Yum source configured in this way is that you have to mount the ISO system image to the system, and if you delete the image file locally, the Yum command is unavailable. Another problem is that the next time you restart the system, it will automatically boot from the CD drive to the system installation screen.

The advantage is that the configuration is simple, fast, when you want to use the direct allocation of optical drive, do not want to remove, so it does not occupy storage space. Or if you have a large disk space, you can also copy the entire CD file to a directory in the system, if you modify the Cdrom.repo configuration file in the BaseURL parameter to the corresponding directory.

The simplest way for Linux systems to configure local yum sources using ISO image files or discs

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.