简体   繁体   English

如何删除损坏的 glibc 安装

[英]How to remove a broken installation of glibc

I just attempted to install glibc version 2.19 to my computer as follows:我只是尝试将glibc 2.19版安装到我的计算机上,如下所示:

1) I cloned the glibc git repo with 1)我克隆了glibc git repo

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

2) I checked out version 2.19 with 2)我检查了2.19

$ git co tags/glibc-2.19

3) I made a directory objdir in my home directory, and built the installation there with 3)我在我的主目录中objdir了一个目录objdir ,并在那里构建了安装

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

4) I tested the make with 4)我用

$ 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 5)我试图安装glibc

$ 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.安装中途失败,现在使用损坏的glibc ,我的用户帐户完全停止工作。

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 .幸运的是,我的系统管理员能够移动我的.bashrc - 它指向我的主目录下损坏的glibc - 并将我恢复到默认的.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?我的问题是,我应该怎么做才能完全删除驻留在我的主目录下的损坏的glibc安装?

what should I do to completely remove the broken installation of glibc that resides under my home directory我应该怎么做才能完全删除位于我的主目录下的损坏的 glibc 安装

cd && ls -lrt

will show you files and directories that were installed.将显示已安装的文件和目录。 Likely you have include/ , lib/ (or lib64/ ), etc/ and possibly some more.可能你有include/lib/ (或lib64/ )、 etc/ ,可能还有更多。 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鉴于我已经将 glibc 以外的东西安装到我的主目录

I hope you realize by now that installing anything into your home directory is a bad idea(TM).我希望您现在意识到将任何东西安装到您的主目录中都是一个坏主意(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:假设您glibc 安装失败没有安装任何东西,并且您的 glibc 安装失败发生在过去 3 天内,以下命令可能会产生令人满意的结果:

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).现在检查/tmp/to-delete是否有您不想/tmp/to-delete的任何文件(如果我的假设成立,则不应有任何此类文件)。

Finally, remove them with:最后,删除它们:

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

Update2:更新2:

unfortunately, i don't think your "last 3 days" heuristic is going to work here.不幸的是,我认为您的“最后 3 天”启发式方法在这里不起作用。 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.我昨天安装了一堆 C 库——MPFC、GMP、MPC 和 glibc——我完全不清楚哪些文件是 glibc 的一部分而不是其他文件。

Ok then.好吧。 What you want to do is find a list of files that are part of glibc install.您想要做的是找到作为 glibc 安装一部分的文件列表。 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 .您现在在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.) (最后一个命令将无法删除任何非空目录,这正是您想要的。)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM