Install rsyslog with yum

From rsyslog wiki
Jump to: navigation, search

The problem

For those administrative novices like me who try to install rsyslog with yum, there's often a problem; there's often a dependency conflict with the currently installed logger, such as syslog-ng or sysklogd. For example:

# yum install rsyslog
Setting up Install Process
Setting up repositories
update                    100% |=========================|  951 B    00:00     
rpmforge                  100% |=========================| 1.1 kB    00:00     
base                      100% |=========================| 1.1 kB    00:00     
addons                    100% |=========================|  951 B    00:00     
extras                    100% |=========================| 1.1 kB    00:00     
Reading repository metadata in from local files
Parsing package install arguments
Resolving Dependencies
--> Populating transaction set with selected packages. Please wait.
---> Package rsyslog.x86_64 0:2.0.6-0.1.el4.rf set to be updated
--> Running transaction check

Dependencies Resolved

=============================================================================
 Package                 Arch       Version          Repository        Size 
=============================================================================
Installing:
 rsyslog                 x86_64     2.0.6-0.1.el4.rf  rpmforge          227 k

Transaction Summary
=============================================================================
Install      1 Package(s)         
Update       0 Package(s)         
Remove       0 Package(s)         
Total download size: 227 k
Is this ok [y/N]: y
Downloading Packages:
Running Transaction Test
Finished Transaction Test


Transaction Check Error:   file /etc/logrotate.d/syslog from install of rsyslog-2.0.6-0.1.el4.rf conflicts with file from package sysklogd-1.4.1-27.el4

Attempting to remove either sysklogd or syslog-ng with yum will normally require removing all dependencies, which normally includes the kernel and all other packages. Not exactly what you want....

The solution

How then to switch, using yum?

The answer is to use a mildly advanced feature of yum, yum shell. This will let you combine the install of one package and the removal of another into one yum transaction, allowing the new package to resolve the dependencies of the package being removed.

For example (">" is the yum shell prompt):

# yum shell
Setting up Yum Shell
> install rsyslog
Setting up Install Process
Setting up repositories
Reading repository metadata in from local files
Parsing package install arguments
> remove sysklogd
Setting up Remove Process
> run
--> Populating transaction set with selected packages. Please wait.
---> Package rsyslog.x86_64 0:2.0.6-0.1.el4.rf set to be updated
---> Package sysklogd.x86_64 0:1.4.1-27.el4 set to be erased
--> Running transaction check

=============================================================================
 Package                 Arch       Version          Repository        Size 
=============================================================================
Installing:
 rsyslog                 x86_64     2.0.6-0.1.el4.rf  rpmforge          227 k
Removing:
 sysklogd                x86_64     1.4.1-27.el4     installed         123 k

Transaction Summary
=============================================================================
Install      1 Package(s)         
Update       0 Package(s)         
Remove       1 Package(s)         
Total download size: 227 k
Is this ok [y/N]: y
Downloading Packages:
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
  Removing  : sysklogd                     ######################### [1/2]
  Installing: rsyslog                      ######################### [2/2] 

Removed: sysklogd.x86_64 0:1.4.1-27.el4
Installed: rsyslog.x86_64 0:2.0.6-0.1.el4.rf
Finished Transaction
> exit
Leaving Shell

You will probably want to reboot after this.