Tag:play rhel last new Acceleration location includes policy repos
1. Delete Redhat's original Yum
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 um-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
The contents are:
[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 and 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 could 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 #测试一下可不可以用
"Set local image as Yum source"
1, Mkdir/mnt/cdrom
2 Mount/dev/cdrom/mnt/cdrom #挂着镜像, CD
3 Mkdir/home/redhat-iso
4 cp-rf/mnt/cdrom/*/home/redhat-iso #将光盘内的内容copy到某个路径下
5 Vi/etc/yum.repos.d/rhel-debuginfo.repo #编辑repo文件
Add a little bit of content:
[Rhel_6_iso]
Name=local ISO
baseurl=file:///home/redhat-iso/
Gpgcheck=1
Gpgkey=file:///home/redhat-iso/rpm-gpg-key-centos-6 #该处的gpgkey文件应该改成iso镜像中的文件名
"A bit of information on Yum"
First,what is Yum
Yum = Yellow Dog Updater, Modified
The main function is more convenient to add/remove/update RPM packages.
It can automatically solve the dependency problem of the package.
It makes it easy to manage a large number of system update issues
Ii. Features of Yum
* Multiple repositories can be configured at the same time (Repository)
* Concise configuration file (file under/ETC/YUM.CONF,/ETC/YUM.REPOS.D)
* Automatic resolution of dependency issues encountered when adding or removing RPM packages
* Easy to use
* Maintain consistency with RPM database
Third, yum installation
centos/RHEL
1. #rpm-IVH yum-2.4.3-4.el4.centos.noarch.rpm
Four, yum configuration
Yum configuration file
All of the configuration information for Yum is stored in a configuration file called yum.conf, usually located in the/etc directory, which is the priority of the entire Yum system, so it is necessary to describe it in detail. Here is a Yum.con file from the Internet, let us take this as an example, to illustrate.
[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://mirror.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=http://fedora.linux.duke.edu/fedorax86_64/fedora.us/$releasever/$basearch/rpms.stable
[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 setting for Yum.) The default is usually not changed. )
[Main]
Cachedir:yum cache directory, yum stores downloaded RPM packages and databases, typically/var/cache/yum.
DebugLevel: Debug level, 0-10, default is 2.
Logfile:yum'sLog file, which is/var/log/yum.log by default.
Pkgpolicy: The policy for the package. A total of two options, newest and last, this function is if you set up multiple repository, and the sameThe software exists at the same time in different repository, which should be installed by Yum, and Yum will install the latest version if it is newest. If it is last, Yum will sort the server ID alphabetically and select theSoftware Installation. Newest is generally chosen.
DISTROVERPKG: Specify a package, Yum will determine your distribution based on this package, default is Redhat-release, it can also be installed in any of the RPM package for its own release version.
Exactarch, there are two options 1 and 0, which represents whether to upgrade only the packages that are consistent with your installation of the package CPU, and if set to 1, if you install a i386 rpm, Yum will not upgrade with a 1686 package.
Retries,The number of retries after a network connection error has occurred, and if set to 0, it will be retried indefinitely.
Tolerent, there are also 1 and 2 options that indicate whether Yum tolerates a package-related error on the command line, such as installing a three-by-five package, where 3 has already been installed, and if you set it to 1, Yum will not have an error message. The default is 0.
In addition to the above, there are some options that you can add, such as
Exclude=, excluding some software in the upgrade list, you can use wildcards, the list of items to be separated by a space, which is installed such as beautify the package, Chinese patches of friends especially useful.
The gpgchkeck= has 1 and 2 choices, which represent whether or not GPG verification is performed, and if not, the default seems to be checked.
Part II:
Configure the repository server, this is the most exciting, with a good repository, such as the door opened a large shopping malls, to what a little run errands on the line, this is a free hypermarket.
All server settings should follow the following format:
1. [ServerID]
2. Name=some name for this server
3. baseurl=url://path/to/repository/
Where ServerID is used to differentiate between different repository, there must be a unique name.
Name, which is a description of repository, supports variables such as the $releasever $basearch;
BaseURL is the most important part of the server Setup and is only set correctly to get the software from above. Its format is:
1. baseurl=url://server1/path/to/repository/
2. url://server2/path/to/repository/
3. url://server3/path/to/repository/
Where the URL supports the protocol has http:/ftp://file://three kinds. After BaseURL can be followed by multiple URLs, you can change to a faster mirror station, but BaseURL can only have one, that is, not like 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 where the URL points to must be the upper level of the Repository header directory, and it also supports variables such as $releasever $basearch.
You can add multiple options after the URL, such as Gpgcheck, Exclude, Failovermethod, and so on, such as:
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
Where the meaning of gpgcheck,exclude is the same as the [main] section, but only for this server, Failovermethode has two options roundrobin and priority, which means that when there are multiple URLs to choose from, Yum chooses the order, The Roundrobin is randomly selected, and if the connection fails, the next is used, looping sequentially, and priority starts with the first order of the URL. If not specified, the default is Roundrobin.
Several variables
$releasever, the release version, obtained from the [main] section of distroverpkg, if not, according to the Redhat-release package.
$arch, CPU system, such as I686,athlon, etc.
$basearch, the basic system groups of CPUs, such as i686 and Athlon, belong to the same genus I386,alpha and Alphaev6 Alpha.
With the yum.conf set up, we can enjoy the convenience of Yum.
V. Rhel/centos's Yum Source
1. Modify the configuration file
2. Import GPG KEY
Import each reposity GPG key, previously said, Yum can use GPG to verify the package, to ensure the integrity of the download package, so we have to go to each repository site to find GPG key, will generally be placed on the homepage of the eye-catching position, some names such as Rpm-gpg-key.txt such as plain text files, download them, and then use the RPM--import xxx.txt command to import them, it is best to bring the release of Gpg-key also imported. RPM--import/usr/share/doc/redhat-release-*/rpm-gpg-key official software upgrades are available.
VI. Expand your RPM Package
1, Rpmforge
Centos/rhel The default Yum repositories are very limited and are limited to regular packages and updates to some packages in the release version, and with Rpmforge, you can add very many third-party RPM packages.
Get
http://dag.wieers.com/rpm/packages/rpmforge-release/
Locate the Rpmforge package installed that matches the system platform architecture. After installation. The default is to add two files to the system's/etc/yum.repos.d/, Mirrors-rpmforge and Rpmforge.repo
Installation
# RPM-IVH rpmforge-release-0.3.6-1.el4.rf.i386.rpm
# RPM--import Http://dag.wieers.com/rpm/packages/RPM-GPG-KEY.dag.txt
2. Speed up Yum update
Install Yum's fast mirror plug-in to speed up Centos/rhel yum and improve stability with significant results.
Centos5
#yum-y Install Yum-fastestmirror
Centos4
Yum-y Install Yum-plugin-fastestmirror
Vii. Use of Yum
Note: When using the Yum or Yum repositories for the first time, Yum will automatically download all required headers placed in the/var/cache/yum directory, which may take a long time.
System Update (update all RPM packages that can be upgraded, including kernel)
#yum-y Update
Perform periodic system updates daily
#chkconfig Yum on
#service Yum Start
*RPM package updates, check for updatable RPM packages
#yum check-update
Update all RPM Packages
#yum Update
Update specified RPM packages, such as update kernel and kernel source
#yum Update Kernel Kernel-source
A large-scale version upgrade, unlike Yum Update, even the old obsolete package is upgraded
#yum Upgrade
Installation and removal of *rpm packages
Install RPM packages, such as Xmms-mp3
#yum Install Xmms-mp3
Remove RPM packages, including packages that are dependent on the package
#yum Remove Licq
Note: You will also be prompted to delete Licq-gnome,licq-qt,licq-text
Parameters of *yum staging (/var/cache/yum/)
Clear the Staging RPM package file
#yum Clean Packages
Purge the RPM header files in the staging
#yum Clean Headers
Clear the old RPM header files in the staging
#yum Clean Oldheaders
Purge old RPM header files and package files in staging
#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 repository
#yum List
Lists the specific RPM packages that can be installed or updated and installed in the repository
#yum list Mozilla
#yum List mozilla*
Note: You can use a match in the RPM package name, such as listing all RPM packages that start with Mozilla
List all RPM packages that can be updated in the repository
#yum list Updates
List all RPM packages that have been installed
#yum List installed
List RPM packages that have been installed but are not included in the repository
#yum List Extras
Note: Download the installed RPM package from 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
Lists the specific information in the repository that can be installed or updated and the RPM packages that have been installed
#yum info Mozilla
#yum Info mozilla*
Note: You can use a match in the RPM package name, such as listing all the RPM packages that start with Mozilla
List information about all RPM packages that can be updated in the repository
#yum Info Updates
List all the RPM packages that have been installed
#yum Info installed
Lists information about the RPM packages that have been installed but are not included in the repository
#yum Info Extras
Note: Download the installed RPM package information from other websites
* Search RPM Package
Search for RPM packages that match specific characters
#yum search Mozilla
Note: Search in RPM Package name, package description, etc.
Search for RPM packages with a specific file name
#yum provides Realplay
Eight, yum common problem solving
1. If the network speed is slow, you can increase the Yum time-out, so that it does not always exit because of timeouts.
#vi/etc/yum.conf
#加上这么一句
timeout=120
2. Yum Existing Lock Error Resolution
If the system starts, Yum appears existing Lock/var/run/yum.pid:another copy is running as PID 3380. Aborting. You can use the following method to solve:
Method One
Etc/init.d/yum-updatesd stop
Method Two
#rm-F/var/run/yum.pid
The main reason is that Yum is automatically updated, as long as you turn it off.
First install the Fastestmirror, let the system yum automatically select the fastest image:
#yum Install Yum-fastestmirror-y
Next talk about Rpmforge.
Rpmforge is a secure, stable, and timely software repository that can be installed by Rpmforge, which is a choice for CentOS when it comes to yum update, sometimes even the only option, For example, if you want to upgrade rsync to version 3.0.x, if you don't bother compiling the installation yourself, you have to rely on rpmforge.
1, first install priority this Yum plug-in, the plug-in used to set the software when installing software warehouse priorities, generally by default, first installed from the official base or mirror, and then from the Community user contribute software installed, and then from the third-party software warehouse installation.
#yum Install Yum-priorities
2, manually edit the/etc/yum.repos.d/directory suffix. Repos files to set the Software warehouse priority
Priority=n (N is an integer, range from 1-99, the smaller the number represents the higher the priority)
The official recommended configuration is
[Base], [addons], [updates], [extras] these parts priority=1
[Centosplus],[contrib] These parts priority=2
Third party Repos such as Rpmforge ... priority=n (where N is > based on your preference)
3, now start to install Rpmforge software Warehouse
Download the Rpmforge installation package first
i386 wget http://apt.sw.be/redhat/el5/en/i386/RPMS.dag/rpmforge-release-0.3.6-1.el5.rf.i386.rpm
x86_64 wget http://apt.sw.be/redhat/el5/en/x86_64/RPMS.dag/rpmforge-release-0.3.6-1.el5.rf.x86_64.rpm
Installation
Rpm-i rpmforge-release-0.3.6-1.el5.rf.*.rpm
Change the/etc/yum.repos.d/rpmforge.repo configuration file, add
Priority=1 (or 2.3.4 ...)
You can now use the Rpmforge software repository. For example, yum update rsync, hehe, successfully upgraded to 3.0.5.
Yum installation Configuration