Rhel6 how to create a local Yum source by installing a CD or ISO file

Source: Internet
Author: User
Tags i18n

By default, there is no. Repo file in rhel6. You need to write one yourself.

Before using yum for installation, you must configure the yum source. If you cannot connect to the Internet, you can use a DVD or ISO file as the local Yum source. The following uses rhel6.0 as an example. Other versions are similar.

1. Create an ISO file storage directory (/repo/ISO) and an ISO file Mount directory (/repo/rhel6)
# Mkdir/repo/ISO
# Mkdir/repo/rhel6
If there is a ready-made ISO file, you can directly upload it to the/repo/ISO directory.

2. If it is a DVD Disc (which is automatically mapped to/dev/CDROM after the server is inserted), the ISO file is created first.
# Cp/dev/CDROM/repo/ISO/rhel-server-6.0-x86_64-dvd.iso
Or
# Dd If =/dev/CDROM of =/repo/iso/ rhel-server-6.0-x86_64-dvd.iso

3. mount an ISO file
# Mount-T iso9660-o loop/repo/ISO/rhel-server-6.0-x86_64-dvd.iso/repo/rhel6
# DF-H
File System capacity in use available % mount point
/dev/sda5 97g 5.8g 86g 7%/
tmpfs 1.9g 272 K 1.9g 1%/dev/SHM
/dev/loop0 3.2g 3.2g 0 100%/repo/rhel6

4. Make sure that Yum-related software packages are installed in the system.
# Rpm-Qa | grep yum
Yum-3.2.27-14.el6.noarch
Yum-utils-1.1.26-11.el6.noarch
Yum-rhn-plugin-0.9.1-5.el6.noarch
PackageKit-yum-0.5.8-13.el6.x86_64
Yum-metadata-parser-1.1.2-14.1.el6.x86_64
PackageKit-yum-plugin-0.5.8-13.el6.x86_64
The version number may vary. if the version number is missing, install it on your own (these packages are installed by default ).

5. Edit the repo File
# Vi/etc/yum. Repos. d/rhel6.repo
-------------------------------------------------------------------------------
[Server]
Name = rhel6server
Baseurl = file: // repo/rhel6/Server
Enable = 1
Gpcheck = 1
Gpgkey = file: // repo/rhel6/rpm-GPG-key-RedHat-release
-------------------------------------------------------------------------------
Note that the baseurl points to the server directory. If you want to install software such as a cluster and virtual machine, you also need to create a baseurl pointing to cluster, clusterstorage, and vt.

6. Test
# System-config-packages (under XWindow, select the required software package to install)
# Yum install lrzsz (download and install the lrzsz package to automatically find and resolve dependencies)

7. Write the mount command to fstab.

For convenience, write these mounts into/etc/fstab so that they can be mounted upon startup:

/Repo/ISO/rhel-server-6.0-x86_64-dvd.iso/repo/rhel6 iso9660 loop 0 0

 

The. Repo file configuration of rhel6.1 workstation is as follows:

[Workstation]
Name = rhel6server
Baseurl = file: // repo/rhel6.1/Workstation
Enable = 1
Gpcheck = 1
Gpgkey = file: // repo/rhel6.1/rpm-GPG-key-RedHat-release

 

Configure the disc Source

Step 1: Mount/dev/sr0/mnt or Mount/dev/CDROM/mnt

Step 2: Create the repo file Vim/etc/yum. Repos. d/Felix. Repo

[Server]
Name = rhel6server
Baseurl =File: // Mnt
Enable= 1
Gpcheck = 0

Step 2: Yum installHttpdIs there any configuration?

If the following error is reported:

Warning: rpmts_hdrfromfdno: Header V3 RSA/sha256 signature, key ID fd431d51: nokey

Public Key for cyrus-sasl-devel-2.1.23-8.el6.i686.rpm Is Not Installed

Modify the/etc/yum. conf file, change gpgcheck = 1 to gpgcheck = 0, and skip verification.

 

Expand knowledge

1. How to upgrade from rhel6.0 to rhel6.1

On rhel6.0, replace the local Yum source with the RHEL 6.1 DVD image, enable the terminal, and run Yum upDateCommand, the system will search for new updates and prompt you to update. After the upgrade, restart the system.

2. Install GNOME desktop on the Character Interface

If you are installing the system on the Character interface, because you do not want to select a software package, you need to install the required software, such as the desktop, after installing the system.

In rhel6.1, the name of the gonme desktop package is changed to desktop, which is the default desktop of rhel6.1. However, if you only install this group, it will not work. It lacks the support of the X protocol. When you start the desktop, the following error messages related to X will appear.

Xinit: NoSuCh
File or directory (errno 2): No server "/usr/bin/X" in path xinit: No
Such file or directory (errno 2): Unable to connect to X Server xinit:
No such process (errno 3): server error.

Therefore, to install GNOME desktop on the Character interface, you need to install two groups.
 

Yum groupinstall "X Window System"

Yum groupinstall "desktop"

3. Change the Chinese environment to an English environment

If you select Chinese Language Pack support when installing the system, the system will display it in Chinese. If it is used on the terminal, it is a little inconvenient. You may not be able to install it when using the yum Group * commands. Echo $ Lang

The solution is to edit

/Etc/sysconfig/i18n

 

Replace zh_cn with en_us lang = "en_US.UTF-8" and then execute the following command source/etc/sysconfig/i18n

[root@linuxso.com ~] # Echo $ Lang
en_US.UTF-8

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.