Archive for the ‘Fedora’ Category

Excluding Packages from Yum Updates

Sunday, March 30th, 2008

There may be times when you may need to exclude packages from yum updates — e.g. package conflicts, etc. I always like to give an example of why I would do this or that, so for an example pertaining to excluding packages it’s as simple as something is installed and the RPM’s of that conflict with the RPM’s yum wants to install and yum won’t install them because it doesn’t want to break the system. This in turn can keep unrelated packages from installing and then it can become one big mess. Did that run-on sentence make any sense? Ok, this is it in action…

[root@linux ~]# yum update
fedora                    100% |=========================| 2.1 kB    00:00
primary.sqlite.bz2        100% |=========================| 3.8 MB    00:03
updates                   100% |=========================| 2.3 kB    00:00
primary.sqlite.bz2        100% |=========================| 2.4 MB    00:02
Setting up Update Process
Resolving Dependencies
--> Running transaction check
---> Package perl.i386 4:5.8.8-28.fc7 set to be updated
---> Package perl-libs.i386 4:5.8.8-28.fc7 set to be updated
---> Package perl-ExtUtils-MakeMaker.i386 0:6.30-28.fc7 set to be updated
---> Package perl-CPAN.i386 0:1.76_02-28.fc7 set to be updated
---> Package perl-ExtUtils-Embed.i386 0:1.26-28.fc7 set to be updated
---> Package perl-Test-Simple.i386 0:0.62-28.fc7 set to be updated
---> Package perl-devel.i386 4:5.8.8-28.fc7 set to be updated
---> Package perl-Test-Harness.i386 0:2.56-28.fc7 set to be updated
filelists.sqlite.bz2      100% |=========================| 6.4 MB    00:05
filelists.sqlite.bz2      100% |=========================| 5.3 MB    00:04
--> Finished Dependency Resolution

Dependencies Resolved

=============================================================================
 Package                 Arch       Version          Repository        Size
=============================================================================
Updating:
 perl                    i386       4:5.8.8-28.fc7   updates            10 M
 perl-CPAN               i386       1.76_02-28.fc7   updates           127 k
 perl-ExtUtils-Embed     i386       1.26-28.fc7      updates            34 k
 perl-ExtUtils-MakeMaker  i386       6.30-28.fc7      updates           288 k
 perl-Test-Harness       i386       2.56-28.fc7      updates            78 k
 perl-Test-Simple        i386       0.62-28.fc7      updates           109 k
 perl-devel              i386       4:5.8.8-28.fc7   updates           384 k
 perl-libs               i386       4:5.8.8-28.fc7   updates           567 k

Transaction Summary
=============================================================================
Install      0 Package(s)
Update       8 Package(s)
Remove       0 Package(s)

Total download size: 12 M
Is this ok [y/N]: y
Downloading Packages:
(1/8): perl-Test-Harness- 100% |=========================|  78 kB    00:00
(2/8): perl-devel-5.8.8-2 100% |=========================| 384 kB    00:00
(3/8): perl-Test-Simple-0 100% |=========================| 109 kB    00:00
(4/8): perl-ExtUtils-Embe 100% |=========================|  34 kB    00:00
(5/8): perl-CPAN-1.76_02- 100% |=========================| 127 kB    00:00
(6/8): perl-ExtUtils-Make 100% |=========================| 288 kB    00:00
(7/8): perl-libs-5.8.8-28 100% |=========================| 567 kB    00:00
(8/8): perl-5.8.8-28.fc7. 100% |=========================|  10 MB    00:09
Running rpm_check_debug
Running Transaction Test
Finished Transaction Test

Transaction Check Error:
  file /usr/lib/perl5/5.8.8/i386-linux-thread-multi/auto/MIME/Base64/Base64.so from install of perl-5.8.8-28.fc7 conflicts with file from package perl-MIME-Base64-3.07-1
  file /usr/share/man/man3/MIME::Base64.3pm.gz from install of perl-5.8.8-28.fc7 conflicts with file from package perl-MIME-Base64-3.07-1
  file /usr/share/man/man3/MIME::QuotedPrint.3pm.gz from install of perl-5.8.8-28.fc7 conflicts with file from package perl-MIME-Base64-3.07-1
  file /usr/lib/perl5/5.8.8/Getopt/Long.pm from install of perl-5.8.8-28.fc7 conflicts with file from package perl-Getopt-Long-2.36-1
  file /usr/lib/perl5/5.8.8/newgetopt.pl from install of perl-5.8.8-28.fc7 conflicts with file from package perl-Getopt-Long-2.36-1
  file /usr/share/man/man3/Getopt::Long.3pm.gz from install of perl-5.8.8-28.fc7 conflicts with file from package perl-Getopt-Long-2.36-1
  file /usr/lib/perl5/5.8.8/Math/BigFloat.pm from install of perl-5.8.8-28.fc7 conflicts with file from package perl-Math-BigInt-1.86-1
  file /usr/lib/perl5/5.8.8/Math/BigInt.pm from install of perl-5.8.8-28.fc7 conflicts with file from package perl-Math-BigInt-1.86-1
  file /usr/lib/perl5/5.8.8/Math/BigInt/Calc.pm from install of perl-5.8.8-28.fc7 conflicts with file from package perl-Math-BigInt-1.86-1
  file /usr/lib/perl5/5.8.8/Math/BigInt/CalcEmu.pm from install of perl-5.8.8-28.fc7 conflicts with file from package perl-Math-BigInt-1.86-1
  file /usr/share/man/man3/Math::BigFloat.3pm.gz from install of perl-5.8.8-28.fc7 conflicts with file from package perl-Math-BigInt-1.86-1
  file /usr/share/man/man3/Math::BigInt.3pm.gz from install of perl-5.8.8-28.fc7 conflicts with file from package perl-Math-BigInt-1.86-1
  file /usr/share/man/man3/Math::BigInt::Calc.3pm.gz from install of perl-5.8.8-28.fc7 conflicts with file from package perl-Math-BigInt-1.86-1
  file /usr/share/man/man3/Math::BigInt::CalcEmu.3pm.gz from install of perl-5.8.8-28.fc7 conflicts with file from package perl-Math-BigInt-1.86-1
  file /usr/lib/perl5/5.8.8/Math/BigRat.pm from install of perl-5.8.8-28.fc7 conflicts with file from package perl-Math-BigRat-0.19-1
  file /usr/share/man/man3/Math::BigRat.3pm.gz from install of perl-5.8.8-28.fc7 conflicts with file from package perl-Math-BigRat-0.19-1
  file /usr/lib/perl5/5.8.8/bigint.pm from install of perl-5.8.8-28.fc7 conflicts with file from package perl-bignum-0.21-1
  file /usr/lib/perl5/5.8.8/bignum.pm from install of perl-5.8.8-28.fc7 conflicts with file from package perl-bignum-0.21-1
  file /usr/lib/perl5/5.8.8/bigrat.pm from install of perl-5.8.8-28.fc7 conflicts with file from package perl-bignum-0.21-1
  file /usr/share/man/man3/bigint.3pm.gz from install of perl-5.8.8-28.fc7 conflicts with file from package perl-bignum-0.21-1
  file /usr/share/man/man3/bignum.3pm.gz from install of perl-5.8.8-28.fc7 conflicts with file from package perl-bignum-0.21-1
  file /usr/share/man/man3/bigrat.3pm.gz from install of perl-5.8.8-28.fc7 conflicts with file from package perl-bignum-0.21-1
  file /usr/lib/perl5/5.8.8/i386-linux-thread-multi/Sys/Syslog.pm from install of perl-5.8.8-28.fc7 conflicts with file from package perl-Sys-Syslog-0.18-1
  file /usr/lib/perl5/5.8.8/i386-linux-thread-multi/auto/Sys/Syslog/Syslog.so from install of perl-5.8.8-28.fc7 conflicts with file from package perl-Sys-Syslog-0.18-1

Error Summary
-------------

[root@linux ~]#

I ran a yum update and a bunch of perl updates crapped out. MailScanner is the only application I installed that loaded a series of perl RPM dependencies, so it’s safe to assume that MailScanner is the culprit. With that said, I’ll get to the point of this post. If you have a similar problem with yum updates failing, you can exclude those updates.

For RedHat based systems (Fedora & CentOS), you’ll want to edit the updates repository file.

[root@linux ~]# cd /etc/yum.repos.d/
[root@linux yum.repos.d]# ls
fedora-development.repo  fedora.repo  fedora-updates.repo  fedora-updates-testing.repo
[root@linux yum.repos.d]# nano fedora-updates.repo

On my Fedora 7 system, the file I want to edit is fedora-updates.repo (your file name may be different depending on the distro and release you’re using).

In the updates section, add an exclude line like in the example below. I’m excluding all updates that begin with the word perl (note the wildcard *). To exclude more than one set, enter each package name on the same line and separate them with a space.

[updates]
name=Fedora $releasever - $basearch - Updates
#baseurl=http://download.fedora.redhat.com/pub/fedora/linux/updates/$releasever/$basearch/
mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=updates-released-f$releasever&arch=$basearch
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora
exclude=perl*

Now if I run the yum update, all packages beginning with “perl” should be excluded.

[root@linux yum.repos.d]# yum update
updates                   100% |=========================| 2.3 kB    00:00
Excluding Packages from Fedora 7 - i386 - Updates
Finished
Setting up Update Process
No Packages marked for Update
[root@linux yum.repos.d]#

Now we’re cool. If you didn’t know how to exclude packages from yum updates, well now you know.

What happened to named.conf in ISC BIND DNS on Fedora 7?

Sunday, December 16th, 2007

I’ve made the great leap this week by moving to a new colocation. This site and many others have moved to a new dedicated server because the old service I used provided by unnamed company was absolutely horrible. They boasted 99.99% uptime, HA! I was lucky to get 75% uptime out of those fools for the year I was with them. Anyway…

The one thing I hate about moving is having to transfer gigs of data and reconfigure things. To cut it short, the old server was Fedora Core 4 and the new server is Fedora 7. Changes have been made between the three versions difference. One of these changes explains the title of this post. What happened to named.conf?

I checked the typical locations like /etc and /var/named/chroot/etc but it was nowhere to be found. I ran a locate and it didn’t exist. Thinking it was somewhat possible that maybe it was in a RPM I hadn’t installed, I checked the RPM list on a Fedora mirror site and compared those to the RPM’s I did have installed. No luck, everything was there.

I searched the net and didn’t find any reason for named.conf’s disappearance. I also discovered I wasn’t the only one seeking an explanation to its vanishing act. I came across a post on a forum mentioning the use of system-config-bind to create named.conf. A marvel idea, however it’s a GUI based tool and that leaves us text based users out in the cold — well sort of…

If you’re like me and want to set up a DNS Server on Fedora 7 to handle your zones, then follow these steps while as root.

1. Even though it’s a GUI dependent tool, install system-config-bind using yum. It contains template files you can use to get named up and running.

yum install system-config-bind

2. The templates used by system-config-bind for generate named.conf and other essential files have been installed in /usr/share/system-config-bind/profiles/default. We need to copy these files to where named would be expecting them (the assumption being that you’re running named in a chroot jail.

cd /usr/share/system-config-bind/profiles/default
cp -p named.conf /var/named/chroot/etc/
cp ./named/* /var/named/chroot/var/named/

3. Now that named.conf is copied over we’ll need to make a change to the root hints file name. Right now our named.conf is looking for the file named.root instead of named.ca as in prior releases of bind. If you don’t make this change, named will fail to start and you’ll get an error like this in syslog named[20622]: could not configure root hints from ‘named.root’: file not found. Open named.conf in a text editor and look for this section (it should be right below options).

zone "." IN {
        type hint;
        file "named.root";
};

Change named.root to named.ca and save your changes.

4. Create a symlink to named.conf in /etc (optional but suggested).

ln -s /var/named/chroot/etc/named.conf /etc/named.conf

5. Start the named service and you’re good to go.

service named start

Now go ahead and create your zone files and add their references to named.conf. See my RedHat Bind Tutorial on XenoCafe for more information on DNS and Zones.