LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Fedora
User Name
Password
Fedora This forum is for the discussion of the Fedora Project.

Notices


Reply
  Search this Thread
Old 02-14-2005, 08:04 PM   #1
Jamo
LQ Newbie
 
Registered: Feb 2005
Location: Tampere, Finland
Distribution: Fedora Core 6
Posts: 26

Rep: Reputation: 15
FC3: RPM won't do anything (query, remove)


Hello all RPM gurus,

I downloaded some official Fedora 3 update packages with yum and noticed that RPM process is stuck (it was there for whole day and ate all CPU). I killed it off and tried to continue updating system, but it seems RPM won't do anything anymore.

I've tried to remove __db* files from /var/lib/rpm/ and rebuild RPM database, but that didn't do anything. /var/lib/rpm/ contains still files and what I can tell with e.g. 'strings Basenames' there is still package related information inside.

Other than this RPM related problem, my system works normally, I just can't add or remove RPM packages. Compiling from source is though always option... NOT. ;-)

Code:
rpm --version
RPM version 4.3.2

uname -s -r -v
Linux 2.6.9-1.678_FC3 #1 Mon Nov 15 18:28:07 EST 2004

Few examples (run with root shell):

This outputs nothing:
Code:
dogville:~# rpm -qa
But for example rpm -qip works normally, RPM displays package information.

More accurate information:
Code:
dogville:~# rpm -v -v -qa
D: opening  db environment /var/lib/rpm/Packages joinenv
D: opening  db index       /var/lib/rpm/Packages rdonly mode=0x0
D: locked   db index       /var/lib/rpm/Packages
D: closed   db index       /var/lib/rpm/Packages
D: closed   db environment /var/lib/rpm/Packages
This recreates __db* files but won't fix the system. I have had broken RPM 3.2 database when I used RH9 and this fixed it. Also removing __db* files and rebuilding DB seems to be only instruction what I have found on the net with Googling.
Code:
dogville:~# rpm -v -v --rebuilddb
D: rebuilding database /var/lib/rpm into /var/lib/rpmrebuilddb.32679
D: creating directory /var/lib/rpmrebuilddb.32679
D: opening old database with dbapi 3
D: opening  db environment /var/lib/rpm/Packages joinenv
D: opening  db index       /var/lib/rpm/Packages rdonly mode=0x0
D: locked   db index       /var/lib/rpm/Packages
D: opening new database with dbapi 3
D: opening  db environment /var/lib/rpmrebuilddb.32679/Packages create:mpool
D: opening  db index       /var/lib/rpmrebuilddb.32679/Packages create mode=0x42
D: closed   db index       /var/lib/rpm/Packages
D: closed   db environment /var/lib/rpm/Packages
D: closed   db index       /var/lib/rpmrebuilddb.32679/Packages
D: closed   db environment /var/lib/rpmrebuilddb.32679/Packages
D: removing directory /var/lib/rpmrebuilddb.32679
And of course I can't install new packages as there are missing dependencies because RPM can't find *any* installed packages:
Code:
dogville:/home/jamo/MyDownloads# rpm -ivh jdk-1_5_0-rc-linux-i586.rpm
error: Failed dependencies:
        glibc >= 2.1.2-11 is needed by jdk-1.5.0-rc.i586
        sh-utils >= 2.0-1 is needed by jdk-1.5.0-rc.i586
        fileutils >= 4.0-8 is needed by jdk-1.5.0-rc.i586
        gawk >= 3.0.4-1 is needed by jdk-1.5.0-rc.i586
        textutils >= 2.0-2 is needed by jdk-1.5.0-rc.i586
        /bin/sh is needed by jdk-1.5.0-rc.i586
/var/lib/rpm looks like this:
Code:
ls -la /var/lib/rpm/*
-rw-r--r--  1 rpm  rpm  10608640 Jan 20 03:06 /var/lib/rpm/Basenames
-rw-r--r--  1 rpm  rpm     12288 Dec 31 11:57 /var/lib/rpm/Conflictname
-rw-r--r--  1 root root    16384 Feb 15 03:46 /var/lib/rpm/__db.001
-rw-r--r--  1 root root  1318912 Feb 15 03:46 /var/lib/rpm/__db.002
-rw-r--r--  1 root root   901120 Feb 15 03:46 /var/lib/rpm/__db.003
-rw-r--r--  1 rpm  rpm   3141632 Jan 20 03:06 /var/lib/rpm/Dirnames
-rw-r--r--  1 rpm  rpm  10510336 Jan 20 03:06 /var/lib/rpm/Filemd5s
-rw-r--r--  1 rpm  rpm     24576 Jan 20 03:06 /var/lib/rpm/Group
-rw-r--r--  1 rpm  rpm     20480 Jan 20 03:06 /var/lib/rpm/Installtid
-rw-r--r--  1 rpm  rpm     45056 Jan 20 03:06 /var/lib/rpm/Name
-rw-r--r--  1 rpm  rpm     12288 Jan 26 21:39 /var/lib/rpm/Packages
-rw-r--r--  1 rpm  rpm    339968 Jan 20 03:06 /var/lib/rpm/Providename
-rw-r--r--  1 rpm  rpm    110592 Jan 20 03:06 /var/lib/rpm/Provideversion
-rw-r--r--  1 rpm  rpm     12288 Dec 31 11:57 /var/lib/rpm/Pubkeys
-rw-r--r--  1 rpm  rpm    385024 Jan 20 03:06 /var/lib/rpm/Requirename
-rw-r--r--  1 rpm  rpm    180224 Jan 20 03:06 /var/lib/rpm/Requireversion
-rw-r--r--  1 rpm  rpm     94208 Jan 20 03:06 /var/lib/rpm/Sha1header
-rw-r--r--  1 rpm  rpm     49152 Jan 20 03:06 /var/lib/rpm/Sigmd5
-rw-r--r--  1 rpm  rpm     12288 Jan 20 03:06 /var/lib/rpm/Triggername
Any help would be appreciated. If I can't resolve this, I have to reinstall FC3 from scratch to be able to install new progs... compiling from source isn't for my taste and that's why we need package management! Reinstalling is though a pain because I have large disks full of stuff and I have kept this system since RedHat9 (updates to FC1, FC2 and to FC3 went quite smoothly). Any ideas?
 
Old 02-14-2005, 11:42 PM   #2
enlight1
Member
 
Registered: Jun 2003
Distribution: Fedora 3
Posts: 82

Rep: Reputation: 15
Read up on SELinux in the Fedora FAQ. SELininux can require "relabeling" files to allow proper access for applicatrions. Especially if you have migrated from previous systems.
 
Old 02-15-2005, 06:08 AM   #3
misc
Senior Member
 
Registered: Apr 2003
Distribution: Red Hat + Fedora
Posts: 1,084

Rep: Reputation: 54
Quote:
-rw-r--r-- 1 rpm rpm 12288 Jan 26 21:39 /var/lib/rpm/Packages
Way too short. This should be several MB large. E.g. here:
Quote:
-rw-r--r-- 1 rpm rpm 32083968 Feb 15 12:07 /var/lib/rpm/Packages
 
Old 02-15-2005, 06:45 AM   #4
johnnydangerous
Member
 
Registered: Jan 2005
Location: Sofia, Bulgaria
Distribution: Fedora Core 4 Rawhide
Posts: 431

Rep: Reputation: 30
wow that SELinux is pain in the ass any good docs?
 
Old 02-15-2005, 07:05 AM   #5
misc
Senior Member
 
Registered: Apr 2003
Distribution: Red Hat + Fedora
Posts: 1,084

Rep: Reputation: 54
Simply disable it if you haven't planned to use it.

http://fedora.redhat.com/docs/selinux-faq/
 
Old 02-15-2005, 07:05 AM   #6
Jamo
LQ Newbie
 
Registered: Feb 2005
Location: Tampere, Finland
Distribution: Fedora Core 6
Posts: 26

Original Poster
Rep: Reputation: 15
@enlight1: SELinux is disabled on my system.

Thank you for answers. I take that easiest way is to reinstall whole system to get RPM working again. Well, time to stock fridge with beers and wait for weekend. :-)
 
Old 02-15-2005, 07:11 AM   #7
johnnydangerous
Member
 
Registered: Jan 2005
Location: Sofia, Bulgaria
Distribution: Fedora Core 4 Rawhide
Posts: 431

Rep: Reputation: 30
I use it but aren't those 10000 rules slowing down the system? JAMO maybe u should try some update of rpm else I do the same stock the fridge with beer and... u know
 
Old 02-15-2005, 07:23 AM   #8
misc
Senior Member
 
Registered: Apr 2003
Distribution: Red Hat + Fedora
Posts: 1,084

Rep: Reputation: 54
Quote:
I take that easiest way is to reinstall whole system to get RPM working again.
Well, based on /var/log/rpmpkgs there are ways to restore a deleted or hopelessly damaged RPM database. But it's not trivial, albeit may be easy enough if you find existing scripts somewhere on the Internet.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
rpm query bong.mau Linux - General 2 11-05-2005 10:20 AM
FC3 xorg-x11.6.8.2 fc3 rpm critical fault gregreenwood Linux - Software 0 05-17-2005 02:18 PM
rpm query lucky123 Linux - Newbie 1 04-21-2005 01:41 PM
Winex does not appear in rpm query jorisb Linux - Software 2 02-03-2004 01:29 PM
rpm query size? lf412 Linux - Newbie 3 03-04-2003 12:52 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Fedora

All times are GMT -5. The time now is 05:07 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration