Linux Yum detailed

Source: Internet
Author: User


Solve the problem of RedHat self-bring yum not working


Because the installation of Redhat is a commercial version, usually because there is no registration, resulting in the Yum program can not be used, for learning Linux, install software what the various inconvenient, it is very distressed, in fact, the solution is not difficult, the specific following.


1. Uninstall Redhat's own yum first

Rpm-qa | grep Yum | Xargs rpm-e--nodeps




2. Download the relevant package

can go to the source of NetEase or other Web site, NetEase is more familiar with NetEase as an example

http://mirrors.163.com/

Taking Redhat 7 as an example to choose/centos/7/os/x86_64/packages/

Locate the following packages and download

yum-cron-3.4.3-132.el7.centos.0.1.noarch.rpm

yum-metadata-parser-1.1.4-10.el7.x86_64.rpm

yum-plugin-fastestmirror-1.1.31-34.el7.noarch.rpm




3. Install Yum

RPM-IVH yum-metadata-parser-1.1.4-10.el7.x86_64.rpm
RPM-IVH yum-cron-3.4.3-132.el7.centos.0.1.noarch.rpm yum-plugin-fastestmirror-1.1.31-34.el7.noarch.rpm

(Packages with dependencies to be loaded together)




4. Configure NetEase Source

Download Http://mirrors.163.com/.help/CentOS7-Base-163.repo

(In the/centos to the right of the CentOS use Help to select the corresponding version (only 5,6,7))

Put the downloaded repo file into the/etc/yum.repos.d/

Put all

baseurl=http://mirrors.163.com/centos/$releasave/extras/$basearch/

$releasave to the system version (5,6,7 only) $basearch represents the CPU architecture

(the path that is equivalent to the specified package)


Yum Update

Here it is OK. 650) this.width=650; "src=" Http://img.baidu.com/hi/jx2/j_0057.gif "alt=" J_0057.gif "/>




Building a yum Warehouse

Basic concepts:

To build a yum warehouse, you first create a file format that ends in. Repo under/etc/yum.repos.d/.

[] #[the ID of the repository must be unique Name= # name is the name of Yum and must be unique baseurl= #指定你访问到那些rpm包的路径gpgc heck= #默认为1, 1 means the check of the public key, when checking the public key to specify the Gpgkey address, 0 means not to check the enable= #默认为1, 1 means to enable this warehouse, 0 means to close



Build local yum repositories with CDs

Mount the disc to/mnt/cdrom and then create the. repo file under/etc/yum.repod.s/

Mount/dev/sr0/mnt/cdromcat >>/etc/yum.repos.d/iso.repo <<endf[iso]name=rhel-7.1 Server.x86_64baseurl= File:///mnt/cdromgpgcheck=0enable=1ENDF




Setting up a Yum repository outside the network

Cat >>/etc/yum.repos.d/sohu.repo <<endf[sohu]name=internet-centosbaseurl=http://mirrors.sohu.com/ centos/$releasever/os/$basearchgpgcheck =1 #需要检查公匙enable =1gpgkey=http://mirrors.sohu.com/centos/rpm-g Pg-key-centos-6endf




Build yourself a local yum warehouse

Download Createrepo and install the Createrepo will generate a Repodata software information warehouse (in the ISO also has repodata, no this file will not be able to get a good yum warehouse)

Put the downloaded RPM package in a directory such as/rpm_1

Createrepo/rpm_1

A repodata file is generated under/rpm_1

Create the appropriate. Repo file in/etc/yum.repos.d/

Cat >>/etc/yum.repos.d/rpm_1.repo <<endf[rpm_1]name=centos-rpm_1baseurl=file:///rpm_1gpgcheck= 0enable=1endfyum Install Rpm_1




Yum Repolist [All | enable | disable] View the number of Yum warehouses default display enabled warehouses

Yum provides is used to see which package generated a path.







This article is from the Linux Learning Notes blog, so be sure to keep this source http://10516823.blog.51cto.com/10506823/1751727

Linux Yum detailed

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.