Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
|
05-01-2006, 03:37 PM
|
#1
|
Member
Registered: Mar 2006
Distribution: Debian Sarge, Windows Server 2003
Posts: 66
Rep:
|
how to manually install a package when dpkg, apt-get are broken and system wont boot.
my libc6 was removed ignoring dependencies, now i cant execute any commands.
since i have restarted i cant boot and now i am trying to install the package from knoppix.
partition is mounted, chroot is not working.
dpkg returns errors
apt-get needs root changed prior, uses dpkg to install. so wont work.
i need to know how to manually "inject" the package.
|
|
|
05-01-2006, 05:50 PM
|
#2
|
LQ Guru
Registered: Dec 2005
Location: Somewhere on the String
Distribution: Debian Wheezy (x86)
Posts: 6,094
|
You might try typing linux rescue at the boot prompt of your installation CD.
If that doesn't work, try:
1) use the first CD ( or netinstaller CD, same thing)
2) At the begining of installation ( when the partitions are loaded) switch to the shell (ctrl+alt+F2)
3) mkdir /mnt/mydir
4) mount your root partition (example -- /dev/hda1) on directory (/mnt/mydir)
5) chroot /mnt/mydir
That should let you be root on your debian box. And hopefully you can recover. You can try running apt-get -f dist-upgrade and see if that will try to repair the install.
Or maybe try using dselect to reinstall libc6? Or try running base-config to reinitialize your install???
Good luck!
|
|
|
05-01-2006, 06:25 PM
|
#4
|
LQ Guru
Registered: Dec 2005
Location: Somewhere on the String
Distribution: Debian Wheezy (x86)
Posts: 6,094
|
Yikes! Well, I'm afraid I may not be much help then. I've never had to recover from something that bad, and if I did, I just made a backup of important config files and reinstalled, I see where you don't want to do that.
All I can recommend is the above which if you can make them run might help make all the files be "seen" again. If it helps at all, it looks like apt-get and dpkg are under /usr/bin.
Sorry I couldn't be more help, good luck.
|
|
|
05-01-2006, 06:40 PM
|
#5
|
Member
Registered: Mar 2006
Distribution: Debian Sarge, Windows Server 2003
Posts: 66
Original Poster
Rep:
|
unfortinately apt-get does not allow to change root on its own, it is also dependent on dpkg which does not see pre/post install scripts. until the system can see the files again, attempting to install packages is useless. thanks for the help though.
anyone else?
|
|
|
05-01-2006, 06:51 PM
|
#6
|
LQ Guru
Registered: Dec 2005
Location: Somewhere on the String
Distribution: Debian Wheezy (x86)
Posts: 6,094
|
Quote:
Originally Posted by hisnumber666
unfortinately apt-get does not allow to change root on its own
|
Sorry, I guess I don't understand what you mean by this? You are not able to get to root? Or you are not able to change the root filesystem? (No expert, but I thought both of these were things chroot did?)
|
|
|
05-01-2006, 07:06 PM
|
#7
|
Member
Registered: Mar 2006
Distribution: Debian Sarge, Windows Server 2003
Posts: 66
Original Poster
Rep:
|
if you are not in the right root filesystem you are installing packages into the wrong system. yes chroot is the right tool to use, and it doesnt work. dpkg has its own --root option. dpkg fails to install or uninstall packages because it cannot access pre/post install scripts (programs just dont see external files anymore).
here:
root@ttyp0[bin]# chroot /mnt/hda1
chroot: cannot run command `/bin/bash': No such file or direct
basically the system just does not see the designated shell binary that it supposed to run when it changes root.
|
|
|
05-01-2006, 07:24 PM
|
#8
|
LQ Guru
Registered: Dec 2005
Location: Somewhere on the String
Distribution: Debian Wheezy (x86)
Posts: 6,094
|
Have you tried chroot /mnt/hda1 /mnt/hda1/bin/bash?
|
|
|
05-01-2006, 07:30 PM
|
#9
|
LQ Guru
Registered: Dec 2005
Location: Somewhere on the String
Distribution: Debian Wheezy (x86)
Posts: 6,094
|
Found this thread. It looks like they're basically copying files from the live CD to the proper directory. http://www.redhat.com/archives/nahan.../msg00043.html
|
|
|
05-01-2006, 07:39 PM
|
#10
|
LQ Guru
Registered: Dec 2005
Location: Somewhere on the String
Distribution: Debian Wheezy (x86)
Posts: 6,094
|
So if you can mount the old drive from Knoppix at say /mnt/chroot, then copy the right shared libraries over to the /mnt/chroot directories. On my Debian box, the command ldd /bin/bash gives
Code:
libncurses.so.5 => /lib/libncurses.so.5 (0xb7fa2000)
libdl.so.2 => /lib/tls/libdl.so.2 (0xb7f9e000)
libc.so.6 => /lib/tls/libc.so.6 (0xb7e69000)
/lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0xb7fea000)
So from Knoppix (adapted from the link I posted above), try
Code:
[Knoppix ~]# cp /lib/libncurses.so.5 /chroot/lib/libncurses.so.5
[Knoppix ~]# cp /lib/tls/libdl.so.2 /chroot/lib/tls/libd1.so.2
[Knoppix ~]# cp /lib/tls/libc.so.6 /chroot/lib/tls/libc.so.6
[Knoppix ~]# cp /lib/ld-linux.so.2 /chroot/lib/ld-linux.so.2
[Knoppix ~]# chroot /chroot /bin/bash --login
Or look through those directories and see if those files exist and only copy the ones that aren't there (presumably the libc.so.6)... Sorry, not sure if it will work or whether I'm just blowing smoke. I just can't resist a good problem.
|
|
|
05-01-2006, 09:06 PM
|
#11
|
Member
Registered: Mar 2006
Distribution: Debian Sarge, Windows Server 2003
Posts: 66
Original Poster
Rep:
|
good job indeed. you rule. in fact it was only a couple of files i was missing. which turned out to be critical. i guess programmers that wrote linux programs are not up to the same standards i am. my programs are just a bit more verbose.
the binaries and scripts were not missing, but rather the libraries needed to run the binaries were. instead of giving output of the binary, bash just craps out saying something in "does not exist" manner.
i ended up copying entire contents of /lib/ on knoppix onto my system, after that i installed the stable libc6 package and booted without issues.
i still have 47 broken packages... i guess ill wait till libc6 2.4.x comes out for stable.
thanks alot. speaking of which, i am writing a mini guide for installing WineX from CVS (for debian mostly). be on the lookout for it when its done.
is there any way i can help you?
|
|
|
05-01-2006, 10:42 PM
|
#12
|
LQ Guru
Registered: Dec 2005
Location: Somewhere on the String
Distribution: Debian Wheezy (x86)
Posts: 6,094
|
You sound like a pretty tech savvy guy, so the only thing you can help me with right now is to every now and again search the zero reply threads and see if there's anyone you can help out (who knows, it might be me sometime!) That's the thing I like the most about linux is the community. Even people who don't know much about linux can help out other people, even if it is just googling and modifying other people's solutions. Sometimes all it takes is a little bit of translation.
As for the broken packages, you might try apt-get -f dist-upgrade when you're feeling brave again. It should try to fix all the broken packages. Not sure if copying all the /lib directory will cause you problems in the future or not...
|
|
|
05-01-2006, 11:39 PM
|
#13
|
Member
Registered: Mar 2006
Distribution: Debian Sarge, Windows Server 2003
Posts: 66
Original Poster
Rep:
|
a distro upgrade... sounds so good.
29 upgraded, 0 newly installed, 1206 to remove and 1 not upgraded.
Need to get 19.9MB of archives.
After unpacking 2409MB disk space will be freed.
You are about to do something potentially harmful
To continue type in the phrase 'Yes, do as I say!'
?]
i dont think im quite brave enough for that. ill just wait for newer packages to come out to meet dependecies. this is what you get when you mix in testing packages. sometimes you have to do that though... some hardware drivers require those packages to meet dependecies.
im not a linux guru - been an occasional linux user for the last 4 years or so. lack of hardware support/drivers mostly kept me away from it. its getting better these days though. i am sorta handy with computers since i am a certified pc technician and a software developer for Microchip PIC based robot microcontrollers.
up until bugs come, most of os maintenance is no rocket science really. but sometimes you hit a bad one and they can be quite misleading.
|
|
|
05-02-2006, 01:04 AM
|
#14
|
Senior Member
Registered: Mar 2004
Location: far enough
Distribution: OS X 10.6.7
Posts: 1,690
Rep:
|
Code:
29 upgraded, 0 newly installed, 1206 to remove and 1 not upgraded.
Need to get 19.9MB of archives.
After unpacking 2409MB disk space will be freed.
You are about to do something potentially harmful
To continue type in the phrase 'Yes, do as I say!'
?]
The code above look like you were using testing or unstable and you try to downgrade to sarge. The libc6 package and other importants packages could not have been uninstalled without warning you first. Usually what i did when having that problem was using the chroot method.
|
|
|
05-02-2006, 02:06 AM
|
#15
|
Member
Registered: Mar 2006
Distribution: Debian Sarge, Windows Server 2003
Posts: 66
Original Poster
Rep:
|
i had to add a testing repository to my sources to match a dependecy for a hardware driver.
then i installed another package, apt-get installs newest version. newest version of that package triggered updates for a few more packages. a total of 5 or 6 critical packages were installed as testing.
now when i attempt any kind of upgrades i wants to remove all the programs that depend on later version libc. basically you can get a stable version of a program which will require a version of another package that is not yet stable. you will just have to choose. since it was a matter of either having it or not having it i chose to go ahead and install a few testing packages. hopefully as support for Debian Etch gonna start in a couple of weeks there will be packages that will new packages released into stable(and hopefully well working by that time).
does that answer it?
|
|
|
All times are GMT -5. The time now is 11:17 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|