RedHat configure Yum to update software from centos5 source and CD Source

Source: Internet
Author: User
Tags gnupg gpg
Yum As the name implies, yellow dog Updater and modified. Yum perform the same work for rpm-based systems. It provides a simple command that can be used to automatically install or update a software package after you first install and update any other necessary software packages to meet the required software package dependency, similar to the APT-Get tool in Debian. yum Features : You can configure multiple resource libraries (repository) at the same time)
Simple configuration file (/etc/yum. conf
Automatically solves the dependency problem when RPM packages are added or deleted.
Easy to use
To maintain consistency with the RPM database, RHEL As5 can upgrade the system's functions through yum, but the default Rhel-debuginfo.repo The configuration is to upgrade the system from the RedHat Yum source. If you have not purchased the RedHat service, the upgrade of the version later than redhat5 is billed and requires a key to upgrade, so you cannot upgrade the system using yum. Fortunately, since centos is a free enterprise version, you can use the centos Yum source to update the RHEL As5 system. Configure Yum to update software from centos5 Source [Root @ clinet ~] # Rpm -- Import Http://ftp.twaren.net/Linux/CentOS/RPM-GPG-KEY-CentOS-5 Install Ftp.twaren.net Of GPG You can also add other resource libraries and select a resource closer to your location. [Root @ clinet ~] # Rpm-Qa GPG-pubkey * Check GPG key Gpg-pubkey-e8562897-459f07a4 To delete a key, run the following command: [Root @ clinet ~] # Rpm e gpg-pubkey-e8562897-459f07a4   [Root @ clinet ~] # VI/etc/yum. Repos. d/rhel-debuginfo.repo [RHEL-debuginfo] Name = Red Hat Enterprise Linux $ releasever-$ basearch-debugbaseurl = Signature/ Baseurl It's yours. Yum Source Address Enabled = 0 Whether to enable this repository, 1 For use, 0 Disabled Gpgcheck = 1 Set Gpgcheck = 1 Will make Yum Check each downloaded Rpm Of GnuPG Signature. This is because you need GnuPG key Register with your Rpm Database. This can prevent spoofing, such as illegal intrusion into the release website and Trojan horse import software packages, allowing uninformed users to download Gpgkey = file: // etc/pki/rpm-GPG-key-RedHat-release Gpgkey Storage address The following update points are added to the copy operation by default.Rhel-debuginfo.repo Behind the text [Base] Name = Red Hat Enterprise Linux $ releasever-basebaseurl = Alibaba Hat Enterprise Linux $ releasever-updatesbaseurl = Alibaba Hat Enterprise Linux $ releasever-extrasbaseurl = Alibaba hat Enterprise Linux $ releasever-addonsbaseurl = http://ftp.twaren.net/linux/centos/5/addons/?basearch/gpgcheck=1#root@clinet ~] # Yum clean all Clear cache and old packages [Root @ clinet ~] # Yum install httpd Test whether software can be updated

Note::When used for the first timeYumOrYumWhen the resource library is updated, YumYesAutomatically download all requiredHeadersPlaced on/Var/Cache/yumDirectory,The required time may be long..Please be patient, so a series of data will be displayed later.

Configure Yum to update software from a local CD [Root @ clinet ~] # Mkdir/mnt/CDROM Create a mount point [Root @ clinet ~] # Mount/dev/CDROM/mnt/CDROM Attach a cd Mount: block device/dev/CDROM is write-protected, mounting read-only   [Root @ clinet/] # ll/etc/yum. Repos. d/ Total 4 -RW-r -- 1 Root 781 Feb 24 rhel-debuginfo.repo [Root @ clinet/] # cd/etc/yum. Repos. d/ [Root @ clinet yum. Repos. d] # cp rhel-debuginfo.repo rhel-debuginfo.repo.bak Copy to rhel-debuginfo.repo.bak for backup [Root @ clinet yum. Repos. d] # ll Total 8 -RW-r -- 1 Root 781 Feb 24 rhel-debuginfo.repo -RW-r -- 1 Root 781 Feb 25 rhel-debuginfo.repo.bak [Root @ clinet yum. Repos. d] # vi rhel-debuginfo.repo Edit rhel-debuginfo.repo, insert the followingCode   [RHEL-debuginfo] Name = Red Hat Enterprise Linux $ releasever-$ basearch-Debug Baseurl = file: // MNT/CDROM/Server Enabled = 1 Gpgcheck = 1 Gpgkey = file: // etc/pki/rpm-GPG-key-RedHat-release   In fact, the above settings are OK, but xen. RPM cannot be updated because it is under/mnt/CDROM/vt. To be more complete, we modify the parameters as follows:   [Cluster]
Name = Red Hat Enterprise Linux $ releasever-$ basearch-Cluster
Baseurl = file: // MNT/CDROM/Cluster
Enabled = 1
Gpgcheck = 1
Gpgkey = file: // etc/pki/rpm-GPG-key-RedHat-release
[Clusterstorage]
Name = Red Hat Enterprise Linux $ releasever-$ basearch-clusterstorage
Baseurl = file: // MNT/CDROM/clusterstorage
Enabled = 1
Gpgcheck = 1
Gpgkey = file: // etc/pki/rpm-GPG-key-RedHat-release
[Server]
Name = Red Hat Enterprise Linux $ releasever-$ basearch-Server
Baseurl = file: // MNT/CDROM/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: // MNT/CDROM/vt
Enabled = 1
Gpgcheck = 1
Gpgkey = file: // etc/pki/rpm-GPG-key-RedHat-release   [Root @ clinet yum. Repos. d] # Yum clean all Clear cache and old packages Loaded plugins: rhnplugin, security Cleaning up everything [Root @ clinet yum. Repos. d] # Yum install httpd Test whether software can be updated Common sources of yum 1) automatically select the fastest Source The speed of some mirror in yum is very slow. If Yum chooses this mirror, yum will be very slow. For this reason, you can download the fastestmirror plug-in, it automatically selects the fastest mirror: # Yum install Yum-fastestmirror Configuration File: (usually do not change)/etc/Yum/pluginconf. d/fastestmirror. conf Speed Test record file of your yum image:/var/Cache/Yum/timedhosts.txt 2) use the yum If the yum of the command line is inconvenient, you can use the graphical yumex, which looks more convenient, because you can freely choose the software Repository: # Yum install yumex then you can see Yum extender in the system tool. In fact, the system's built-in "Add/delete programs" can also implement graphical software, but some yumex features it does not.

supplement:
Configuration and use of Yum local source

: mount your CD to a directory: Mount-T iso9660/dev/CDROM/mnt/CDROM

B: Modify your yum configuration file: edit/etc/yum. repos. d/rhel-debuginfo.repo files,

[RHEL-debuginfo]

name = Red Hat Enterprise Linux $ releasever-$ basearch-Debug

baseurl = file: /// MNT/CDROM/server

enabled = 1

gpgcheck = 0

gpgkey = file: /// etc/pki/rpm-GPG-key-RedHat-release

mainly configures the baseurl, enabled, and gpgcheck fields, file: // absolute path is used locally.

Save and exit.

C: Yum update

I'm sure you have some questions, if it can be identified, it will be automatically mounted to/media. Why do we need to manually mount it? This is necessary, because if you do not mount the repodata file that Yum requires, there is nothing to do with it, because Yum will automatically resolve the dependency for you only if you want to read the file.

what else do you want to learn with everyone when you have no disk and only ISO files? A simple command solves Mount-o loop/XX/xxx. ISO/mnt/CDROM. You can continue.

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.