Cài đặt EPEL và REMI Repo trên CentOS 7/6/5


EPEL (Extra Packages for Enterprise Linux) là một dự án repository từ Fedora team cung cấp rất nhiều gói add-on package mà chúng ta thường dùng cho các bản Linux bao gồm CentOS, RHEL (Red Hat Enterprise Linux) và Scientific Linux.

Tương tự như EPEL, REMI repository cũng là một repo miễn phí được sử dụng phổ biến. Repo này được tạo và duy trì bởi một người Pháp tên là Remi Collect.

Cài đặt EPEL Repo trên CentOS 7/6/5

Cách 1

Cách này nên dùng, nếu không được hãy chuyển qua cách số 2. Để cài đặt bạn chỉ cần dùng dòng lệnh sau trên tất cả các bản CentOS:

yum install epel-release

Sau đó chọn y (yes) 2 lần rồi Enter là thành công.

Cách 2

Với cách này, bạn hãy chọn lệnh tương ứng với từng phiên bản CentOS.

EPEL trên CentOS 7 64 Bit

## CentOS/RHEL 7 64-Bit ##
rpm -Uvh http://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-5.noarch.rpm

EPEL trên CenOS 6 32-64 Bit

## CentOS/RHEL 6 32 Bit (i386) ##
rpm -Uvh http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
 
## CentOS/RHEL 6 64 Bit x86_64) ##
rpm -Uvh http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm

EPEL trên CenOS 5 32-64 Bit

## CentOS/RHEL 5 32 Bit (i386) ##
rpm -Uvh http://dl.fedoraproject.org/pub/epel/5/i386/epel-release-5-4.noarch.rpm
 
## CentOS/RHEL 5 64 Bit (x86_64) ##
rpm -Uvh http://dl.fedoraproject.org/pub/epel/5/x86_64/epel-release-5-4.noarch.rpm

Cài đặt REMI Repo trên CentOS 7/6/5

REMI trên CentOS 7

## CentOS/RHEL 7 ##
rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-7.rpm

REMI trên CenOS 6

## CentOS/RHEL 6 ##
rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm

REMI trên CenOS 5

## CentOS/RHEL 5 ##
rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-5.rpm

Sử dụng REMI repository

– Thông thường mình thêm tham số --enablerepo sau lệnh yum khi cần sử dụng, bạn có thể thấy trong các bài viết hướng dẫn trên blog, ví dụ như:

## PHP 5.6 ##
yum --enablerepo=remi,remi-php56 install php-opcache

## PHP 5.5 ##
yum --enablerepo=remi,remi-php55 install php-opcache

– Nếu bạn muốn enable REMI repo để không cần phải thêm tham số, hãy chỉnh sửa file config:

nano /etc/yum.repos.d/remi.repo

rồi thay đổi giá trị enabled=0 thành enabled=1 ta được

name=Les RPM de remi pour Enterprise Linux 6 - $basearch
#baseurl=http://rpms.famillecollet.com/enterprise/6/remi/$basearch/
mirrorlist=http://rpms.famillecollet.com/enterprise/6/remi/mirror
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-remi

Kiểm tra các Repo đang được enable

Sau khi đã cài đặt và enable EPEL và REMI repo, các bạn có thể kiểm tra lại các repo đang được enable bằng lệnh:

yum repolist

Nếu không có vấn đề gì sẽ được kết quả như sau:

repolist

Kiểm tra các repo đang được disable bằng lệnh:

yum repolist disabled

Chúc bạn thực hiện thành công!



Article ID: 19
Created On: Sat, Feb 27, 2016 at 3:02 PM
Last Updated On: Sun, Feb 28, 2016 at 4:15 PM
Authored by: Đặng Văn Kiên [info@vinastar.net]

Online URL: https://doc.vinastar.net/article.php?id=19