How Linux yum source of replacement RedHat7

Currently, our common system is probably Windows, Linux and the Mac OS. Windows systems should be a system that most people first came into contact with, after all, Windows system very convenient to use, only need little mouse, plus will simply typing, general watching videos, listening to music, the Internet is not the problem. Pursuit of the perfect user experience may be more like the Mac OS system, compared with Windows systems, Mac OS user interface more gorgeous, the design is very user-friendly, user experience will be much better. As for Linux, mainly installed on the server, most people basically not come into contact with, but for operation and maintenance, the developer, is an operating system may have to grasp.

Of course, with the development of information technology to improve the quality of the people, more and more people begin to understand Linux and try to use Linux, Linux is gradually coming into everyone's attention. Like Ubuntu, Debian, CentOS Linux and other systems because it had relatively user-friendly desktop and Windows-like design and are well known in man, most beginners will be installed above the basic system to experience the so-called Linux system, if you have a Linux system some interested, you can go and see "Linux in respect of such a study," this book is a good introductory Linux books.

 

Today, I am here to brief you on how to replace the yum source RedHat7. The reason for choosing RedHat is simple: 1, RedHat is owned by Red Hat, Inc. (the world's largest open source technology vendors); 2,, RedHat is within the world's most widely used Linux system. 3, RedHat system with a strong performance and stability, and has a sound technical support on a global scale. Of course, if you want to enjoy Red Hat's technical support, it should be charged, if you do not support her, and that little to change, you can make free use RedHat system, while this change is to replace the yum source.

If you are a new RedHat7, login system is installed using yum update to update your system, you will get the following tips:

This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.

(Replaced by a little simple words, it is this: Come registered, you do not register, do not give you use.)

Because the default comes with RedHat yum sources need to register in order to update, and we do not want to spend money can also be updated, it can only replace a RedHat yum source, here'll tell you about if you replace the RedHat yum source.

 

The first step: Check whether the installation yum package.

First, you can use rpm -qa | grep yum command to see if the yum install RHEL, if installed, will show that the yum package installed on the system:

[root@linuxprobe ~]# rpm -qa | grep yum

yum-utils-1.1.31-24.el7.noarch

yum-langpacks-0.4.2-3.el7.noarch

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

yum-rhn-plugin-2.0.1-4.el7.noarch

PackageKit-yum-0.8.9-11.el7.x86_64

yum-3.4.3-118.el7.noarch

Step two: Uninstall redhat comes yum package.

[root@linuxprobe ~]# rpm -e yum-3.4.3-118.el7.noarch --nodeps

[root@linuxprobe ~]# rpm -e yum-utils-1.1.31-24.el7.noarch --nodeps

[root@linuxprobe ~]# rpm -e yum-rhn-plugin-2.0.1-4.el7.noarch --nodeps

[root@linuxprobe ~]# rpm -e yum-metadata-parser-1.1.4-10.el7.x86_64 --nodeps

[root@linuxprobe ~]# rpm -e yum-langpacks-0.4.2-3.el7.noarch --nodeps

[root@linuxprobe ~]# rpm -e PackageKit-yum-0.8.9-11.el7.x86_64 --nodeps

After the uninstall is complete, then the command rpm -qa | grep yum check whether they have the uninstall is complete, if the input command, said it had no information to display the uninstall is complete:

[root@ linuxprobe ~]# rpm -qa |grep yum

[root@ linuxprobe ~]# 

The third step . Yum to download new software package.

General may enter the site above to view the package version is updated or find their own version of the package system corresponding to the update;

163 Source Network Address: http: //mirrors.163.com/

CentOS network source address: http: //centos.ustc.edu.cn/centos/

Find you need to download version:

[root@Linuxprobe ~]# wget http://mirrors.163.com/centos/7/os/x86_64/Packages/yum-3.4.3-118.el7.centos.noarch.rpm

--2016-01-17 20:43:15--  http://mirrors.163.com/centos/7/os/x86_64/Packages/yum-3.4.3-118.el7.centos.noarch.rpm

Resolving mirrors.163.com (mirrors.163.com)... 123.58.173.185, 123.58.173.186

Connecting to mirrors.163.com (mirrors.163.com)|123.58.173.185|:80... connected.

HTTP request sent, awaiting response... 404 Not Found

2016-01-17 20:43:15 ERROR 404:. Not Found // If not, is to install the update package, you can go to this website http://mirrors.163.com/centos/7/os/ x86_64 / Packages / copy the download link, and then download it;

 

[root@linuxprobe ~]# wget http://mirrors.163.com/centos/7/os/x86_64/Packages/yum-3.4.3-132.el7.centos.0.1.noarch.rpm

[root@linuxprobe ~]# wget http://mirrors.163.com/centos/7/os/x86_64/Packages/yum-metadata-parser-1.1.4-10.el7.x86_64.rpm

[root@linuxprobe ~]# wget http://mirrors.163.com/centos/7/os/x86_64/Packages/yum-utils-1.1.31-34.el7.noarch.rpm

[root@linuxprobe ~]# wget http://mirrors.163.com/centos/7/os/x86_64/Packages/yum-updateonboot-1.1.31-34.el7.noarch.rpm

[root@linuxprobe ~]# wget http://mirrors.163.com/centos/7/os/x86_64/Packages/yum-plugin-fastestmirror-1.1.31-34.el7.noarch.rpm

The fourth step, install the yum package.

Note: a single installation package may depend on other packages (e.g. yum and yum-fastestmirror be interdependent), so we can put together all of these packages, with a single command to install them:

[root@Linuxprobe ~]# rpm -ivh yum-*

warning: yum-3.4.3-132.el7.centos.0.1.noarch.rpm: Header V3 RSA/SHA256 Signature, key ID f4a80eb5: NOKEY

Preparing...                          ################################# [100%]

Updating / installing...

1:yum-metadata-parser-1.1.4-10.el7    ################################# [ 20%]

2:yum-plugin-fastestmirror-1.1.31-3   ################################# [ 40%]

3:yum-3.4.3-132.el7.centos.0.1        ################################# [ 60%]

4:yum-updateonboot-1.1.31-34.el7      ################################# [ 80%]

5:yum-utils-1.1.31-34.el7             ################################# [100%]

The fifth step, the new repo configuration file.

[root@linuxprobe ~]# vim /etc/yum.repos.d/CentOS-Base.repo

#CentOS-Base.repo

#

# The mirror system uses the connecting IP address of the client and the

# update status of each mirror to pick mirrors that are updated to and

# geographically close to the client.  You should use this for CentOS updates

# unless you are manually picking other mirrors.

#

# If the mirrorlist= does not work for you, as a fall back you can try the

# remarked out baseurl= line instead.

#

#

[base]

name=CentOS-$7 - Base - 163.com

#mirrorlist=http://mirrorlist.centos.org/?release=$7&arch=$basearch&repo=os

baseurl = http: //mirrors.163.com/centos/7/os/$basearch/

gpgcheck=1

gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-7

 

#released updates

[updates]

name=CentOS-$7 - Updates - 163.com

#mirrorlist=http://mirrorlist.centos.org/?release=$7&arch=$basearch&repo=updates

baseurl=http://mirrors.163.com/centos/7/updates/$basearch/

gpgcheck=1

gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-7

 

#additional packages that may be useful

[extras]

name=CentOS-$7 - Extras - 163.com

#mirrorlist=http://mirrorlist.centos.org/?release=$7&arch=$basearch&repo=extras

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

gpgcheck=1

gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-7

 

#additional packages that extend functionality of existing packages

[centosplus]

name=CentOS-$7 - Plus - 163.com

baseurl = http: //mirrors.163.com/centos/7/centosplus/$basearch/

gpgcheck=1

enabled=0

gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-7

 

Step Six: run yum makecache command to generate the cache.

 

[root@linuxprobe ~]# yum clean all

[root@linuxprobe ~]# yum makecache
[root@linuxprobe ~]# yum update

 

After these six steps, the new source yum installation has been completed, we can use yum install command to test whether the normal installation:

 

[root@Linuxprobe ~]# yum -y install lftp

Loaded plugins: fastestmirror, product-id, subscription-manager

This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.

Loading mirror speeds from cached hostfile

Resolving Dependencies

--> Running transaction check

---> Package lftp.x86_64 0:4.4.8-7.el7 will be installed

--> Finished Dependency Resolution

Dependencies Resolved

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

Package              Arch                     Version                    Repository               Size

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

Installing:

lftp                x86_64                    4.4.8-7.el7                base                     750 k

Transaction Summary

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

 

Install  1 Package

.................. .................. omitted part of the installation process

Installed:

lftp.x86_64 0:4.4.8-7.el7

Complete!

 

    Here, a new yum source installation has been completed, and after that we can use yum command pleasant to use RedHat system, and without having to worry about problems with the registration prompt can not be updated.

Guess you like

Origin www.cnblogs.com/it-artical/p/11014189.html