Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to make a local yum source from an installation CD or ISO file by RHEL6

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article introduces the relevant knowledge of "how RHEL6 makes local yum sources through installation CDs or ISO files". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!

The method of making local yum source by RHEL6 through installation CD or ISO file

There is no .repo file by default in rhel6, so you need to write one yourself.

Before using yum installation, you must configure the yum source. If you can't connect to the Internet, you can use DVD CD or ISO file as the local yum source. Take RHEL6.0 as an example, other versions are similar.

1. Create a directory for storing ISO files (/ repo/iso) and a directory for mounting ISO files (/ repo/rhel6)

# mkdir / repo/iso

# mkdir / repo/rhel6

If there is a ready-made ISO file, you can upload it directly to the / repo/iso directory.

two。 If it is a DVD CD (automatically mapped under / dev/cdrom after being inserted into the server), make the ISO file first

# cp / dev/cdrom / repo/iso/rhel-server-6.0-x86_64-dvd.iso

Or

# dd if=/dev/cdrom f=/repo/iso/rhel-server-6.0-x86_64-dvd.iso

3. Mount the ISO file

# mount-t iso9660-o loop / repo/iso/rhel-server-6.0-x86_64-dvd.iso / repo/rhel6

# df-h

File system capacity used available mount point% used

/ dev/sda5 97G 5.8G 86G 7% /

Tmpfs 1.9G 272K 1.9G 1% / dev/shm

/ dev/loop0 3.2G 3.2g 0100% / repo/rhel6

4. Ensure that yum-related software packages are installed on 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 be different, if it is missing, please install it yourself (these packages are basically 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 here points to the Server directory, and if you also want to install software such as clusters and virtual machines, you also need to set up a baseurl that points to Cluster,ClusterStorage,VT.

6. test

# system-config-packages (under XWindow, select the package you want to install)

# yum install lrzsz (download and install lrzsz package, automatically find and resolve dependencies)

7. Write mount commands to fstab

For convenience, write these mount into / etc/fstab so that you can mount them when you power on:

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

# # #

# # #

RHEL6.1 was officially released on May 19th, and I downloaded and installed it yesterday, because my host is a 64-bit system, so this time I decided to install 64-bit RHEL6.1 successfully. In the future, all my courses will be demonstrated on the basis of this version until the next version comes out. Although RHEL6.1 is installed, I also summarized some things you might want to know about RHEL6.1 for your reference.

1, RHEL 6 text mode installation can not customize the partition, unable to customize the installation package.

Starting with RHEL6, text mode installation cannot customize partitions and install packages, as if to block a bug, because there is a bug when you turn on this feature, so it is blocked.

If you want to customize partitions and custom installation packages, you can only customize partitions and packages through graphical interface mode or kickstart installation.

2. Configuration of RHEL6.1 local source

Create a file ending in .repo in / etc/yum.repos.d/ and write the corresponding YUM configuration information

[root@localhost yum.repos.d] # cat local.repo [local] name=local_yum baseurl= file:///mnt enabled=1 gpgcheck=1 gpgkey= file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release

Description:

A. I use the CD to mount to / mnt as the source address.

B, the file name is / etc/yum.repos.d/local.repo

C. If you want to install and delete software on your desktop, you need to open gpgcheck and set Key

Then you need to copy and replace / etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release the KEY in the CD.

[root@localhost yum.repos.d] # cp / mnt/RPM-GPG-KEY-redhat-release / etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release cp: overwrite "/ etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release"? Y

Execute yum clean all so that the local YUM source for RHEL6.1 is configured successfully.

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

On RHEL6.0, change the local yum source to the DVD image of rhel 6.1, open the terminal, execute the yum update command, the system will search for new updates and prompt you to update, and restart the system after the upgrade is over.

4. Install the Gnome desktop in the character interface

If you are a character interface installed system, because you are not allowed to select software packages, so you need to install the necessary software, such as the desktop, after installing the system.

In RHEL6.1, the name of gonme table bread becomes Desktop, which is the default desktop of RHEL6.1. However, if only this group is installed, it will not work, it lacks the support of the X protocol, and the following X-related errors will appear when starting the desktop.

Xinit: No such 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.

So, to install the Gnome desktop in the character interface, you need to install two groups.

Yum groupinstall "X Window System" yum groupinstall "Desktop"

5. Change the Chinese environment to the English environment

If you choose the support of the Chinese language pack when you install the system, the system will be displayed in Chinese. If used in the terminal, it is a bit inconvenient, farewell is using these commands yum group*, may not be able to install.

The solution is to edit.

/ etc/sysconfig/i18n

Replace zh_CN with en_US LANG= "en_US.UTF-8" and execute the following command source / etc/sysconfig/i18n once

6. If you are playing with the desktop, you need to know that the call command for package management has been replaced with gpk-application

Download address of ed2k link and verification information for the following RHEL6.1:

* (X86) * *

Red Hat Enterprise Linux 6.1Server (x86) boot.iso 208MB MD5: 724c2308cbfbceb385633e132b89d766 SHA-256: d7cf7e76408914f6fa4f92cc09b409fcf864d5155c694fbf1675e56c3b5a9b29 ed2k:// | file | rhel-server-6.1-i386-boot.iso | 218103808 | E6E042576CEAE866326C88B8ECC53E4D | / Binary DVD 2924 MB MD5: f8c8a310e34d26339c99d462e3557324 SHA-256: 73ca2918cab11120575cb8231eed40027b31bb671199a327d7e102d47adc6a20 ed2k:// | file | rhel-server-6.1-i386-dvd.iso | 3066486784 | 492A4CCAE7C2C52CCA87196C72A4E24F | /

* (X64) * *

Red Hat Enterprise Linux 6.1Server (AMD64/Intel EM64T) boot.iso 250MB MD5: ab5072eaf2f7cab28bd4da1c00dedd80 SHA-256: 91f1ff57787b5885561095a217eed2ef06a438a9f56a5c3aed24551b1afa06be ed2k:// | file | rhel-server-6.1-x86_64-boot.iso | 262144000 | DA929A1375F3BAAF5061AD82B07F90FF | / Binary DVD 3434 MB MD5: a051dbf28ef444a019dc6660efe3e3a4 SHA-256: 408b53542d967458c8a51ba0d4079956c853b30a029dea6df93d4a1d65ba4a3f ed2k:// | file | rhel-server-6.1-x86_64-dvd.iso | 3600812032 | D39B97540497D24175340915244E6DA5 | /

# # #

# # #

RHEL6 has attracted the attention of many enthusiasts, although the RHCE course is still around RHEL5.4 (their own guess), but 6 is the general trend! After reading several articles about changing YUM sources, a friend said that replacing YUM sources is easier than RHEL5, but my own view is just the opposite. in the past, it can be replaced directly in GUI, but downloading can only be forced in.

RHEL6 has attracted the attention of many enthusiasts, although the RHCE course is still around RHEL5.4 (their own guess), but 6 is the general trend! After reading several articles about changing YUM sources, some friends said that replacing YUM sources is easier than RHEL5, but my own view is just the opposite. in the past, it can be replaced directly in GUI, but downloads can only be hard tapped on the command line, but this is very suitable for RHCE training!

Let's take a look at the file structure of RHEL6's mirror disk first: the two sets of arrows in the following figure point to the link and the corresponding actual file location. There are all the rpm packages needed by the YUM source under the Packages folder, while there are only Packages links under the Server folder, so we should first copy the Server folder (do not copy the Package link file, it is meaningless, replace it with a real Packages file) to the / mnt folder as the local yum source.

Use vim / etc/yum.repos.d/local.repo to create an answer file for .repo, as follows:

[local]

Name=local

Baseurl= file:///mnt/Server

Enabled=1

Gpgcheck=0

Then: wq saves and exits and executes the following three commands:

Yum clean all

Yum list

Yum grouplist

If there is an error message, please check it accordingly. The most common is to indicate that the .xml tag file is missing. Just copy the file under the ISO/Server file to the yum source target location.

Finally, uninstall the ISO image of RHEL6, navigate to the [add / remove Software]-[system] menu-[Software Source] interface, enable the local source, and then enter eclipse to verify. If there is an ash-to-install package on the right, the yum source replacement is complete!

You can verify it by executing yum install. If you are prompted to enter [y _ yum source N], there is nothing wrong with it! Conclusion: if you directly copy the Packages folder as yum source, then you also need to copy all the configuration files and folders under the Server file except the same name folder to your Packages peer folder, if there are any errors, there will be a corresponding prompt.

This is the end of the content of "how RHEL6 makes a local yum source through an installation CD or ISO file". Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report