Linux Yum installation




1. Uninstall the yum package installed by default in rhel.
View yum package
rpm -qa|grep yum
uninstalled
rpm -qa|grep yum|xargs rpm -e --nodeps

2. Download the new yum package for
64-bit linux system and download the installation package
wget http://centos.ustc.edu.cn/centos/5/os/x86_64/CentOS/yum-3.2.22-40.el5.centos.noarch.rpm
wget http://centos.ustc.edu.cn/ centos/5/os/x86_64/CentOS/yum-fastestmirror-1.1.16-21.el5.centos.noarch.rpm
wget http://centos.ustc.edu.cn/centos/5/os/x86_64/CentOS/ yum-metadata-parser-1.1.2-4.el5.x86_64.rpm
32-bit linux system download and installation package
wget http://centos.ustc.edu.cn/centos/5/os/i386/CentOS/yum-3.2 .22-40.el5.centos.noarch.rpm
wget http://centos.ustc.edu.cn/centos/5/os/i386/CentOS/yum-fastestmirror-1.1.16-21.el5.centos.noarch .rpm
wget http://centos.ustc.edu.cn/centos/5/os/i386/CentOS/yum-metadata-parser-1.1.2-4.el5.i386.rpm

Note: The installation package may be upgraded, the last The file name can be obtained by viewing the latest path, for example:
http://centos.ustc.edu.cn/centos/5/os/x86_64/CentOS/
http://centos.ustc.edu.cn/centos/5/ os/i386/CentOS/

and then install
rpm -ivh yum-*
Note: yum and yum-fastestmirror depend on each other, so they can be installed at the same time.
3. Download the yum configuration source
wget http://docs.linuxtone.org/soft/lemp/CentOS-Base.repo and download it to the /etc/yum.repos.d/ directory

4. Run yum makecache to generate the cache
--- -------------------------------------------------- ------------

Linux Yum installation has been widely used but is constantly updated, here is the introduction of Linux Yum installation settings to help you install and update the Linux Yum installation system. Linux itself is the core part of this operating system, that is, the kernel of the operating system. The kernel is the program that completes the most basic operations. It is responsible for the startup and termination of other programs (such as text editor programs), memory application processing, hard disk access, and network connection management. Linux Yum Commands

1. What is Linux Yum

yum = Yellow dog Updater, Modified
's main function is to add/remove/update RPM packages more easily.
It can automatically solve the dependency problem of packages. It can easily
manage the update problem of a large number of systems.
Note : Why use Linux Yum instead of apt , The simplest reason, Fedora comes

with 2. Linux Yum point

can configure multiple resource repositories (Repository) at the same time
The concise configuration file (/etc/yum.conf)
automatically solves the dependency problem encountered when adding or deleting rpm packages
Easy to use
Keep consistency with the RPM database

3. Linux Yum installation

Fedora comes with #rpm -ivh yum-2.0.4-2.noarch.rpm

4. Linux Yum configuration

Note : Modify and increase the resource library in the configuration file to speed up Download speed and have more updatable rpm
packages Replace all contents of /etc/yum.conf with
[main]
cachedir=/var/cache/yum
debuglevel=2
logfile=/var/log/yum.log
pkgpolicy=newest
distroverpkg=fedora-release
tolerant=1
exactarch=1
[fedora-us-1]
name=Fedora Core 1 -- Fedora US mirror
baseurl=ftp://mirrors.kernel.org/fedora.us/fedora/fedora/1/i386/yum/os
[fedora-us-1-updates]
name=Fedora Core 1 updates -- Fedora US mirror
baseurl=ftp://mirrors.kernel.org/fedora.us/fedora/fedora/1/i386/yum/updates
[fedora-us-1-stable]
name=Fedora Linux (stable) for Fedora Core 1 -- Fedora US mirror
baseurl=ftp://mirrors.kernel.org/fedora.us/fedora/fedora/1/i386/yum/stable
[freshrpms]
name=Fedora Linux $releasever - $basearch - freshrpms
baseurl=http://ayo.freshrpms.net/fedora/linux/$releasever/$basearch/freshrpms

五.Linux Yum安装应用

Note: When using Linux Yum for the first time to install or update the yum repository, Linux Yum will automatically download all the required headers and place them in the /var/cache/yum directory, which may take a long time. Check what are available The updated rpm package
#yum check-update
Linux Yum installs the rpm package so that xmms can play mp3
#yum install xmms-mp3
installs mplayer, and automatically installs related software
#yum install mplayer
deletes the licq package and deletes dependencies with the package Sexual package
#yum remove licq
Note: At the same time, it will prompt to delete licq-gnome, licq-qt, licq-text, which is very convenient
System update (update all rpm packages that can be upgraded, including kernel)
#yum -y update
executes the system regularly every day Update
#chkconfig yum on
#service yum start

6. Linux Yum instructions explain the update of rpm packages Check

for updateable rpm packages #yum check-update Update all rpm packages #yum update Update specified rpm packages, such as updating kernel and kernel source #yum update kernel kernel-source






Large-scale version upgrade, unlike yum update, even the old outdated packages are also upgraded
#yum upgrade
Linux Yum installation and deletion of rpm packages
Install rpm packages, such as xmms-mp3
#yum install xmms-mp3
Delete rpm packages, Include packages that are dependent on this package
#yum remove licq
Note: At the same time, you will be prompted to delete licq-gnome, licq-qt, licq-text
related parameters of yum temporary storage (/var/cache/yum/)
Clear the rpm in the temporary storage Package files
#yum clean packagesClear
rpm header files in temporary storage #yum clean
headersClear old rpm header files in temporary storage #yum clean oldheadersClear old rpm header files and package files in temporary storage #yum clean or #yum clean all Note: Equivalent to yum clean packages + yum clean oldheaders rpm package list List all rpm packages in the repository that can be installed or updated by Linux Yum #yum list List specific rpms in the repository that can be installed or updated by Linux Yum and installed Packages #yum list mozilla #yum list mozilla













Note: You can use matching characters in rpm package names, such as listing all rpm packages starting with mozilla, listing all rpm
packages that can be updated in the repository
#yum list updates ,
listing all rpm packages that have been installed by Linux Yum
#yum list installed
lists the rpm packages that have been installed but not included in the repository
#yum list extras
Note: Download the rpm packages installed by Linux Yum from other websites. The rpm
package information display (the info parameter is the same as list)
lists all available packages in the repository Information about installed or updated rpm packages
#yum info
Lists information about specific rpm packages that can be installed or updated and installed in the
repository #yum info mozilla
#yum info mozilla
Note: You can use matching characters in the rpm package name, For example, list the information of all rpm packages starting with mozilla
List of all rpm packages that can be updated in the repository
#yum info updates
List the information of all the rpm packages that have been installed
#yum info installed
List the installed but Information about rpm packages not included in the repository
#yum info extras
Note: Information about rpm packages downloaded and installed from other websites
Search for rpm packages
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 specific file names
#yum provides realplay

Seven. Linux Yum Safely update rpm packages from freshrpms.net

Install GPG key from freshrpms.net
# rpm --import http://freshrpms.net/packages/RPM-GPG-KEY.txt
Edit /etc/yum.conf, add the following information to the end
[freshrpms]
name=Fedora Linux $releasever - $basearch - freshrpms
baseurl= http://ayo.freshrpms.net/fedora/linux/$releasever/$basearch/freshrpms
gpgcheck=1
Note:
Check GPG Key
# rpm -qa gpg-pubkey
show Key information
#rpm -qi gpg-pubkey-e42d547b-3960bdf1
Delete Key
#rpm -e gpg-pubkey-e42d547b-3960bdf1

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=327053038&siteId=291194637