2

I just attempted to install glibc version 2.19 to my computer as follows:

1) I cloned the glibc git repo with

$ cd ~
$ git clone git://sourceware.org/git/glibc.git

2) I checked out version 2.19 with

$ git co tags/glibc-2.19

3) I made a directory objdir in my home directory, and built the installation there with

$ cd ~/objdir
$ ~/glibc/configure --prefix=$HOME
$ make

4) I tested the make with

$ make check

This gave me an error, but some webpage I found with a Google search told me this particular error wasn't a big deal. (I wish I could remember what the error and webpage were, but I can't, and I found the webpage using a computer I don't have access to right now, so it's not on my web history where I'm typing now.)

5) I attempted to install glibc with

$ make install

This is where things went crazy for me. The installation failed midway, and, now using a broken glibc, my user account completely stopped working.

Luckily, my system administrator was able to move my .bashrc -- which was pointing to the broken glibc under my home directory -- and revert me to a default .bashrc. So I can log into my account again and do stuff.

My question is, what should I do to completely remove the broken installation of glibc that resides under my home directory?

abcd
  • 10,215
  • 15
  • 51
  • 85

1 Answers1

2

what should I do to completely remove the broken installation of glibc that resides under my home directory

cd && ls -lrt

will show you files and directories that were installed. Likely you have include/, lib/ (or lib64/), etc/ and possibly some more. Simply remove these directories, and you should be fine.

You may also want to read this answer.

Update:

that command shows me all the directories in my home directory, of which there are many.

It lists them in chronological order (newest last), and so all the files that are modified recently are at the bottom. These are the ones you'll want to remove.

given that i've installed things besides glibc to my home directory

I hope you realize by now that installing anything into your home directory is a bad idea(TM).

Assuming you haven't installed anything after the failed glibc install, and that your failed glibc install happened within last 3 days, the following command is likely to produce satisfactory results:

find include lib etc -mtime -3 | egrep -v '^(include|etc|lib)$' |
  tee /tmp/to-delete

Now examine /tmp/to-delete for any files that you do not want to remove (there shouldn't be any such files if my assumptions hold).

Finally, remove them with:

cat /tmp/to-delete | xargs rm -rf 

Update2:

unfortunately, i don't think your "last 3 days" heuristic is going to work here. i installed a bunch of C libraries yesterday -- MPFC, GMP, MPC, and glibc -- and it's not at all clear to me which files are part of glibc and not the others.

Ok then. What you want to do is find a list of files that are part of glibc install. You can do so:

cd glibc-2.19-src; mkdir build;
cd build; ../configure --prefix `pwd`/../install
make -j12 all && make install

You now have a "cleanly installed" directory in glibc-2.19-src/install. You can get a list of files there:

cd ../install; find . -type f > /tmp/to-delete

Finally you are ready to clean up:

cd; cat /tmp/to-delete | xargs rm -f

This may still leave some empty directories around, but that's generally not a big deal. If you want to remove them as well:

cd ~/glibc-2.19-src/install
find . -type d > /tmp/dirs-to-delete
cd; cat /tmp/dirs-to-delete | xargs rm 2>/dev/null

(The last command will fail to remove any non-empty directories, which is exactly what you want.)

Community
  • 1
  • 1
Employed Russian
  • 199,314
  • 34
  • 295
  • 362
  • that command shows me all the directories in my home directory, of which there are many. `include`, `lib`, and `etc` are present, but, given that i've installed things besides `glibc` to my home directory, i'm guessing these directories contain more than just `glibc`-related stuff. if that's the case, i'd like not to delete everything in them. any advice? – abcd Oct 12 '15 at 02:15
  • thanks, this should get me going. one point to quibble with: you say, "installing anything into your home directory is a bad idea." what? that's crazy talk. i'm not an admin of this system. i can't install things globally. the only place i *can* install things is to my home directory. – abcd Oct 12 '15 at 04:21
  • also, i'm not sure why you're saying that the command you provided without explanation "of course" shows all the directories in my home directory. that it does this is not obvious. the command isn't called "hey-show-me-the-directories-in-my-home-directory." i suppose i should have researched the command, but it would be nice to link to the man page for it in the answer. – abcd Oct 12 '15 at 04:25
  • i would also note that had i had the ability to install `glibc` globally, and had i done that, i would be in much bigger trouble right now than i am. – abcd Oct 12 '15 at 04:28
  • @dbliss "that's crazy talk" -- no, it's not. Don't *ever* install anything into `$HOME`. Install into `$HOME/glibc-2.19-install`, `$HOME/foobar-install`, etc. Have you done that, removing would be as simple as `rm -rf glibc-2.19-install`. – Employed Russian Oct 12 '15 at 04:33
  • unfortunately, i don't think your "last 3 days" heuristic is going to work here. i installed a bunch of C libraries yesterday -- MPFC, GMP, MPC, and glibc -- and it's not at all clear to me which files are part of `glibc` and not the others. so i may just have to delete everything. – abcd Oct 12 '15 at 04:34
  • ah, fair enough. good distinction. but you act like it's not super common to use `$HOME` as an install specification. for example, when installing python packages, it's very common for people to do `pip install --prefix=~`. this puts all the local installations in the same place, which is normally a very nice thing. – abcd Oct 12 '15 at 04:36