Koozali.org: home of the SME Server

rpmdb error can't install/update any rpms

webster

rpmdb error can't install/update any rpms
« on: February 24, 2004, 11:36:46 AM »
one of the machines I installed for a client had a weeeee crash...
I wasn't able to be onsite to fix it as we are now in different countries... so i managed to walk him though to get it up and running.
I have since ordered the client to put a UPS on it and growled for not having one in the first place...

Anyway the OS seems to be running fine but now when trying to install some new rpms i am seeing all sorts of errors...some say

rpmdb: read: 0x40097a84, 4096: Input/output error
error: db4 error(5) from dbcursor->c_get: Input/output error

and others say things like

error: failed dependencies:
e-smith-base is needed by dmc-mitel-diskusage-0.0.1-1
e-smith-release >= 4.1 is needed by dmc-mitel-diskusage-0.0.1-1
/bin/sh   is needed by dmc-mitel-diskusage-0.0.1-1
/bin/sh   is needed by dmc-mitel-diskusage-0.0.1-1
/bin/sh   is needed by dmc-mitel-diskusage-0.0.1-1
/bin/sh   is needed by dmc-mitel-diskusage-0.0.1-1

i searched and found rpm --rebuilddb  hoping this may help but it didn't  :cry:

please tell me there an easy fix or I'm not really able to looking at a reinstall just yet! I won't be there for several months... so without being able to install rpms it makes it hard to keep it up to day with patches etc

Hope someone can help
Thanks
T

Offline smeghead

  • *
  • 563
  • +0/-0
rpmdb error can't install/update any rpms
« Reply #1 on: February 24, 2004, 09:13:32 PM »
try:

rpm --initdb (creates a new database file)

followed by

rpm --rebuilddb -v (updates the new database from the installed package headers and displays verbose info)

HTH
..................

webster

rpmdb error can't install/update any rpms
« Reply #2 on: February 25, 2004, 12:16:25 AM »
Quote from: "smeghead"
try:

rpm --initdb (creates a new database file)

followed by

rpm --rebuilddb -v (updates the new database from the installed package headers and displays verbose info)

HTH


I take it is not a good sign the it doesn't return anything

[root@server root]# rpm --initdb
[root@server root]# rpm --rebuilddb -v
[root@server root]#

Offline smeghead

  • *
  • 563
  • +0/-0
rpmdb error can't install/update any rpms
« Reply #3 on: February 25, 2004, 04:56:02 AM »
.. they do not return any messages so now try to query the rpm database by asking for the version of the kernel:  rpm -qa kernel, it should reply with the version and not an error.
..................

webster

rpmdb error can't install/update any rpms
« Reply #4 on: February 25, 2004, 10:19:12 AM »
[root@server root]# rpm -qa kernel
[root@server root]#

 :-(

Offline smeghead

  • *
  • 563
  • +0/-0
rpmdb error can't install/update any rpms
« Reply #5 on: February 25, 2004, 05:23:22 PM »
hmm, try just rpm -qa

This should list all the packages installed on your system.

After the power failure I presume that you booted to single user and ran:
       fsck /
and corrected any errors.

Check the /var/lib/rpm folder (see if it exists and if it has any contents).  If either of these assertions are false then run the following (perhaps do it anyway to be sure):

a)  chown rpm:rpm /var/lib/rpm (set folder ownership to rpm)
b)  chmod 755 /var/lib/rpm (set permission on folder)
c)  chown root:root /var/lib/rpm/* (set file ownership in folder to root)
d)  chmod 644 /var/lib/rpm/* (set permission on files in folder)

Use Midnight Commander (mc at the prompt) if you find it easier.

This is how my SME 6.0 is setup by default.  The list of files in the folder should be the same or very similar:

-rw-r--r--    1 root     root      1351680 Feb 25 04:06 Basenames
-rw-r--r--    1 root     root        12288 Feb 25 04:06 Conflictname
-rw-r--r--    1 root     root       356352 Feb 25 04:06 Dirnames
-rw-r--r--    1 root     root      1323008 Feb 25 04:06 Filemd5s
-rw-r--r--    1 root     root        12288 Feb 25 04:06 Group
-rw-r--r--    1 root     root        12288 Feb 25 04:06 Installtid
-rw-r--r--    1 root     root        24576 Feb 25 04:06 Name
-rw-r--r--    1 root     root      8142848 Feb 25 04:06 Packages
-rw-r--r--    1 root     root        94208 Feb 25 04:06 Providename
-rw-r--r--    1 root     root        40960 Feb 25 04:06 Provideversion
-rw-r--r--    1 root     root        69632 Feb 25 04:06 Requirename
-rw-r--r--    1 root     root        53248 Feb 25 04:06 Requireversion
-rw-r--r--    1 root     root        45056 Feb 25 04:06 Sha1header
-rw-r--r--    1 root     root        24576 Feb 25 04:06 Sigmd5
-rw-r--r--    1 root     root        12288 Feb 25 04:06 Triggername

If you dont have these files then you need to acquire them for your version (perhaps you could do a base install on a test system and them send them to the remote site).

If not, I would suggest that an 'upgrade' install over the top of your current setup may be the only way to resolve this; educated guess.

An upgrade install could be done by an end user with instruction over the phone as it requires no setup from them.

I am now officially out of ideas, good luck :-)
..................

webster

rpmdb error can't install/update any rpms
« Reply #6 on: February 26, 2004, 02:25:19 AM »
Hmmmmm i thinks i am missing lots by the looks of things!

after running rpm -qa  it gives me the following... I compared it to another box of mine and it thinks its and its missing half the files!...
with this knowledge do you think copying my rpmdb from my box to his will fix it?  :-?

[root@sentry rpm]# rpm -qa
basesystem-7.0-2
eject-2.0.12-4
mailx-8.1.1-22
perl-DBI-1.21-1
perl-MIME-Base64-2.12-14
perl-Time-HiRes-1.20-14
shadow-utils-20000902-7es1
e-smith-4.2.0-06
cpio-2.4.2-26
mtools-3.9.8-2
raidtools-1.00.2-1.3
sysklogd-1.4.1-8
utempter-0.5.2-6
mc-4.5.55-5
kudzu-0.99.52-1
file-3.39-8.7x
e-smith-lib-Tai64n-1.14.0-02
bzip2-libs-1.0.2-2
glib-1.2.10-5
mm-1.1.3-11
perl-Digest-SHA1-2.01-1
perl-Net-Ping-2.28-1
perl-WWW-Automate-0.20-1
strace-4.4-9.1
freetype-2.0.9-2
at-3.1.8-23
curl-7.9.5-2
rootfiles-7.2-1
textutils-2.0.21-1
which-2.13-3
perl-Authen-PAM-0.12-1
mkbootdisk-1.4.3-1es2
libpng-1.0.14-0.7x.4
indexhtml-7.3-3
cracklib-2.7-15
iputils-20020124-3
net-tools-1.60-4
perl-gettext-1.01-10
perl-Quota-1.4.8-1
pwdb-0.61.2-2
tcp_wrappers-7.6-19
lockdev-1.0.0-16
ash-0.3.7-2
procps-2.0.7-12
kbdconfig-1.9.15-2
time-1.7-16
cracklib-dicts-2.7-15
samba-common-2.2.8a-1es1
squid-2.4.STABLE6-6.7.3
mod_auth_external-2.1.2-6
sash-3.4-11
db3-3.3.11-6
libtool-libs-1.4.2-7
perl-Convert-ASN1-0.07-10
perl-I18N-LangTags-0.27-1es3
perl-Test-Simple-0.42-1
qmail-qfilter-1.5-1
bzip2-1.0.2-2
mdadm-1.0.0-6
flexbackup-1.1.7-1es
aspell-en-ca-0.33.7.1-9
SMEServer-6.0-04
ucspi-tcp-0.88-03
cyrus-sasl-1.5.24-25
krb5-libs-1.2.4-11
vim-enhanced-6.1-18.7x.2
[root@sentry rpm]#

Offline smeghead

  • *
  • 563
  • +0/-0
rpmdb error can't install/update any rpms
« Reply #7 on: February 27, 2004, 11:19:59 AM »
... your best bet is an upgrade install over the top of what you have; this will verify and validate a lot of other stuff under the bonnet that may be broken but you don't know it yet.

Ghost the HDD prior to the upgrade to be safe.
..................