|
Home > Archive > Red Hat Topics > December 2004 > RPM : how to restore RPM when it's broken ?
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
RPM : how to restore RPM when it's broken ?
|
|
|
| Hello,
as I broke my RPM binaries, where can I download a binary version, or an
easy one to compile + install ?
Note: my question doesn't cover the RPM database, but (unfortunately) RPM
itself.
Thanks,
Bruno
| |
| Lenard 2004-12-21, 2:47 am |
| On Mon, 20 Dec 2004 23:50:53 +0100, Bruno wrote:
> Hello,
>
> as I broke my RPM binaries, where can I download a binary version, or an
> easy one to compile + install ?
>
> Note: my question doesn't cover the RPM database, but (unfortunately)
> RPM itself.
Just re-install the ones you have installed using /usr/lib/rpm/rpmi (use
it just like rpm) for the details see; man rpm
--
"They that can give up essential liberty to obtain a little temporary
safety deserve neither liberty nor safety." -- B. Franklin, 1759
| |
|
| Unfortuantely it's all /usr/lib/rpm* which is broken.
I'm looking for an emergency RPM that I can install whitout ... RPM.
Lenard wrote:
> On Mon, 20 Dec 2004 23:50:53 +0100, Bruno wrote:
>
>
> Just re-install the ones you have installed using /usr/lib/rpm/rpmi (use
> it just like rpm) for the details see; man rpm
>
>
| |
| Lenard 2004-12-21, 7:45 am |
| On Tue, 21 Dec 2004 07:26:18 +0100, Bruno wrote:
> Unfortuantely it's all /usr/lib/rpm* which is broken. I'm looking for an
> emergency RPM that I can install whitout ... RPM.
First, please do not top post. Like reading a book you start at the
beginning and read to the finish.
Second, download, burn and use (a live FC3 CD, requires a 700MB CD);
http://ftp.linuxcenter.ru/iso/Linux4all_LiveCd_1.40/
If you are using a different version of Fedora/Red Hat Linux please
identify the version your using. The ISO above should work just fine on
Fedora Core 2/3.
Third, quit playing as root learn how to use 'su' and 'sudo' for
administrative tasks.
--
"They that can give up essential liberty to obtain a little temporary
safety deserve neither liberty nor safety." -- B. Franklin, 1759
| |
| Lenard 2004-12-21, 7:45 am |
| On Tue, 21 Dec 2004 11:45:12 +0000, Lenard wrote:
> On Tue, 21 Dec 2004 07:26:18 +0100, Bruno wrote:
>
>
> First, please do not top post. Like reading a book you start at the
> beginning and read to the finish.
>
> Second, download, burn and use (a live FC3 CD, requires a 700MB CD);
> http://ftp.linuxcenter.ru/iso/Linux4all_LiveCd_1.40/
>
> If you are using a different version of Fedora/Red Hat Linux please
> identify the version your using. The ISO above should work just fine on
> Fedora Core 2/3.
>
> Third, quit playing as root learn how to use 'su' and 'sudo' for
> administrative tasks.
In addition (I almost forgot about this), you can boot your system with
your installation media in rescue mode and use /usr/bin/rpm from the media
to re-install the rpm packages. Just type 'linux rescue' without the
quotes, answer a few questions then when ready re-install the rpm
packages.
--
"They that can give up essential liberty to obtain a little temporary
safety deserve neither liberty nor safety." -- B. Franklin, 1759
| |
|
| Lenard wrote:
> On Tue, 21 Dec 2004 11:45:12 +0000, Lenard wrote:
>
[vbcol=seagreen]
>
> In addition (I almost forgot about this), you can boot your system with
> your installation media in rescue mode and use /usr/bin/rpm from the media
> to re-install the rpm packages. Just type 'linux rescue' without the
> quotes, answer a few questions then when ready re-install the rpm
> packages.
>
>
Thanks Lenard. Looks better as I was able to restore the rpm facilities (via
limux rescue).
However the file Packages (RPM database ?) seems corrupt or not compatible
with the restored RPM which is a 4.2.1 as I received the following when
using some commands to check RPM:
rpm -vv rebuilddb
(...)
error: unrecognized db option: "db3" ignored
(...)
rpm -qa
error: cannot open Packages database in /var/lib/rpm. no packages.
db_verify Packages
db_verify: Program version 4.2 doesn't match environment version
How to be check / confirm versions to be used ?
Is there a way to force rebuild of file Packages ?
Thanks.
Bruno.
| |
| Lenard 2004-12-21, 5:45 pm |
| On Tue, 21 Dec 2004 21:10:33 +0100, Bruno wrote:
> Thanks Lenard. Looks better as I was able to restore the rpm facilities
> (via limux rescue).
> However the file Packages (RPM database ?) seems corrupt or not
> compatible with the restored RPM which is a 4.2.1 as I received the
> following when using some commands to check RPM:
>
> rpm -vv rebuilddb
> (...)
> error: unrecognized db option: "db3" ignored (...)
>
> rpm -qa
> error: cannot open Packages database in /var/lib/rpm. no packages.
>
> db_verify Packages
> db_verify: Program version 4.2 doesn't match environment version
>
>
> How to be check / confirm versions to be used ? Is there a way to force
> rebuild of file Packages ?
What version of Fedora/Red Hat are you running??
Maybe it's time to visit; http://www.rpm.org/hintskinks/repairdb-2003-06/
Follow the directions first, if that does not work then maybe it's time to
file a bug report, if so explain everything;
The version of Linux your using.....distro/kernel/glibc/rpm versions What
you did to corrupt rpm etc, etc
--
"They that can give up essential liberty to obtain a little temporary
safety deserve neither liberty nor safety." -- B. Franklin, 1759
| |
|
| Lenard wrote:
> On Tue, 21 Dec 2004 21:10:33 +0100, Bruno wrote:
>
>
> What version of Fedora/Red Hat are you running??
>
> Maybe it's time to visit; http://www.rpm.org/hintskinks/repairdb-2003-06/
>
> Follow the directions first, if that does not work then maybe it's time to
> file a bug report, if so explain everything;
>
> The version of Linux your using.....distro/kernel/glibc/rpm versions What
> you did to corrupt rpm etc, etc
>
>
I tried the repairdb, but still have problems I mentionned before.
My versions are : Fedora Core-2, but I restored RPM from Core-1 (dont have
Core-2 disk).
Kernel 2.6.5-1.358
RPM 4.2.1
glibc 2.3.3
Regarding what happen..well..doing the following :
cd /var/lib/rpm
rm -f __db*
...I..oopss..delete more than __db*
Seems there is definitely mismatches regarding the version / level installed
on my system (and probably missing files too ?).
Will the upgrade to Core-3 help / be possible ?
| |
| John Thompson 2004-12-22, 2:45 am |
| On 2004-12-20, Bruno <cd1@biz.tiscali.be> wrote:
> as I broke my RPM binaries, where can I download a binary version, or an
> easy one to compile + install ?
You can pick up rpm in tarball format here:
http://www.rpm.org/tools/tarball/
--
John (john@os2.dhs.org)
| |
| Lenard 2004-12-22, 5:45 pm |
| On Wed, 22 Dec 2004 00:23:07 +0100, Bruno wrote:
> I tried the repairdb, but still have problems I mentionned before.
>
> My versions are : Fedora Core-2, but I restored RPM from Core-1 (dont
> have Core-2 disk).
> Kernel 2.6.5-1.358
> RPM 4.2.1
> glibc 2.3.3
>
>
This is your problem, the rpm packages from FC1 will not work with FC2 for
a lot of reasons. You can download the rpm packages and the FC2 rescue CD
image from here (it's a good idea to have this CD);
http://download.fedora.redhat.com/p...ore/2/i386/iso/
FC2-i386-rescuecd.iso 13-May-2004 05:38 75.8M
The rpm packages are here;
http://download.fedora.redhat.com/p...os/Fedora/RPMS/
rpm-4.3.1-0.3.i386.rpm 06-May-2004 18:47 2.2M
rpm-build-4.3.1-0.3.i386.rpm 06-May-2004 18:47 437k
rpm-devel-4.3.1-0.3.i386.rpm 06-May-2004 18:47 3.2M
rpm-python-4.3.1-0.3.i386.rpm 06-May-2004 18:47 82k
After downloading the packages and ISO image. Create the rescue CD and
boot with it. When ready install the correct packages from the location
where they reside; /usr/bin/rpm Uvh rpm*.rpm
> Will the upgrade to Core-3 help / be possible ?
You should correct the rpm problem and database first before attempting to
upgrade. If you want after making a backup of everything important (docs,
configuration settings and anything else of importance) do a clean install
(wipe and load) without having to fix the rpm and database problem.
--
"They that can give up essential liberty to obtain a little temporary
safety deserve neither liberty nor safety." -- B. Franklin, 1759
| |
|
| Lenard wrote:
> On Wed, 22 Dec 2004 00:23:07 +0100, Bruno wrote:
>
> This is your problem, the rpm packages from FC1 will not work with FC2 for
> a lot of reasons. You can download the rpm packages and the FC2 rescue CD
> image from here (it's a good idea to have this CD);
>
> http://download.fedora.redhat.com/p...ore/2/i386/iso/
>
> FC2-i386-rescuecd.iso 13-May-2004 05:38 75.8M
>
> The rpm packages are here;
>
>
http://download.fedora.redhat.com/p...os/Fedora/RPMS/
>
> rpm-4.3.1-0.3.i386.rpm 06-May-2004 18:47 2.2M
> rpm-build-4.3.1-0.3.i386.rpm 06-May-2004 18:47 437k
> rpm-devel-4.3.1-0.3.i386.rpm 06-May-2004 18:47 3.2M
> rpm-python-4.3.1-0.3.i386.rpm 06-May-2004 18:47 82k
>
> After downloading the packages and ISO image. Create the rescue CD and
> boot with it. When ready install the correct packages from the location
> where they reside; /usr/bin/rpm Uvh rpm*.rpm
>
>
> You should correct the rpm problem and database first before attempting to
> upgrade. If you want after making a backup of everything important (docs,
> configuration settings and anything else of importance) do a clean install
> (wipe and load) without having to fix the rpm and database problem.
>
>
I was able to boot with Core-2 (also upgrade, correct ?), but unable to
install the rpm*.rpm as RPM version and/or Package file (size 8.8M) seems
incompatible or corrupted :
rpm -Uvh rpm-4.3.1-0.3.i386.rpm
error: cannot open Packages database in /var/lib/rpm
I tried 'rm -f __db*' and 'rpm --rebuilddb' but it doesn't help.
'rpm -version' return 4.2.1
| |
| Lenard 2004-12-23, 7:45 am |
| On Wed, 22 Dec 2004 22:54:25 +0100, Bruno wrote:
> Lenard wrote:
>
> http://download.fedora.redhat.com/p...os/Fedora/RPMS/
> I was able to boot with Core-2 (also upgrade, correct ?), but unable to
> install the rpm*.rpm as RPM version and/or Package file (size 8.8M)
> seems incompatible or corrupted :
Just to be sure, you did boot into 'rescue mode' from either the rescue CD
or the installation media, correct?
> rpm -Uvh rpm-4.3.1-0.3.i386.rpm
> error: cannot open Packages database in /var/lib/rpm
OK....
> I tried 'rm -f __db*' and 'rpm --rebuilddb' but it doesn't help.
One last thing to try, after booting from the rescue CD or from the FC2
Installation media in 'rescue mode' do;
cd /mnt/sysimage/var/lib/rpm
rm -f /var/lib/rpm/__db*
cd /usr/bin
rpm --initdb
rpm -vv --rebuilddb
Note; this should take a bit of time and produce a lot of output.
When done change directory to where the four rpm-4.3.1 packages are
stored. Notice in the first 'cd command' above '/mnt/sysimage' was used
you will have to specify this in addition to change to the packages are
stored location. For example lets say the four rpm-4.3.1 packages are
stored in your /tmp location you would type; cd /mnt/sysimage/tmp
Now type; /usr/bin/rpm -Uvh rpm*.rpm --force --ignoreos
> 'rpm -version' return 4.2.1
If everything goes right you should see the correct version 4.3.1 here.
Additional help can be found here; http://www.rpm.org/hintskinks/repairdb/
It might be easier to re-install FC2 from scratch or install/upgrade to
FC3.
--
"They that can give up essential liberty to obtain a little temporary
safety deserve neither liberty nor safety." -- B. Franklin, 1759
| |
|
| Lenard wrote:
> On Wed, 22 Dec 2004 22:54:25 +0100, Bruno wrote:
>
http://download.fedora.redhat.com/p...os/Fedora/RPMS/[vbcol=seagreen]
>
> Just to be sure, you did boot into 'rescue mode' from either the rescue CD
> or the installation media, correct?
>
>
>
> OK....
>
>
>
> One last thing to try, after booting from the rescue CD or from the FC2
> Installation media in 'rescue mode' do;
>
> cd /mnt/sysimage/var/lib/rpm
> rm -f /var/lib/rpm/__db*
> cd /usr/bin
> rpm --initdb
> rpm -vv --rebuilddb
> Note; this should take a bit of time and produce a lot of output.
>
> When done change directory to where the four rpm-4.3.1 packages are
> stored. Notice in the first 'cd command' above '/mnt/sysimage' was used
> you will have to specify this in addition to change to the packages are
> stored location. For example lets say the four rpm-4.3.1 packages are
> stored in your /tmp location you would type; cd /mnt/sysimage/tmp
>
> Now type; /usr/bin/rpm -Uvh rpm*.rpm --force --ignoreos
>
>
> If everything goes right you should see the correct version 4.3.1 here.
> Additional help can be found here; http://www.rpm.org/hintskinks/repairdb/
>
> It might be easier to re-install FC2 from scratch or install/upgrade to
> FC3.
>
>
(Lenard: thanks a lot for these informations. I have to leave my computer
until start of January. ASAP I'll continue this work I'll keep you in touch
via this article. Merry Christmas.).
| |
|
| On Wed, 22 Dec 2004 04:07:38 +0000, John Thompson wrote:
> On 2004-12-20, Bruno <cd1@biz.tiscali.be> wrote:
>
>
> You can pick up rpm in tarball format here:
>
> http://www.rpm.org/tools/tarball/
John,
Are you the guy that was hanging around in alt.hacking a few years ago.
Your name seems familiar.
br
Steve
|
|
|
|
|