RHEL ES6 updates automatically via Yum update

Source: Internet
Author: User
Tags delete key gpg

Find your closest mirror site from the http://mirror-status.centos.org Web site

Below I take mirrors.163.com as our mirror image site

1. To use the source of the CentOS, you have to remove the Rhel update source, or disable it, and you need to remove the RHEL6 yum tool.

#cd/ETC/YUM.REPOS.D

#mv Packagekit-media.repo Packagekit-media.repo.back

It is backed up for accidental recovery, if any other related source settings are deleted, or backed up using the above method.

2. Download the source configuration file:

#cd/ETC/YUM.REPOS.D

wget Http://mirrors.163.com/.help/CentOS6-Base-163.repo

In this configuration file, there are some places to change, otherwise can not connect to the server to update, there is a variable-$releasever, it represents the system version number, this article is based on the 6 version, so you need to change all the variable names in the configuration file to 6, This will use a SED syntax.

#vim/etc/yum.repos.d/centos6-base-163.repo

Press ESC first and then enter

: 1,%s/$releasever/6/g

Save exit. At this time RHEL6 use CentOS source problem, is solved. But there is a place to say that a lot of experts on the Internet to write the solution finally have a said to use the set up a good source for upgrades, such as #yum update.

What I want to say is, if you like the Rhel interface and appearance, do not try to do so lightly, otherwise you will regret it, because this will make your system like CentOS, just keep the original kernel, but not as the default boot ... That is, you have a RHEL6 in the centos6 of the kernel, although the same two cores, but because the name is different and let them separate, this is not a contrary intention.

So, if you mind this, please don't be lazy, need to upgrade which, or need to install which, on which software to operate, which is the purpose of our set this source.

3. Download and Import key
Cd/etc/pki/rpm-gpg
wget http://mirrors.163.com/centos/6/os/i386/RPM-GPG-KEY-CentOS-6

RPM--import/etc/pki/rpm-gpg/rpm-gpg-key*

This can be done through the Yum update operation

4. Yum directive
Note: When an update is used for the first time using the Yum or Yum Repository, Yum automatically downloads all required headers placed in the/var/cache/yum directory, which may take a long time.
Update of RPM Package
* Check for updatable RPM packages
#yum check-update
* Update all RPM packages
#yum Update
* Update the specified RPM package, such as update kernel and kernel source
#yum Update Kernel Kernel-source
* Large-scale version upgrades, unlike Yum Update, even old obsolete packages are upgraded
#yum Upgrade
Installation and removal of RPM packages
* Install RPM packages, such as Xmms-mp3
#yum Install Xmms-mp3
* Delete the RPM package, including a dependent package with the package
#yum Remove Licq
* Note: At the same time will be prompted to delete Licq-gnome,licq-qt,licq-text
Yum (/var/cache/yum/) Related parameters
* Clear the temporary storage of the RPM package file
#yum Clean Packages
* Clear the staging of the RPM header file
#yum Clearn Headers
* Clear the old RPM header files in the staging
#yum Clean Oldheaders
* Clean up the old RPM header files and package files in the staging
#yum Clearn or #yum clearn all
* Note: equivalent to yum clean packages + Yum clean oldheaders
Package List
* List all the RPM packages in the repository that can be installed or updated
#yum List
* List specific available RPM packages in the repository that can be installed or updated and installed
#yum list Mozilla
#yum List mozilla*
* Note: You can use matching characters in the RPM package name, such as listing all the RPM packages that start with Mozilla
* List all the RPM packages in the repository that can be updated
#yum list Updates
* List all the RPM packages that have been installed
#yum List installed
* List the RPM packages that have been installed but not included in the repository
#yum List Extras
* Note: Download the installed RPM package through other websites
RPM Package Information display (info parameter with list)
* List all the RPM packages that can be installed or updated in the repository
#yum Info
* List specific information in the repository that can be installed or updated and installed RPM packages
#yum info Mozilla
#yum Info mozilla*
* Note: You can use matching characters in the RPM package name, such as listing all the RPM packages that start with Mozilla
* List all the RPM packages that can be updated in the repository
#yum Info Updates
* List all the RPM packages that have been installed
#yum Info installed
* List information about the RPM packages that have been installed but not included in the repository
#yum Info Extras
* Note: Download the installed RPM package information through other websites
Search RPM Package
* Search for the RPM package matching specific characters
#yum search Mozilla
* Note: in the RPM package name, package description, etc. search
* Search for RPM packages that contain specific file names
#yum provides Realplay
5. Increase resource pool
* For example: Add rpm.livna.org as a resource pool
* Install livna.org RPMs GPG key
#rpm –import
Http://rpm.livna.org/RPM-LIVNA-GPG-KEY

* Check GPG Key
# Rpm-qa gpg-pubkey*
* Display key information
#rpm-qi Gpg-pubkey-a109b1ec-3f6e28d5
* (Note: If you want to delete key, use #rpm-e gpg-pubkey-a109b1ec-3f6e28d5)

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.