System update using 'yum'

T

his tutorial works for CentOS 6 only. For your specific OS tutorial use the tags or serach function in the sidebar area.

When comes to installing and updating software on our CentOS server there is no easier method than using system tool called YUM and it is quite important security matter to have your server up-to-date.

Installing rpmforge package repository

It's nice to have this repo installed since it offers so much software not included in official CentOS repositories.

For CentOS 6 (32bit)

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

Type: rpm -ihv rpmforge-release*.rf.i686.rpm

For CentOS 6 (64bit)

Type: wget http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.2-2.el6.rf.x86_64.rpm

Type: rpm -ihv rpmforge-release*.rf.x86_64.rpm

[root@vps ~]# wget http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.2-2.el6.rf.i686.rpm
.........
Resolving apt.sw.be... 193.1.193.67
Connecting to apt.sw.be|193.1.193.67|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 12732 (12K) [application/x-redhat-package-manager]
Saving to: `rpmforge-release-0.5.2-2.el6.rf.i686.rpm'

100%[==========================================>] 12,732 22.8K/s in 0.5s

2013-07-02 12:56:59 (22.8 KB/s) - `rpmforge-release-0.5.2-2.el6.rf.i686.rpm' saved [12732/12732]

[root@vps ~]# rpm -ihv rpmforge-release*.rf.i686.rpm
warning: rpmforge-release-0.5.2-2.el6.rf.i686.rpm: Header V3 DSA/SHA1 Signature, key ID 6b8d79e6: NOKEY
Preparing... ########################################### [100%]
1:rpmforge-release ########################################### [100%]
[root@vps ~]#
 

First it's good to instal yum-priorities plugin.

Type: yum install yum-priorities

[root@vps ~]# yum install yum-priorities
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: mirror.us.leaseweb.net
* extras: centos.mirror.netriplex.com
* rpmforge: mirror.teklinks.com
* updates: mirror.symnds.com
rpmforge | 1.9 kB 00:00
rpmforge/primary_db | 2.7 MB 00:08
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package yum-plugin-priorities.noarch 0:1.1.30-14.el6 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

=====================================================================================================================
Package Arch Version Repository Size
=====================================================================================================================
Installing:
yum-plugin-priorities noarch 1.1.30-14.el6 base 22 k

Transaction Summary
=====================================================================================================================
Install 1 Package(s)

Total download size: 22 k
Installed size: 28 k
Is this ok [y/N]: y
Downloading Packages:
yum-plugin-priorities-1.1.30-14.el6.noarch.rpm | 22 kB 00:00
warning: rpmts_HdrFromFdno: Header V3 RSA/SHA1 Signature, key ID c105b9de: NOKEY
Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
Importing GPG key 0xC105B9DE:
Userid : CentOS-6 Key (CentOS 6 Official Signing Key)
Package: centos-release-6-4.el6.centos.10.i686 (installed)
From : /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
Is this ok [y/N]: y
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Installing : yum-plugin-priorities-1.1.30-14.el6.noarch 1/1
Verifying : yum-plugin-priorities-1.1.30-14.el6.noarch 1/1

Installed:
yum-plugin-priorities.noarch 0:1.1.30-14.el6

Complete!
[root@vps ~]#

Now you need to edit /etc/yum.repos.d/CentOS-Base.repo and add these priorities to the bottoms of each of the following repo sections:

[base]
priority=1

[updates]
priority=1

[extras]
priority=1
 
Save your changes on this file and edit the rpmforge.repo file. You’ll only need to edit the one repository section.
 
[rpmforge]
priority=5
 

Save your changes and you’re finished.

System update

Type: yum check-update

Will give you the list of packages ready to update.

For download and update type: yum update

For a complete list of yum options check the COMMANDS page.
 
[root@vps yum.repos.d]# yum update
Loaded plugins: fastestmirror, priorities
Loading mirror speeds from cached hostfile
* base: mirror.umd.edu
* extras: mirror.itc.virginia.edu
* rpmforge: mirror.teklinks.com
* updates: centos.mirror.netriplex.com
15 packages excluded due to repository priority protections
Setting up Update Process
No Packages marked for Update
[root@vps yum.repos.d]#
 

No futher updates.