This article is intended for Linux starters, and experts can pass through it to avoid ridicule.
Common sense:
1. By default, rhl5 does not contain GCC. You need to install it on your own.
2. The GCC installation package is under the server directory where the CD is installed or the ISO server.
3. If you directly install rpm, the system prompts "nokey" and multiple dependent packages are provided. "nokey" does not matter, but it will not work if the dependent package is not installed.
Start:
To solve the dependency package problem, the original method is as follows:. when installing the system, the system automatically calculates the dependencies and installs the dependent packages. B. install GCC one by one. modern means: rhl5 provides a tool Yum that can automatically help you calculate dependency packages and install them all automatically.
The problem is how to configure Yum: Yum is installed by default, but if you directly install GCC *. an error will still be prompted. Follow the prompts in one article:/etc/yum. repos. d/rhel-debuginfo.repo.
After you open it, you must note the following three items:
Baseurl = file: // media/Server/
Enabled = 1
Gpgcheck = 0.
Here, baseurl needs to be modified based on your CD location or ISO Mount location. I encountered a problem where I used a vmvm. After I directly mounted the ISO to the optical drive, the name of the disc is [rhl5_2 DVD], which contains spaces, no matter whether I use spaces in the baseurl or, [/] Can Be Cd in shell. I don't understand it now. I haven't found any method on the Internet. It's probably too mentally retarded and nobody cares. Later I saw an article from:
Http://blog.sina.com.cn/jarwang
Next article: rhel5 install and configure the CD yum. The steps are partially revised and explained here: (thanks to the author)
1. Copy rhl5.iso to a directory that you can access [because I use a virtual machine and set a folder shared by Windows and Linux (created through vmtool ), the location is under/mnt/HGFS/linuxshare/. Here, liunxshare is the folder name defined by myself, and my rhl5.iso is placed in this directory.
2. Mount to the/Media Directory
Mount-o loop rhl5.iso/Media [Note that if you mount the file directly to media, the content of the file will be displayed directly under media without creating a directory, this is the server folder directly under/media]
3. Modify the yum File
Gedit/etc/yum. Repos. d/rhel-local.repo
The content is as follows: [I still don't understand why there are so many things]
[Cluster]
Name = Red Hat Enterprise Linux $ releasever-$ basearch-Cluster
Baseurl = file: // media/Cluster
[This cluster folder is the folder under the root directory of the original CD, similar to the following]
Enabled = 1
Gpgcheck = 0 [the key is not checked here, so it is set to 0]
Gpgkey = file: // etc/pki/rpm-GPG-key-RedHat-release
[Clusterstorage]
Name = Red Hat Enterprise Linux $ releasever-$ basearch-clusterstorage
Baseurl = file: // media/clusterstorage
Enabled = 1
Gpgcheck = 0
Gpgkey = file: // etc/pki/rpm-GPG-key-RedHat-release
[Server]
Name = Red Hat Enterprise Linux $ releasever-$ basearch-Server
Baseurl = file: // media/Server
Enabled = 1
Gpgcheck = 1
Gpgkey = file: // etc/pki/rpm-GPG-key-RedHat-release
[Vt]
Name = Red Hat Enterprise Linux $ releasever-$ basearch-vt
Baseurl = file: // media/vt
Enabled = 1
Gpgcheck = 1
Gpgkey = file: // etc/pki/rpm-GPG-key-RedHat-release
4. Create a RHEL/directory
Mkdir-P/var/RHEL/{cluster, clusterstorage, server, vt}
5. Install createrepo
Rpm-VIH/Media/Server/createrepo-0.4.4-2.fc6.noarch.rpm
[My rhl5.2 is not the createrepo-0.4.4-2.fc6.noarch.rpm, the name and there are some differences, each person can check their own Server Installation Package, part of the name to modify]
Then execute:
Createrepo-O/var/RHEL/cluster-g/Media/cluster/repodata/comps-rhel5-cluster.xml/Media/Cluster
Createrepo-O/var/RHEL/clusterstorage-g/Media/clusterstorage/repodata/comps-rhel5-cluster-st.xml/Media/clusterstorage
Createrepo-O/var/RHEL/Server-g/Media/Server/repodata/comps-rhel5-server-core.xml/Media/Server
Createrepo-O/var/RHEL/VT-g/Media/VT/repodata/comps-rhel5-vt.xml/Media/vt
6. Mount
Mount -- bind/var/RHEL/cluster/repodata/Media/cluster/repodata
Mount -- bind/var/RHEL/clusterstorage/repodata/Media/clusterstorage/repodata
Mount -- bind/var/RHEL/Server/repodata/Media/Server/repodata
Mount -- bind/var/RHEL/VT/repodata/Media/VT/repodata
[The above is the solution provided by the author. Unfortunately, I have not fully understood the purpose and necessity of this process.] But it is worth noting that if you have completed the above steps correctly, here is the shell CD, run the following command in the server directory:
Yum install GCC *. You can install GCC all without having to install it one by one. The key is that it is not only used to install GCC, but can be used to install any. It is a great deal of trouble and happiness .]
1. Install Yum install GCC * directly to solve the dependency problem.
2. After the installation is complete, check the GCC version: