Solved

perl -v shows upgraded version but rpm shows lower version

Posted on 2008-10-02
16
436 Views
Last Modified: 2010-04-20
Hello all

I recently upgraded perl from 5.8.1-92 to 5.8.8. I have been trying to install rrdtool using apt-get but apparently perl version needs to be greater than 5.8.1.

The following packages have unmet dependencies:
  rrdtool: Depends: perl (>= 3:5.8.3) but 3:5.8.1-92 is to be installed
E: Broken packages

When I do perl -v

[root@chulu root]# perl -v

This is perl, v5.8.8 built for i686-linux

Copyright 1987-2006, Larry Wall

And....

[root@chulu root]# rpm -q perl
perl-5.8.1-92

How can I get around this problem?

TIA
Shekhar Basnet


0
Comment
Question by:shekharbasnet
  • 6
  • 4
  • 3
16 Comments
 
LVL 10

Expert Comment

by:MadShiva
ID: 22623922
Hi !

I think you have installed perl v5.8.8 but you keep the old version.

Try to do this :

apt-get remove --purge perl
apt-get clean
apt-get install perl


Best Regards
0
 
LVL 8

Expert Comment

by:Rance_Hall
ID: 22624142
if that doesnt work, then you might want to report a bug to the package maintainer, the package database does not record the right version of perl

Try what MadShiva suggested first, then we can go down the road of what to do next
0
 
LVL 2

Author Comment

by:shekharbasnet
ID: 22631760
Hi
Thanks for the comments. I did as MadShiva suggested.

pt-get remove --purge perl  ---> success
apt-get clean ---> success
apt-get install perl ---> unsuccessful

I get:

[root@chulu shekhar]# apt-get install perl
Reading Package Lists... Done
Building Dependency Tree... Done
Package perl has no available version, but exists in the database.
This typically means that the package was mentioned in a dependency and
never uploaded, has been obsoleted or is not available with the contents
of sources.list
E: Package perl has no installation candidate

And when I do perl -vI still get v.5.8.8. And all the programs that depend on perl are still running. What will be the next step?

[root@chulu shekhar]# perl -v

This is perl, v5.8.8 built for i686-linux

Copyright 1987-2006, Larry Wall


0
 
LVL 10

Expert Comment

by:MadShiva
ID: 22632180
Hi !

How do you have upgrade perl ?

With apt-get update and apt-get upgrade ?

If you have installed perl with dpkg try : dpkg --remove perl

Best Regards
0
 
LVL 2

Author Comment

by:shekharbasnet
ID: 22633008
Hi

This perl 5.8.8 i installed from source. rpm -q does not show perl but perl -v returns the perl version.

[root@chulu shekhar]# rpm -q perl
package perl is not installed

[root@chulu shekhar]# perl -v

This is perl, v5.8.8 built for i686-linux


0
 
LVL 10

Expert Comment

by:MadShiva
ID: 22633301
Hi !

Have you try rpm -e perl and  dpkg --remove perl ?

Could you give me the result of these two command ?

Best Regards
0
Complete Microsoft Windows PC® & Mac Backup

Backup and recovery solutions to protect all your PCs & Mac– on-premises or in remote locations. Acronis backs up entire PC or Mac with patented reliable disk imaging technology and you will be able to restore workstations to a new, dissimilar hardware in minutes.

 
LVL 8

Expert Comment

by:Rance_Hall
ID: 22633620
ah ok, now this makes sense.

you installed perl from source.


that means that the version of perl you installed from source is NOT listed in the package database.

so when you went to install a package that needed perl it cant find it because it ONLY looks in the package database.

Only two ways to fix this.

do a "make uninstall" and uninstall the source compiled version of perl

apt-get update

apt-get install perl from the package db

then your other package should install fine.



the other way to handle this is to install the program you are trying to install from source and it can and will find perl the "original" way and you'll be fine.

In general its a bad idea to mix package installs and source installs if you dont know what you are doing.

you could also install the equivs-build package and create a dummy perl package to install that "tells" the package db that perl is installed, then you can continue to use your source compiled perl.
0
 
LVL 2

Author Comment

by:shekharbasnet
ID: 22643636
Hi MadShiva
Yes I unistalled perl old version by rpm -e. BUt still the same condition.

0
 
LVL 2

Author Comment

by:shekharbasnet
ID: 22643640
Hi Rance Hall,

'make unistall' is not working.

[root@chulu perl-5.8.8]# make unistall
make: *** No rule to make target `unistall'.  Stop.

I was also not able to install equivs-build . How do I do it?

TIA
s
0
 
LVL 2

Author Comment

by:shekharbasnet
ID: 22643641
oh, bad spelling above. here's the output.

[root@chulu perl-5.8.8]# make uninstall
make: *** No rule to make target `uninstall'.  Stop.
0
 
LVL 8

Expert Comment

by:Rance_Hall
ID: 22646499
unfortunately that means that the makers of the perl package have decided that someone would be downright foolish to uninstall perl (in this case they are likely right) so there is no uninstall function in the source code for perl.

this sucks for you.

youve only got two options, that I could recommend having been there myself.

I HOPE this is a test server and you have not screwed up a production box.

if this is a test server, just scrap it and reinstall everything from scratch and call it a learning experience.

if this is a production server I would SERIOUSLY consider doing the same thing, but another option is available.

I have mentioned the equivs-build package in an earlier post.

use the equivs-build package to create a .dpkg file that TELLS THE PACKAGE DB that perl5.8 is in fact installed, but doesnt actually install anything.

you can then use this phony .dpkg file to tell the other package you were trying to install that perl is installed, and it will stop complaining.

equivs-build comes with sample configuration files for other programs like apache etc so that you can see how the process works.

the specific point is to allow you to compile some things from source, but still tell the package database that the program is installed.

However, since perl is really at the core of possibly a thousand things that your server might do, and with all the perl packages that can be installed with apt that likely wont work anymore because of this, I would seriously consider reinstalling the whole box.

I know it sucks, but I still would want to.
0
 
LVL 2

Author Comment

by:shekharbasnet
ID: 22709298
Hi Rance Hall,

Yes its not a production box in the strict sense but I have so many monitoring tools and scripts in this box, I am reluctant to reinstall the box. Actually this is how it all started, I wanted to install smokeping which required RRDtool which required a higher version of perl and now I am stuck.

So I will first try the equivs-build package but I was not able to find for my box. I am using Fedora Core 1.  Can you please point me to the right direction? If nothing works then I will have to re-install the box. :-(

TIA
s
0
 
LVL 8

Accepted Solution

by:
Rance_Hall earned 400 total points
ID: 22711343
Fedora Core 1???????

isnt Fedora up to like 9 or 10 now?

two main points, why run a server on Fedora?  as far as I'm concerned fedora moves too fast for a server.

try Centos its an open derivative of RHEL and runs at most a day or two behind when it comes to bug fixes, etc.

why run a server on an OS so old, there has to be hundreds is not thousands of buffer overrun errors/security flaws fixed since then.

any way, equivs-build is a debian deal fedora wont have it in any version.

but fedora has a similar ability -- you can make your own rpm package.

I found a how to on the net for getting rid of sendmail on redhat boxes but using an rpm to "lie" to the rpm database to say that it is installed.

you might check out that url for directions on how to do it, and you can modify those for your situation.

http://qmail.jms1.net/fake-smtp.shtml

(the author of the above web site doesnt allow IE views, so use a different browser)

also google for a howto for building your own rpms, there is some box setup you need first.

directory structures, etc.

0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

How many times have you wanted to quickly do the same thing to a list but found yourself typing it again and again? I first figured out a small time saver with the up arrow to recall the last command but that can only get you so far if you have a bi…
Linux users are sometimes dumbfounded by the severe lack of documentation on a topic. Sometimes, the documentation is copious, but other times, you end up with some obscure "it varies depending on your distribution" over and over when searching for …
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now