Yum update causes conflicts with file from package

Apparently I am not the only one with this issue. My server runs MailScanner which requires perl-IO. If you have the latest version of perl on your system with yum, you might run into these errors:
Transaction Check Error:
  file /usr/share/man/man3/IO.3pm.gz from install of perl-IO-1.2301-1.el5.rf conflicts with file from package perl-5.8.8-10.el5_2.3
  file /usr/share/man/man3/IO::Dir.3pm.gz from install of perl-IO-1.2301-1.el5.rf conflicts with file from package perl-5.8.8-10.el5_2.3
  file /usr/share/man/man3/IO::File.3pm.gz from install of perl-IO-1.2301-1.el5.rf conflicts with file from package perl-5.8.8-10.el5_2.3
  file /usr/share/man/man3/IO::Handle.3pm.gz from install of perl-IO-1.2301-1.el5.rf conflicts with file from package perl-5.8.8-10.el5_2.3
  file /usr/share/man/man3/IO::Pipe.3pm.gz from install of perl-IO-1.2301-1.el5.rf conflicts with file from package perl-5.8.8-10.el5_2.3
  file /usr/share/man/man3/IO::Poll.3pm.gz from install of perl-IO-1.2301-1.el5.rf conflicts with file from package perl-5.8.8-10.el5_2.3
  file /usr/share/man/man3/IO::Seekable.3pm.gz from install of perl-IO-1.2301-1.el5.rf conflicts with file from package perl-5.8.8-10.el5_2.3
  file /usr/share/man/man3/IO::Select.3pm.gz from install of perl-IO-1.2301-1.el5.rf conflicts with file from package perl-5.8.8-10.el5_2.3
  file /usr/share/man/man3/IO::Socket.3pm.gz from install of perl-IO-1.2301-1.el5.rf conflicts with file from package perl-5.8.8-10.el5_2.3
  file /usr/share/man/man3/IO::Socket::INET.3pm.gz from install of perl-IO-1.2301-1.el5.rf conflicts with file from package perl-5.8.8-10.el5_2.3
  file /usr/share/man/man3/IO::Socket::UNIX.3pm.gz from install of perl-IO-1.2301-1.el5.rf conflicts with file from package perl-5.8.8-10.el5_2.3

On this site, the solution which worked rather well was this:

First you need to find out which repository is causing the problems. For perl-IO, chances are, you are using rpmforge (dag.wieers.com). If this is the case, then use my commands below as they are. If you are using a different repository, then change rpmforge for your problem repository.
cd /var/cache/yum/rpmforge/packages
rpm -Uvh—force perl-IO

Note that the

means to hit the tab key, and auto complete will choose the right rpm for you.

On my system I had four rpm’s that were not installing as they should. Although I do not recommend forcing the install of any rpm, this solution did work, and restarting MailScanner fixed all my issues.

How to permanently exclude packages with yum

To permanently exclude packages from yum when running update or check-update, simply edit the /etc/yum.conf file adding the following:

exclude= [package1] [package2] [package3]

List all the packages you to exclude here. Since others had asked the same question, I figured it was worth noting here.

Moving Subversion to RHEL5

This week we had to resolve an issue with Subversion on RHEL5. We use post-commit hooks to have external directories get an auto-update from the repository everytime someone check-in a file or update. This all worked fine on RHEL4 using sudoers. On RHEL5 we were getting Authentication failures each time we tried.

Turns out that RHEL5 has the /etc/sudoers file heavily modified with lots of yummy security goodness. A possible solution to this dilemma is to remove the line in the new sudoers marked Default reset_env. What this is does, is reload the environment variables to their default level. Subversion though, according to the official documents, performs the post-commit hooks using an empty environment. The best we could figure out was that sudoers tries to reload the environment variables just before the post-commit hook is run, and causes authentication to crap out. As soon as we commented out the default reset_env line in /etc/sudoers, our auto updates from SVN worked again!

Took a couple of hours to narrow it down to that problem, but we did sort it out in the end. Hope this helps someone else.

Got the cpanel “Couldn’t find MySQL manager or server” blues?

With my new cpanel box I just upgraded MySQL 4 to MySQL 5. Then I noticed that MySQL wouldn’t start anymore. When I tried to start manually with /etc/init.d/mysql start, I would get this error “Starting MySQLCouldn’t find MySQL manager or server     [FAILED]”.

After a quick Google search I found this post with the solution.

In short, when you upgrade MySQL on cpanel using the built in control panel, /etc/my.cnf erroneously sets the wrong basedir. Commenting out this line #basedir=/var/lib, and starting MySQL solved the issue.

The post gave their solution as coming from a bug report and a known solution here.

Formatting a second drive on RHEL Linux

Here is a quick little how-to for formatting a second drive on RHEL4 Linux. A great deal of credit goes to http://www.eth0.us/mount on this.

This how-to is based on my machine which has two 80GB scsi drives which we can see by doing the following:

#cat /proc/scsi/scsi
Attached devices:
Host: scsi0 Channel: 00 Id: 00 Lun: 00
  Vendor: FUJITSU Model: MAW3073NP     Rev: 5803
  Type:  Direct-Access             ANSI SCSI revision: 03
Host: scsi0 Channel: 00 Id: 01 Lun: 00
  Vendor: SEAGATE Model: ST373207LW     Rev: D702
  Type:  Direct-Access             ANSI SCSI revision: 03

WARNING: Be very careful as the smallest mistake can lead to a complete loss of ALL information on your machine!

Now let’s get going!

The first thing we will do is run fdisk which is used to format a disk. I first run it with the -l (elle) flag to see what partitions my drives currently have:

[root@server var]# fdisk -l

Disk /dev/sda: 73.4 GB, 73407820800 bytes
255 heads, 63 sectors/track, 8924 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

  Device Boot     Start       End     Blocks   Id System
/dev/sda1   *        1       13     104391   83 Linux
/dev/sda2         14       268   2048287+  82 Linux swap
/dev/sda3         269       399   1052257+  83 Linux
/dev/sda4         400     8924   68477062+  5 Extended
/dev/sda5         400     8924   68477031   83 Linux

Disk /dev/sdb: 73.4 GB, 73407820800 bytes
255 heads, 63 sectors/track, 8924 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

  Device Boot     Start       End     Blocks   Id System
/dev/sdb1   *        1       13     104391   83 Linux
/dev/sdb2         14       268   2048287+  82 Linux swap
/dev/sdb3         269       399   1052257+  83 Linux
/dev/sdb4         400     8924   68477062+  5 Extended
/dev/sdb5         400     8924   68477031   83 Linux

As you can see above I can see the two SCSI drives and they both have partitions. This is because at some point in the past I ran dd to duplicate my primary disk over to my secondary disk. I want to now get rid of all those partitions on drive B and format drive B with one partition, which I will use to store my backups on.

The following is what did to remove the old paritions and create a new one:

[root@server var]# fdisk /dev/sdb

The number of cylinders for this disk is set to 8924.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
  (e.g., DOS FDISK, OS/2 FDISK)

Command (m for help): n
No free sectors available

Command (m for help): d
Partition number (1-5): 5

Command (m for help): d
Partition number (1-5): 4

Command (m for help): d
Partition number (1-4): 3

Command (m for help): d
Partition number (1-4): 2

Command (m for help): d
Selected partition 1

Command (m for help): d
No partition is defined yet!

Command (m for help): n
Command action
  e   extended
  p   primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-8924, default 1):  (Here we just hit -ENTER- to accept the default)
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-8924, default 8924): (Here we just hit -ENTER- to accept the default)
Using default value 8924

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.
Syncing disks.

Now when we run fdisk we can see the two drives with different partitions:

[root@server var]# fdisk -l

Disk /dev/sda: 73.4 GB, 73407820800 bytes
255 heads, 63 sectors/track, 8924 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

  Device Boot     Start       End     Blocks   Id System
/dev/sda1   *        1       13     104391   83 Linux
/dev/sda2         14       268   2048287+  82 Linux swap
/dev/sda3         269       399   1052257+  83 Linux
/dev/sda4         400     8924   68477062+  5 Extended
/dev/sda5         400     8924   68477031   83 Linux

Disk /dev/sdb: 73.4 GB, 73407820800 bytes
255 heads, 63 sectors/track, 8924 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

  Device Boot     Start       End     Blocks   Id System
/dev/sdb1           1     8924   71681998+  83 Linux

Now we need to format partition sdb1 so that Linux can use it. We will use ext3 in this case:

[root@server var]# mkfs.ext3 /dev/sdb1
mke2fs 1.35 (28-Feb-2004)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
8962048 inodes, 17920499 blocks
896024 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=20971520
547 block groups
32768 blocks per group, 32768 fragments per group
16384 inodes per group
Superblock backups stored on blocks:
      32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
      4096000, 7962624, 11239424

Writing inode tables: done                  
Creating journal (8192 blocks): done
Writing superblocks and filesystem accounting information: done

This filesystem will be automatically checked every 32 mounts or
180 days, whichever comes first.  Use tune2fs -c or -i to override.

The only thing left to do is create a mount point for the drive and add one line to our fstab. I like to put all my drives in a root folder called /mnt. So let’s create mnt and meaningful place within mount which I like to name after the drive, so in this case sdb. For future reference we can now easily keep track of which drive is which.

[root@server5 var]# mkdir /mnt
[root@server5 var]# cd mnt
[root@server5 var]# mkdir /sdb

Now we can add the line to fstab so the system know what to mount and where. Note that your fstab will vary considerably. The line I enter is ‘/dev/sdb1 /mnt/sdb ext3 defaults 1 1’ without the quotes:

[root@server mnt]# pico -w /etc/fstab

# This file is edited by fstab-sync - see ‘man fstab-sync’ for details
/dev/sda5 /    ext3   usrquota,grpquota 1 1
/dev/sda1 /boot   ext3   defaults 1 2
/dev/sda3 /tmp   ext3   defaults,noexec 1 0
none     /dev/pts devpts gid=5,mode=620 0 0
none     /proc   proc   defaults 0 0
none     /dev/shm tmpfs defaults 0 0
/dev/sda2 swap   swap   defaults 0 0
/dev/hdc           /media/cdrom         au
to   pamconsole,exec,noauto,managed 0 0
/dev/sdb1 /mnt/sdb ext3 defaults 1 1

Now ew can simply use the mount command to use our drive and check that it is there:

[root@server scsi]# cd /mnt/sdb/
[root@server5 sdb]# ls
lost+found

That’s all there is to it.

Page 3 of 4 pages  < 1 2 3 4 >