Tuesday, December 6, 2011

Red Hat Enterprise Linux / CentOS Linux Enable EPEL (Extra Packages for Enterprise Linux) Repository

Nguồn: http://www.cyberciti.biz/faq/rhel-fedora-centos-linux-enable-epel-repo/

Q. How do I enable EPEL (Extra Packages for Enterprise Linux) repo and install the packages under RHEL / CentOS Linux?

A. EPEL (Extra Packages for Enterprise Linux) is a volunteer-based community effort from the Fedora project to create a repository of high-quality add-on packages that complement the Fedora-based Red Hat Enterprise Linux (RHEL) and its compatible spinoffs, such as CentOS and Scientific Linux.

EPEL provide lots of packages for CentOS / RHEL, It is not part of RedHat or CentOS but is designed to work with these major distributions. Please note that EPEL only provides free and open source software unencumbered by patents or any legal issues. In short you will not find mp3, dvd and music / media player under EPEL. However, you will find many programs related to networking, monitoring, sys admin, programming and so on.

Packages are supplied in RPM format and in most cases are ready to use. Beware that some packages may break something and you should not blindly install those packages.

How do I enable EPEL?

Simply type the following command as root user:
# rpm -Uvh http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-3.noarch.rpm
List new repo:
# yum repolist
Sample output:

Loading "skip-broken" plugin
Loading "fastestmirror" plugin
repo id repo name status
addons CentOS-5 - Addons enabled
base CentOS-5 - Base enabled
epel Extra Packages for Enterprise Linux 5 - enabled
extras CentOS-5 - Extras enabled
updates CentOS-5 - Updates enabled

Once installed use yum command to list, view and install the packages:
# yum search package-name
# yum install package-name

See how to use yum command for installing and searching packages using various repos.

Yum command: Update / Install Packages Under Redhat Enterprise / CentOS Linux Version 5.x

How do I use yum command to update and patch my Red hat Enterprise Linux / CentOS Linux version 5.x server via RHN / Internet? Can I use up2date command under RHEL 5?

up2date command was part of RHEL v4.x or older version. You need to use yum command to update and patch the system using RHN or Internet. Use yum command to install critical and non-critical security updates as well as binary packages. Login as the root user to install and update the system.

Task: Register my system with RHN

To register your system with RHN type the following command and just follow on screen instructions (CentOS user skip to next step):
# rhn_register

WARNING! These examples only works with RHEL / CentOS Linux version 5.x or above. For RHEL 4.x and older version use up2date command.

Task: Display list of updated software (security fix)

Type the following command at shell prompt:
# yum list updates

Task: Patch up system by applying all updates

To download and install all updates type the following command:
# yum update

Task: List all installed packages

List all installed packages, enter:
# rpm -qa
# yum list installed

Find out if httpd package installed or not, enter:
# rpm -qa | grep httpd*
# yum list installed httpd

Task: Check for and update specified packages

# yum update {package-name-1}
To check for and update httpd package, enter:
# yum update httpd

Task: Search for packages by name

Search httpd and all matching perl packages, enter:
# yum list {package-name}
# yum list {regex}
# yum list httpd
# yum list perl*

Sample output:

Loading "installonlyn" plugin
Loading "security" plugin
Setting up repositories
Reading repository metadata in from local files
Installed Packages
perl.i386 4:5.8.8-10.el5_0.2 installed
perl-Archive-Tar.noarch 1.30-1.fc6 installed
perl-BSD-Resource.i386 1.28-1.fc6.1 installed
perl-Compress-Zlib.i386 1.42-1.fc6 installed
perl-DBD-MySQL.i386 3.0007-1.fc6 installed
perl-DBI.i386 1.52-1.fc6 installed
perl-Digest-HMAC.noarch 1.01-15 installed
perl-Digest-SHA1.i386 2.11-1.2.1 installed
perl-HTML-Parser.i386 3.55-1.fc6 installed
.....
.......
..
perl-libxml-perl.noarch 0.08-1.2.1 base
perl-suidperl.i386 4:5.8.8-10.el5_0.2 updates

Task: Install the specified packages [ RPM(s) ]

Install package called httpd:
# yum install {package-name-1} {package-name-2}
# yum install httpd

Task: Remove / Uninstall the specified packages [ RPM(s) ]

Remove package called httpd, enter:
# yum remove {package-name-1} {package-name-2}
# yum remove httpd

Task: Display the list of available packages

# yum list all

Task: Display list of group software

Type the following command:
# yum grouplist
Output:

Installed Groups:
Engineering and Scientific
MySQL Database
Editors
System Tools
Text-based Internet
Legacy Network Server
DNS Name Server
Dialup Networking Support
FTP Server
Network Servers
Legacy Software Development
Legacy Software Support
Development Libraries
Graphics
Web Server
Ruby
Printing Support
Mail Server
Server Configuration Tools
PostgreSQL Database
Available Groups:
Office/Productivity
Administration Tools
Beagle
Development Tools
GNOME Software Development
X Software Development
Virtualization
GNOME Desktop Environment
Authoring and Publishing
Mono
Games and Entertainment
XFCE-4.4
Tomboy
Java
Java Development
Emacs
X Window System
Windows File Server
KDE Software Development
KDE (K Desktop Environment)
Horde
Sound and Video
FreeNX and NX
News Server
Yum Utilities
Graphical Internet
Done

Task: Install all the default packages by group

Install all 'Development Tools' group packages, enter:
# yum groupinstall "Development Tools"

Task: Update all the default packages by group

Update all 'Development Tools' group packages, enter:
# yum groupupdate "Development Tools"

Task: Remove all packages in a group

Remove all 'Development Tools' group packages, enter:
# yum groupremove "Development Tools"

Task: Install particular architecture package

If you are using 64 bit RHEL version it is possible to install 32 packages:
# yum install {package-name}.{architecture}
# yum install mysql.i386

Task: Display packages not installed via official RHN subscribed repos

Show all packages not available via subscribed channels or repositories i.e show packages installed via other repos:
# yum list extras
Sample output:

Loading "installonlyn" plugin
Loading "security" plugin
Setting up repositories
Reading repository metadata in from local files
Extra Packages
DenyHosts.noarch 2.6-python2.4 installed
VMwareTools.i386 6532-44356 installed
john.i386 1.7.0.2-3.el5.rf installed
kernel.i686 2.6.18-8.1.15.el5 installed
kernel-devel.i686 2.6.18-8.1.15.el5 installed
lighttpd.i386 1.4.18-1.el5.rf installed
lighttpd-fastcgi.i386 1.4.18-1.el5.rf installed
psad.i386 2.1-1 installed
rssh.i386 2.3.2-1.2.el5.rf installed

Task: Display what package provides the file

You can easily find out what RPM package provides the file. For example find out what provides the /etc/passwd file:
# yum whatprovides /etc/passwd
Sample output:

Loading "installonlyn" plugin
Loading "security" plugin
Setting up repositories
Reading repository metadata in from local files
setup.noarch 2.5.58-1.el5 base
Matched from:
/etc/passwd
setup.noarch 2.5.58-1.el5 installed
Matched from:
/etc/passwd

You can use same command to list packages that satisfy dependencies:
# yum whatprovides {dependency-1} {dependency-2}
Refer yum command man page for more information:
# man yum

No comments:

Router Packet Networking

Đây là video ngắn khá hay, mô tả đường đi của một gói tin trên Mạng Internet.