LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 06-06-2006, 01:56 PM   #1
gfem
Member
 
Registered: Apr 2003
Distribution: Fedora
Posts: 126

Rep: Reputation: 15
apt-get upgrade removed rpm help!!


I did an apt-get upgrade and it removed rpm and apt oops. Is there any way I can install rpm without having to compile it? I am using 2.6.12-1.1381_FC3smp.

Thanks for helping correct a stupid mistake
 
Old 06-06-2006, 02:49 PM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,393
Blog Entries: 55

Rep: Reputation: 3565Reputation: 3565Reputation: 3565Reputation: 3565Reputation: 3565Reputation: 3565Reputation: 3565Reputation: 3565Reputation: 3565Reputation: 3565Reputation: 3565
Boot your installer CDR/DVD in rescue mode, mount partition and use rpm command to install (watch the --dbdir and --root args).


I did an apt-get upgrade and it removed rpm and apt oops.
It's highly unlikely it made a mistake.
Most mistakes are made by wetware.
 
Old 06-06-2006, 03:35 PM   #3
gfem
Member
 
Registered: Apr 2003
Distribution: Fedora
Posts: 126

Original Poster
Rep: Reputation: 15
I don't unserstand how to install it on the mounted partition? is --dbdir and option for apt ? sorry for the stupid question, but as you can see I did delete rpm to begin with.
 
Old 06-08-2006, 07:08 AM   #4
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,393
Blog Entries: 55

Rep: Reputation: 3565Reputation: 3565Reputation: 3565Reputation: 3565Reputation: 3565Reputation: 3565Reputation: 3565Reputation: 3565Reputation: 3565Reputation: 3565Reputation: 3565
Now I don't know if by booting you loose access to the RPMS dir on the disk, so maybe you should first copy the rpm.*.rpm rpm's to your partition (say /tmp). Now if you boot your installer CDR/DVD in rescue mode it will give you access to the binaries on the CDR/DVD, amongst which is rpm. Rescue mode should mount your partitions, the --dbpath parameter tells rpm on which mounted(!) partition the rpm database resides. So:
0. Note on which partition /var is: "grep /var /etc/fstab",
1. Mount the rescue CDR/DVD and copy the rpm's to your /tmp: "find /mnt/cdrom -type f -name "rpm-\*.rpm"|xargs -iF cp 'F' /tmp",
2. Boot your installer CDR/DVD in rescue mode and find out where the /tmp and /var partitions are mounted: "mount",
3. Test installing the rpm's: "rpm --test --force -i --dbpath /mnt/varpartitionname/var/lib/rpm /mnt/tmppartitionname/*.rpm". If the test went w/o errors remove the "--test" argument and repeat to install.

If any of this causes errors you could (if you have access to a writable partition or can mount a floppy) append this command to get output to file: "2>&1|tee -a /mnt/tmppartitionname/error.log". Else write it down. If you post errors, please make sure you post *exact* errors, not aproximations.
 
Old 06-09-2006, 02:01 AM   #5
gfem
Member
 
Registered: Apr 2003
Distribution: Fedora
Posts: 126

Original Poster
Rep: Reputation: 15
okay i mounted it from another fc install and got this error.....

root@berry mnt]# rpm --test --force -i --dbpath /mnt/data/var/lib/rpm /mnt/data/tmp/librpm4.4-4.4.2-15.1_58.rhfc3.at.i386.rpm
rpmdb: Program version 4.2 doesn't match environment version
error: db4 error(22) from dbenv->open: Invalid argument
error: cannot open Packages index using db3 - Invalid argument (22)
error: cannot open Packages database in /mnt/data/var/lib/rpm
warning: /mnt/data/tmp/librpm4.4-4.4.2-15.1_58.rhfc3.at.i386.rpm: V3 DSA signature: NOKEY, key ID 66534c2b
rpmdb: Program version 4.2 doesn't match environment version
error: db4 error(22) from dbenv->open: Invalid argument
error: cannot open Packages database in /mnt/data/var/lib/rpm

I deleted the db and forced packeges and now I get a Segmentation fault when I run an rpm command.
Am I doomed to perform an upgrade?

Last edited by gfem; 06-09-2006 at 05:20 PM.
 
Old 06-11-2006, 07:47 PM   #6
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,393
Blog Entries: 55

Rep: Reputation: 3565Reputation: 3565Reputation: 3565Reputation: 3565Reputation: 3565Reputation: 3565Reputation: 3565Reputation: 3565Reputation: 3565Reputation: 3565Reputation: 3565
I deleted the db
From the errors you posted it needed either "rm -rf /var/lib/rpm/__db*" or --rebuilddb to work. Anyway. None of that matters anymore. FYI, the database holds all the information about packages you installed. Needless to say deleting the database ain't good and nobody sane would ever give you that as advice.


and forced packeges and now I get a Segmentation fault when I run an rpm command
Since you chose to wander off and fsck it up all by yourself (I mean, I didn't tell you to delete the database, right?) I'm wondering what good it possibly would do to give you any more advice?..

OK. Here's one scenario. YMMV(VM).
Backup files, rpm database of what's left,
Boot your distro's rescue DVD that comes with this release and install right versions of rpm, popt, and db(3 or4),
Do an --initdb to another --dbpath than /var/lib/rpm,
Now if you still have a (cronjob generated) /var/log/rpmpkgs you could be able to get the database going by installing ("importing", more likely) packages using --justdb --noscripts but to what extent I don't know. That's why Your Mileage May Vary (Very Much).

Before you do this however you might want to think about investing more time in repairing this without any guarantees or making a backup, nuking the install and starting afresh.

Last edited by unSpawn; 06-11-2006 at 07:48 PM.
 
Old 06-12-2006, 11:36 AM   #7
gfem
Member
 
Registered: Apr 2003
Distribution: Fedora
Posts: 126

Original Poster
Rep: Reputation: 15
I didn't remove the db I renamed it so I still have the original. I noticed over the weekend that I forgot the --root option, once I renamed the backups to the directory it worked fine. Thank you for your help. That is what I get for trying to repair it from work during a lunch break.

-Gregg
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
apt removed KDE bongenheimer Debian 4 09-08-2005 12:40 AM
Does apt-get/aptitude's purge option removed required dep of other packages? Akhran Debian 1 09-05-2005 07:52 PM
apt-rpm, SuSE 8.2 upgrade, and package conflicts bigrigdriver Linux - Software 2 05-28-2005 04:23 PM
What's the difference between apt-get upgrade and apt-get dist-upgrade? davidas Linux - Newbie 4 04-04-2004 09:19 PM
rpm removed packages log? jpokrzyk Linux - General 1 02-15-2004 12:24 AM

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

All times are GMT -5. The time now is 07:17 PM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration