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 .
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.
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.
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 |
---|
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.
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 |
---|
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 |
---|
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 |
---|
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
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 |
---|
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 |
---|
Shell
1 | yum clean all |
---|
Shell
1 | yum update |
---|
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- |
---|
At this point, the source is added.
( adsbygoogle = window.adsbygoogle || []).push({});
Recommended Posts