Yum source of centos6

Source: Internet
Author: User
Tags gpg
How to Use centos6 Yum source classification for 32-bit rhel6: Linux basics 325 people read comments (0) collect reports

How to Use centos6 Yum source for 32-bit rhel6)

 

Http://blog.chinaunix.net/uid-24501667-id-3059325.html

(Note: When installing the file, refer to the URL path.

How to Use centos6 Yum source for 32-bit rhel6

1. Uninstall yum
# Rpm-AQ | grep Yum | xargs rpm-e -- nodeps

2. Download The centos 6.0 package
Wget

Http://mirrors.163.com/centos/6/ OS /i386/Packages/python-iniparse-0.3.1-2.1.el6.noarch.rpm

Wget http://mirrors.163.com/centos/6/ OS /i386/Packages/yum-metadata-parser-1.1.2-14.1.el6.i686.rpm
Wget http://mirrors.163.com/centos/6/ OS /i386/Packages/yum-3.2.27-14.el6.centos.noarch.rpm
Wget http://mirrors.163.com/centos/6/ OS /i386/Packages/yum-plugin-fastestmirror-1.1.26-11.el6.noarch.rpm

3. Install the downloaded package
Rpm-IVH python-iniparse-0.3.1-2.1.el6.noarch.rpm
Rpm-IVH yum-metadata-parser-1.1.2-14.1.el6.i686.rpm
Rpm-IVH yum-3.2.27-14.el6.centos.noarch.rpm yum-plugin-fastestmirror-1.1.26-11.el6.noarch.rpm

4. centos 6.0/etc/yum. Repo. d/CentOS-Base.repo file to the RHEL 6.0 directory/etc/yum. Repo. d /;
Then run VI/etc/yum. Repo. d/CentOS-Base.repo; input: % S/$ releasever/6.0 /. Change the version to cent-6.0.
(The URL path in the CentOS-Base.repo is not correct, please refer to the URL to check the correct), with the correct URL under rhe6.
5. Import the key of centos 6.0
Wget http://mirrors.163.com/centos/6/ OS /i386/RPM-GPG-KEY-CentOS-6
Rpm -- import RPM-GPG-KEY-CentOS-6 (downloaded under root, sometimes under/tmp)

Vi. Use
1. upgrade the system
[[Email protected] ~] # Yum update

2. Install the specified software package. I prefer to use the following command.
[[Email protected] ~] # Yum-y install vsftpd

3. Upgrade the specified Software Package
[[Email protected] ~] # Yum-y update MySQL

4. Uninstall the specified Software Package
[[Email protected] ~] # Yum-y remore vsftpd MySQL

5. Check the installed and available software groups in the system. For available software groups, you can choose to install
[[Email protected] ~] # Yum grouplist

6. Install a software group in the available software group displayed in the previous command. The god Editor-Emacs has around 12 software packages installed.
[[Email protected] ~] # Yum-y groupinstall Emacs

7. Update Software packages in a specified Software Group
[[Email protected] ~] # Yum-y groupupdate Emacs

8. Uninstall the software packages in the specified software group. For Emacs, 12 software packages are installed, but only 4 software packages are uninstalled!
[[Email protected] ~] # Yum-y groupremove Emacs

9. Clear cache RPM header files and package files
[[Email protected] ~] # Yum clean all

10. Search related software packages
[[Email protected] ~] # Yum-y search Emacs

11. display the information of the specified Software Package
[[Email protected] ~] # Yum info Emacs
Similar to the information displayed by rpm-Qi Emacs, but not exactly the same

12. query the dependency information of a specified software package. emacs depends on many modules.
[[Email protected] ~] # Yum deplist Emacs

13. list all software packages starting with yum
[[Email protected] ~] # Yum list Yum \*

14. List the installed RPM packages that are not included in the resource library
# Yum list extras
The most common commands are the 3, 4 commands.


========================================================== ====

Install centos Yum source in redhat6

2011.12.14/label: centos, Linux, RedHat, yum, installation/classification: Linux

Moper

1. Delete the original Yum of RedHat.
Rpm-AQ | grep Yum | xargs rpm-e-nodeps
2. Download the yum Installation File
Wget http://mirrors.163.com/centos/6/ OS /x86_64/Packages/yum-3.2.27-14.el6.centos.noarch.rpm
Wget http://mirrors.163.com/centos/6/ OS /x86_64/Packages/yum-metadata-parser-1.1.2-14.1.el6.x86_64.rpm
Wget http://mirrors.163.com/centos/6/ OS /x86_64/Packages/yum-plugin-fastestmirror-1.1.26-11.el6.noarch.rpm
Wget http://mirrors.163.com/centos/6/ OS /x86_64/Packages/python-iniparse-0.3.1-2.1.el6.noarch.rpm
3. Install yum
Rpm-IVH python-iniparse-0.3.1-2.1.el6.noarch.rpm
Rpm-IVH yum-metadata-parser-1.1.2-14.1.el6.x86_64.rpm
Rpm-IVH yum-3.2.27-14.el6.centos.noarch.rpm yum-plugin-fastestmirror-1.1.26-11.el6.noarch.rpm
Note that the last two packages must be installed at the same time, otherwise they will depend on each other.

4. Install the yum Source
CD/etc/yum. Repos. d
Wget http://mirrors.163.com/.help/CentOS6-Base-163.repo

5. Replace $ releasever
Vim/etc/yum. Repos. d/CentOS6-Base-163.repo
1, % S/$ releasever/6.0

Note that the URL address has changed.
1, % S/$ releasever/6

Note: The test is successful, but I don't know if it is easy to use. Please correct it.
Note: The test shows that the not found error may occur when downloading the yum package because there is no corresponding version of rpm in the source. You can go to the image webpage and find the upgraded version of the corresponding RPM package. After modification, you can install it normally.

Repost an article for reference:

Because the RedHat Yum online update is charged, it cannot be used if it is not registered. to use it, you need to uninstall the RedHat yum, restart the installation, and configure other sources, the detailed process is as follows:
1. Delete the original Yum of RedHat.
Rpm-AQ | grep Yum | xargs rpm-e-nodeps
2. Download the yum Installation File
Wget http://mirrors.163.com/centos/6/ OS /x86_64/Packages/yum-3.2.27-14.el6.centos.noarch.rpm
Wget http://mirrors.163.com/centos/6/ OS /x86_64/Packages/yum-metadata-parser-1.1.2-14.1.el6.x86_64.rpm
Wget http://mirrors.163.com/centos/6/ OS /x86_64/Packages/yum-plugin-fastestmirror-1.1.26-11.el6.noarch.rpm
Wget http://mirrors.163.com/centos/6/ OS /x86_64/Packages/python-iniparse-0.3.1-2.1.el6.noarch.rpm
3. Install yum
Rpm-IVH python-iniparse-0.3.1-2.1.el6.noarch.rpm
Rpm-IVH yum-metadata-parser-1.1.2-14.1.el6.x86_64.rpm
Rpm-IVH yum-3.2.27-14.el6.centos.noarch.rpm yum-plugin-fastestmirror-1.1.26-11.el6.noarch.rpm
Note that the last two packages must be installed at the same time, otherwise they will depend on each other.
4. Update the repo File

MV/etc/yum. Repos. d/rhel-debuginfo.repo/etc/yum. Repos. d/rhel-debuginfo.repo.repo.bak

VI/etc/yum. Repos. d/rhel-debuginfo.repo

Content:

[Base]
Name = centos-$ releasever-Base
Baseurl = http://mirrors.163.com/centos/6.0/ OS /?basearch/
Gpgcheck = 1
Gpgkey = http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-6
# Released updates
[Updates]
Name = centos-$ releasever-Updates
Baseurl = http://mirrors.163.com/centos/6.0/updates/?basearch/
Gpgcheck = 1
Gpgkey = http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-6
# Packages used/produced in the build but not released
# [Addons]
# Name = centos-$ releasever-Addons
# Baseurl = http://mirrors.163.com/centos/?releasever/addons/?basearch/
# Gpgcheck = 1
# Gpgkey = http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-6
# Additional packages that may be useful
[Extras]
Name = centos-$ releasever-extras
Baseurl = http://mirrors.163.com/centos/6.0/extras/?basearch/
Gpgcheck = 1
Gpgkey = http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-6
# Additional packages that extend functionality of existing packages
[Centosplus]
Name = centos-$ releasever-plus
Baseurl = http://mirrors.163.com/centos/6.0/centosplus/?basearch/
Gpgcheck = 1
Enabled = 0

5. Yum clean all

6. Yum install Vim # Can I test it?

[Set the local image as the yum source]

1. mkdir/mnt/CDROM

2 Mount/dev/CDROM/mnt/CDROM # images and CDs are hung

3 mkdir/home/RedHat-ISO

4 cp-RF/mnt/CDROM/*/home/RedHat-ISO # copy the content in the CD to a specific path

5 VI/etc/yum. Repos. d/rhel-debuginfo.repo # edit repo File

Add the following content:

[Rhel_6_iso]
Name = Local ISO
Baseurl = file: // home/RedHat-ISO/
Gpgcheck = 1
Gpgkey = file: // home/RedHat-ISO/RPM-GPG-KEY-CentOS-6 # The gpgkey file here should be changed to the file name in the ISO Image

[About Yum]

I. What is yum?
Yum = yellow dog Updater, modified
The main function is to conveniently Add/delete/update RPM packages.
It automatically solves the dependency problem of the package.
It facilitates management of a large number of system update Problems

Ii. Yum features
* Multiple resource libraries (repository) can be configured simultaneously)
* Simple configuration file (files under/etc/yum. conf,/etc/yum. Repos. d)
* Automatically solves the dependency problem when RPM packages are added or deleted.
* Easy to use
* Maintain consistency with the RPM Database
Iii. Yum Installation
Centos/RHEL
1. # rpm-IVH yum-2.4.3-4.el4.centos.noarch.rpm
Iv. Yum Configuration
Yum configuration file
All configuration information of yum is stored in a configuration file named Yum. conf, which is usually located in the/etc directory. This is the top priority of the entire Yum system, so it is necessary to introduce it in detail. The following is a yum. Con file obtained from the Internet. Let's take this as an example to describe it.

[Main]
Cachedir =/var/Cache/yum
Debuglevel = 2
Logfile =/var/log/yum. Log
Pkgpolicy = newest
Distroverpkg = RedHat-release
Tolerant = 1
Exactarch = 1
Retries = 1
[Base]
Name = Fedora Core $ releasever-$ basearch-Base
Baseurl = http://download.atrpms.net/mirrors/fedoracore/?releasever/?basearch/ OS

Http://rpmfind.net/linux/fedora/cor... ER/$ basearch/OS

Http://developer.clarkson.edu/pub/dist... ER/$ basearch/OS

[Updates-released]
Name = Fedora Core $ releasever-$ basearch-released updates
Baseurl = http://download.atrpms.net/mirrors/fedoracore/updates/?releasever/?basearch

Http://redhat.linux.ee/pub/fedora/l... Sever/$ basearch

Http://fr2.rpmfind.net/linux/fedora... Sever/$ basearch

[Fedora. Us]
Name = fedora. US-$ basearch-extras
Baseurl = Signature
[Dag wieers]
Name = Dag RPM repository for Fedora Core
Baseurl = http://apt.sw.be/fedora/?releasever/en/?basearch/dag
[Livna]
Name = livna rpm, Fedora Core $ releasever-$ basearch
Baseurl = http://rpm.livna.org/fedora/?releasever/?basearch/rpms.stable
[Freshrpms]
Name = freshrpms
Baseurl = http://ayo.freshrpms.net/fedora/linux/?releasever/?basearch/freshrpms/

Http://ftp.us2.freshrpms.net/linux /... ARCH/freshrpms/

The first part (this is the global settings of yum. You do not need to change it by default .)
[Main]
Cachedir: directory of the yum cache, where Yum stores the downloaded RPM package and database, generally/var/Cache/yum.
Debuglevel: the debugging level. The value ranges from 0 to 10. The default value is 2.
Logfile: the log file of yum. The default value is/var/log/yum. log.
Pkgpolicy: the package policy. There are two options: Newest and last. If you set multiple repository and the same software exists in different repository, which one should Yum install, if it is newest, yum will install the latest version. If it is last, yum will sort the server IDs in alphabetical order and select the software installation on the last server. Generally, select newest.
Distroverpkg: Specifies a software package. Yum determines your release version based on this package. The default value is RedHat-release, or any installed RPM package for your own release.
Exactarch has two options: 1 and 0, indicating whether to upgrade only the same package as the CPU system of your installation package. If it is set to 1, if you have installed an i386 rpm, yum will not be upgraded with a 1686 package.
Retries: the number of retries after a network connection error occurs. If it is set to 0, it will retry infinitely.
Tolerent also has two options: 1 and 0, indicating whether Yum can tolerate errors related to software packages in command lines. For example, you need to install packages 1, 2, and 3, 3 of them have been installed before. If you set it to 1, yum will not have an error message. The default value is 0.
In addition to the above, there are some options that can be added, such
Exclude =, excluding some software from the upgrade list, you can use wildcards to separate each item in the list with spaces. This is especially useful for users who have installed Chinese patches such as beautification packages.
Gpgchkeck = there are two options: 1 and 0, which respectively indicate whether or not to perform GPG verification. If this option is not selected, it is also checked by default.
Part 2:
Configuring the repository server is the most exciting thing. With a good repository, just like opening a big store at the door, you just need something to run a little errands. By the way, this is a free big store.
All server settings should follow the following format:
1. [serverid]
2. Name = some name for this server
3. baseurl = URL: // path/to/Repository/
Serverid is used to distinguish different repository. It must have a unique name.
Name, which is a description of repository and supports variables such as $ releasever $ basearch;
Baseurl is the most important part in server settings. You can obtain software from it only when the settings are correct. The format is:
1. baseurl = URL: // server1/path/to/Repository/
2. url: // server2/path/to/Repository/
3. url: // server3/path/to/Repository/
The URL supports three protocols: http: // ftp: // file. After baseurl, it can be followed by multiple URLs. You can change it to an image site with a high speed, but there can only be one baseurl, that is, it cannot be in the following format:
1. baseurl = URL: // server1/path/to/Repository/
2. baseurl = URL: // server2/path/to/Repository/
3. baseurl = URL: // server3/path/to/Repository/
The directory to which the URL points must be the upper level of the Repository header directory. It also supports variables such as $ releasever $ basearch.
You can add multiple options after the URL, such as gpgcheck, exclude, and failovermethod. For example:
1. [updates-released]
2. Name = Fedora Core $ releasever-$ basearch-released updates
3. baseurl = http://download.atrpms.net/mirrors/fedoracore/updates/?releasever/?basearch
4. http://redhat.linux.ee/pub/fedora/linux/core/updates/?releasever/?basearch
5. http://fr2.rpmfind.net/linux/fedora/core/updates/?releasever/?basearch
6. gpgcheck = 1
7. Exclude = Gaim
8. failovermethod = Priority
The meaning of gpgcheck and exclude is the same as that of [main], but it only works for this server. failovermethode has two options: roundrobin and priority, meaning that multiple URLs are available, the order of Yum selection. roundrobin is a random selection. If the connection fails, use the next one, which loops in sequence. Priority starts from the first one according to the URL order. If not specified, the default value is roundrobin.
Several Variables
$ Releasever: the version of the release, which is obtained from distroverpkg in the [main] section. If not, the RedHat-release package is used for determination.
$ Arch, CPU system, such as i686 and athlon
$ Basearch: Basic CPU system group. For example, i686 and athlon belong to the same i386, and Alpha and alphaev6 belong to the same Alpha.
After setting yum. conf, we can enjoy the convenience of yum.
V. RHEL/centos Yum Source
1. modify the configuration file
2. Import the GPG key
Import the GPG key of each reposity. As mentioned earlier, yum can use GPG to verify the package to ensure the integrity of the downloaded package. Therefore, we need to find the GPG key at each repository site first, usually on the home page eye-catching location, some names such as RPM-GPG-KEY.txt plain text files, download them, and then use rpm-import xxx.txt command to import them, it is best to bring the release version of The GPG-KEY is also imported. Rpm-import/usr/share/doc/RedHat-release-*/on the RPM-GPG-KEY official software upgrade.
6. Expand your RPM package
1. rpmforge
The default Yum software repository for centos/RHEL is very limited. It is only limited to the regular packages and updates of some software packages in the released versions. Using rpmforge, many third-party RPM software packages can be added.
Obtain

Http://dag.wieers.com/rpm/packages/rpmforge-release/

Find the rpmforge package that matches the system platform architecture and install it. After installation, two files, mirrors-rpmforge and rpmforge. Repo, will be added under/etc/yum. Repos. d/of the system by default.
Install
1. # rpm-IVH rpmforge-release-0.3.6-1.el4.rf.i386.rpm
2. # rpm-import http://dag.wieers.com/rpm/packages/RPM-GPG-KEY.dag.txt
2. Accelerate the yum update speed
Installing the fast mirror plug-in of Yum can speed up centos/RHEL Yum and improve stability with remarkable results.
Centos5
1. # Yum-y install Yum-fastestmirror
Centos4
1. Yum-y install Yum-plugin-fastestmirror
VII. Use yum
Note: When the yum or yum resource library is updated for the first time, yum will automatically download all the required headers and place them in the/var/Cache/Yum Directory, which may take a long time.
System update (update all RPM packages that can be upgraded, including kernel)
1. # Yum-y update
Perform system updates on a regular basis every day
1. # chkconfig Yum on
2. # service Yum start
* Update the RPM package
Check the updatable RPM package
1. # Yum check-Update
Update all RPM packages
1. # Yum update
Update the specified RPM package, such as updating the kernel and kernel source
1. # Yum update kernel-Source
For large-scale version upgrades, unlike Yum update, the old obsolete package is also upgraded.
1. # Yum upgrade
* Installation and deletion of RPM packages
Install RPM packages like xmms-mp3
# Yum install xmms-mp3
Delete an RPM package, including packages that depend on the package
1. # Yum remove licq
Note: You will also be prompted to delete licq-gnome, licq-QT, and licq-text.
* Parameters related to Yum temporary storage (/var/Cache/Yum /)
Clear temporary RPM package files
1. # Yum clean packages
Clear temporary RPM header files
1. # Yum clean Headers
Clear the existing RPM header file
1. # Yum clean oldheaders
Clear existing RPM header files and package files
1. # Yum clean or # Yum clean all
Note: equivalent to Yum clean packages + Yum clean oldheaders
* RPM package list
List all RPM packages that can be installed or updated in the resource library
1. # Yum list
List specific rpm packages that can be installed, updated, and installed in the resource library
1. # Yum list Mozilla
2. # Yum list Mozilla *
Note: Match characters can be used in RPM package names, for example, to list all RPM packages starting with Mozilla
List all updates to the RPM package in the resource library
1. # Yum list updates
List all installed RPM packages
1. # Yum List Installed
List RPM packages installed but not included in the resource library
1. # Yum list extras
Note: download and install the RPM package from other websites
* RPM package information display (the info parameter is the same as the list)
Lists information about all RPM packages that can be installed or updated in the resource library.
1. # Yum info
Lists the specific information of RPM packages that can be installed or updated and installed in the resource library.
1. # Yum info Mozilla
2. # Yum info Mozilla *
Note: Match characters can be used in RPM package names, such as listing all RPM packages starting with Mozilla
Lists information about all the RPM packages that can be updated in the resource library.
1. # Yum info updates
Lists information about all installed RPM packages.
1. # Yum info installed
Lists the installed RPM packages that are not included in the resource library.
1. # Yum info extras
Note: Download the installed RPM package information from other websites.
* Search for an RPM package
Search for RPM packages matching specific characters
1. # Yum search Mozilla
Note: Search for RPM package names and package descriptions
Search for RPM packages with specific file names
1. # Yum provides realplay
VIII. Yum Common Problems
1. If the network speed is slow, you can increase the yum timeout time so that it will not always exit because of timeout.
1. # vi/etc/yum. conf
2. # Add this sentence
3. Timeout = 120
2. Yum existing lock error Solution
If Yum existing lock/var/run/yum. PID: Another copy is running as PID 3380. Aborting occurs when the system is started, you can use the following solution:
Method 1
1. etc/init. d/Yum-updatesd stop
Method 2
1. # rm-F/var/run/yum. PID
The main reason is that Yum is automatically updated. You only need to turn it off.

Yum source of centos6

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.