Today I was working on a Gentoo Mirror that was entirely messed up.

grep: error while loading shared libraries:

In fact, I think I broke it while I was running some test scripts on this production machine (oops)! I learned this: NEVER TEST SCRIPTS ON YOUR PRODUCTION MACHINES! YOU COULD REALLY MESS SOMETHING UP!!

Always test things on machines that can “afford” to be broken. It’s nice having a virtual machine for these types of things. The problem I was having is that somehow (little did I know) the system’s grep tool got messed up. This meant that autoconfig would fail almost every time and I couldn’t update any packages. I had to turn to the Gentoo community on IRC (Internet Relay Chat) for help with this one (thanks iamben for giving good advise).

The error I was having was similar to the error this guy was having on the Gentoo Forum. I fixed it by running these commands, in this sequence:

emerge -uN grep

emerge -uN libpcre


emerge @preserved-rebuild

After that I could update all the ret

As my Linux knowledge continues to increase I’ve realized there is so much to learn about the way things work! Having a knowledge of the way things work helps you when troubleshooting to a large degree. Otherwise you’re “working blind” and just moving from forum to forum trying different commands and hoping they fix something.