# [Solved]Unmerged openssl and now the entire system is broken

## aspenbordr

I should have known better, but in a moment of weak judgement, I unmerged openssl when it was blocking another package. As you'd expect, this is a big problem, and now almost nothing on my system works (I can't even login).

The problem that I see in the startup sequence is:

```

error while loading shared libraries: libssl.so.0.9.8: cannot open shared object file: No such file or directory

```

I downloaded source for openssl 0.9.8 from their website, booted my system from the CD, chrooted into my broken system and installed the source, then symlinked /etc/ssl to /usr/local/, but still no luck.

What am I missing? How can I "plug-in" the from-source version of openssl so I can at least login and get portage working?

ThanksLast edited by aspenbordr on Tue May 25, 2010 1:01 am; edited 1 time in total

----------

## NeddySeagoon

aspenbordr,

Get the binary package from tinderbox.dev.gentoo.org and untar it to your gentoo /, as if it were a mini stage3.

Thats tar -xpjf <tarball>  

Ignore the warning about trailing garbage ignored ... thats extra data for use by emerge -K

When its back, emerge your own version so it built with your flags

----------

## erik258

You appear to be in luck.  The version of libssl you're missing, 0.9.8, is in a current x86 stage3.  Also looks to be current for amd64.  If you're feeling trustful, you can download a version of either here: 

http://spore.ath.cx/~dan/openssl

There's no guarantee that these builds will work with your system, but they might.  The 32 bit almost certainly will because it's from a stage3 and therefore generic (it just so happens I just unpacked one).  The 64 bit is probably built for the opteron system I pulled it off - so if your processor isn't compatible with a k8, whether it works depends on whether it's actually used any processor-specific operations.  You'll probably still have to use thought #1 below to get into a working shell, then you can download with

wget http://spore.ath.cx/~dan/openssl/32/libssl.so.0.9.8

 or (for 64 bit)

wget http://spore.ath.cx/~dan/openssl/64/libssl.so.0.9.8

Or, if you want to play it safe security-wise (these binaries are perfectly safe, but for the security conscious, taking the provider's word for it probably isn't reassuring), you can download and extract a stage3 for your platform and copy the file over.  

I'm pretty sure that if you get the right version of this library this process will work just fine.  

My original post was looking something like the following.

You might be able to work around the problem and get your system working again without doing anything too drastic.  

My first thought is booting with 'init=/sbin/bash' appended to your kernel parameters.  that will skip the entire init system and throw you in bash.  None of your startup services will have been started, so you'll have to 'mount -o remount,rw /' and maybe mount some other of your file systems, maybe also bring up a few other necessary services manually, but once you're done with that, with a little luck, you'll be able to re-merge openssl.  (my concern however is that programs you'll need to run to remerge will themselves require ssl).  

My second thought is, if only you had that one library file, you might be able to grab a compatible build of the openssl shared object file you're missing from another system.  If you drop it in place you might be able to get an openssl emerge to succeed that way.  I know it sounds far fetched, but it wouldn't be too out of line with my experiences if that worked.  But of course it will have to be compatible with the system - built for the same or compatible architecture.  

Finally, there's always the --root option to emerge.  You might just be able to emerge openssl into your borked system from another system with --root.  Of course, you'll need another - working - gentoo system to do this.

----------

## aspenbordr

Well, I transplanted to libssl file (and then libcrypto from another system since it was asking for that) ... and emerge worked again. I re-emerged openssl, and everything seemed to go fine, but I still can't login.

When the prompt comes up, I enter my username, and it just says "Login incorrect" without even asking for a password. Does the same when I enter 'root' as the username.

So we're getting there....but not quite done yet. Is it possible that somehow the list of usernames on the system got wiped out with the original unmerge?

----------

## erik258

Not very likely.  I would think that maybe something is wrong with PAM.  Have you been messing with any other critical pacakges ; ) ?

----------

## aspenbordr

Awesome, that fixed it. I had unmerged PAM (...again, not one of my more clearheaded moments) but hadn't thought of that in the midst of fixing openssl. Re-emerging PAM while chrooted from the install disk fixed everything.

Thanks for your help

----------

## erik258

Woot!  I was skeptical about that one.  Glad it worked.   I've done worse myself, when not at my best.

----------

