CentOS 6 add common yum source to transfer

The official source of CentOS removes some copyright-related software, so I want to install these software or manually download and install, or use other sources. Below I recommend two commonly used sources, these two sources can basically meet the needs of general server use .

First, determine the system architecture and version before adding sources.

Check the system version:

Shell

1 lsb_release -a

This command has been installed on most hosts, and you will get the following display:
LSB Version: :core-3.1-ia32:core-3.1-noarch:graphics-3.1-ia32:graphics-3.1-noarch Distributor ID: CentOS Descripqion: CentOS release 5.3 (Final) Release: 5.3 Codename: Final

If lsb_release is not installed, you can also use the following command.

Shell

1 head -1 /etc/issue

You will get the following display:
CentOS release 6.3 (Final)

If it is a CentOS system, you can use the following commands directly:

Shell

1 rpm -q centos-release

You will get the following display:
centos-release-6-3.el6.centos.9.i686

After that, the system architecture must be determined.

Shell

1 uname -a

You will get the following display:
Linux jgh.localdomain 2.6.32-279.5.2.el6.i686 #1 SMP Thu Aug 23 22:16:48 UTC 2012 i686 i686 i386 GNU/Linux

i686, i386 are the architecture of this system.

Knowing the system version and architecture, you can find the corresponding file import in the source.

Here are a few sources, Remi, RPMforge, EPEL, CentALT, webtatic, [Nginx if you are VGYTHON_LHAYE), For the domestic host used, it is recommended to add domestic sources, such as Netease, Sohu, University of Science and Technology, China Mobile, etc.

Add Remi source##

The Remi source contains a lot of software, and its update speed is very fast. Many new versions of the software can be found here for the first time. Enter Remi official website, and find the Maintained Enterprise Linux (RHEL / CentOS / Other clones) item

Select the corresponding release file according to the system architecture

Shell

1 rpm -ivh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm

Add RPMforge source##

First go to the RPMforge website to find the usage help, here are the versions of different operating systems. Click CentOS wiki on the page to go to the CentOS official website (turn around and come back), follow the prompts to choose The corresponding operating system version, mine is CentOS 6, after clicking the jump, I saw the import link, there are two, i686 and x86_64 architecture. I choose i686.

Shell

1 rpm -ivh http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.2-2.el6.rf.i686.rpm

The source is added, you can also follow the instructions on the CentOS website to add step by step.

Add EPEL source##

Go to the website and scroll down, find the How can I use these extra packages? item, select EL6 according to the system architecture and version, click, the system will find the fastest source mirror according to the visiting ip, and the domestic visit will usually go to the source of Sohu and the University of Science and Technology. If you want to use the US source, you must use proxy access, mine returns http://dl.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm

Shell

1 rpm -ivh http://dl.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm

Add CentALT source##

Enter the website and find Ссылки in the category on the right. Although it’s in Russian, it doesn’t hurt us. Hehe, in fact, I learned Russian when I was a student, but I’m all back to the teacher. Khan... Go to Репозиторий для CentOS 6, this is the library of CentOS 6, if you are CentOS 5, then choose the last one, if you want to find it in the list by yourself, click Просмотр репозитория CentALT.

Click Репозиторий для CentOS 6 to view the content, drag it down, and find the paragraph Установка репозитория, and then you should understand the content below. Here are a few links to the rpm package. First, the source of EPEL is given. , And then give your own ALT. Find the import you need. ok.

Shell

1 rpm -ivh http://centos.alt.ru/pub/repository/centos/6/i386/centalt-release-6-1.noarch.rpm

Add php source##

Go to webtatic.com, find the CentOS/RHEL 6 source and add it.

Shell

1 rpm -Uvh http://mirror.webtatic.com/yum/el6/latest.rpm

Add Nginx source##

Enter Nginx official website, click the download link on the right, and drag to the bottom to find the Pre-Built Packages item. Click the mainline version version link. Edit the repo file according to the prompts The specific operations are as follows.
Create a new nginx.repo file in the yum repo directory

Shell

1 vi /etc/yum.repos.d/nginx.repo

Enter the following

Shell

1 2 3 4 5 [ nginx] name=nginx repo baseurl=http://nginx.org/packages/mainline/centos/6/$basearch/ gpgcheck=0 enabled=1

Save and exit

Add domestic mirror source##

Add NetEase 163 source##

Visit http://mirrors.163.com/
Find the CentOS system, click centos help on the right
Find CentOS 7 item, copy the link address

Enter the system yum directory, download the repo file

1 2 3 cd /etc/yum.repos.d wget http://mirrors.163.com/.help/CentOS7-Base-163.repo yum update

Add Ali source##

Visit http://mirrors.aliyun.com/
Find the CentOS system, click help on the right
Follow the prompts to download the repo file of the CentOS 7 item, and be careful not to copy its commands directly, which will overwrite the official source.

1 2 wget http://mirrors.aliyun.com/repo/Centos-7.repo yum update

Update yum after adding source

Shell

1 yum clean all

Shell

1 yum update

Finally, you need to set the source management strategy##

If you prefer to install software from a certain source first, then it is recommended to install the yum-priorities plugin##

The function of this plugin is to prioritize multiple sources. When the same software exists in multiple sources, the software will be installed from the source with the highest priority.

Shell

1 yum install yum-priorities

After installation, you need to set the .repo related files (such as CentOS-Base.repo) in the /etc/yum.repos.d/ directory, and insert the order instruction in these files: priority=N (N is a positive integer from 1 to 99 , The smaller the value, the more priority), for example:

Shell

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 [ base] name=CentOS-releasever – Base mirrorlist=http://mirrorlist.CentOS.org/?release=releasever&arch=basearch&repo=os #baseurl=http://mirror.CentOS.org/CentOS/releasever/os/basearch/ gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5 priority=1   #released updates [updates] name=CentOS-releasever – Updates mirrorlist=http://mirrorlist.CentOS.org/?release=releasever&arch=basearch&repo=updates #baseurl=http://mirror.CentOS.org/CentOS/releasever/updates/basearch/ gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5 priority=1

At this point, the source is added.

( adsbygoogle = window.adsbygoogle || []).push({});

Recommended Posts

CentOS 6 add common yum source to transfer
CentOS 5 to CentOS 5.8 YUM source
How to add swap on CentOS 7
CentOS7 repairs python to save yum
Centos8 uses yum to install mongodb 4.2 method
Centos7 uses yum to install pip, ipython
Centos8 use yum to install rabbitmq tutorial
CentOS7 system yum way to install MySQL5.7
A brief introduction to yum source configuration and nmcli commands under CentOS8
How to add Apt software source on Ubuntu
CentOS8 detailed tutorial for configuring local yum source
How to install openssh from centos 7 source code
How to add and delete users on CentOS 8
Centos7 YUM install MariaDB 10.0
Centos 6.4 python 2.6 upgrade to 2.7
Centos 6.4 python 2.6 upgrade to 2.7
CentOS server deployment (YUM)
Centos source installation Python3
CentOS 7.2 Yum install MySQL 5.6
CentOS6.5 upgrade kernel to 3.10.28
Centos7 YUM install MariaDB 10.0