简体   繁体   English

你如何在* nix中卸载?

[英]How do you uninstall in *nix?

One of the things I still can't wrap my head around is rules of thumb to uninstall programs in *nix environments. 我仍然无法解决的一件事是在* nix环境中卸载程序的经验法则。 Most of the time I'm happy to let the sleeping dogs lie and not uninstall software that I no longer need. 大多数时候,我很高兴让睡觉的狗撒谎,而不是卸载我不再需要的软件。 But from time to time I end up with several Apaches, svn, etc. 但是我不时会遇到几个Apaches,svn等。

So far here's what I know about dealing with this: 到目前为止,我知道处理这个问题:

1) if you installed using apt-get or yum, there's an uninstall command. 1)如果使用apt-get或yum安装,则有一个卸载命令。 Very rarely there's an uninstall script somewhere in the app's folder, something like uninstall.sh 很少在app的文件夹中有一个卸载脚本,比如uninstall.sh

2) to figure out which particular install is being called from the command line use "type -a" command 2)确定从命令行调用哪个特定安装使用“type -a”命令

3) use "sudo find / | grep" to find where else stuff might be installed (from what I understand type only looks for things that are in the PATH variable) 3)使用“sudo find / | grep”查找可能安装的其他东西(从我理解的类型只查找PATH变量中的内容)

4) Add/change order of things in PATH to make the desireable version of the app to be first in line or add an alias to .bashrc 4)在PATH中添加/更改事物的顺序,以使应用程序的首选版本排在第一位或为.bashrc添加别名

5) delete the stuff I no longer want. 5)删除我不再想要的东西。 This one is easy if the application was installed only in one folder, but tricky if there are multiple. 如果应用程序只安装在一个文件夹中,那么这个很容易,但如果有多个文件夹则很棘手。 One trick that I've heard of is running a find with a time range to find all the files that changed arount the time when the install happened - that roughly shows what was changed and added. 我听说过的一个技巧是运行一个带有时间范围的查找,以便在安装发生时查找所有更改的文件 - 大致显示更改和添加的内容。

Do you have anything to add/correct? 你有什么要补充/纠正的吗?

If you didn't use a package manager (rpm, apt, etc), then you probably installed from source. 如果您没有使用包管理器(rpm,apt等),那么您可能从源代码安装。 To install, you performed a process along the lines of ./configure && make && make install. 要安装,您执行了./configure && make && make install的过程。 If the application is well-behaved, that "install" make target should be coupled with an "uninstall" target. 如果应用程序表现良好,则“安装”make目标应与“卸载”目标结合使用。 So extract the sources again, configure again (with the same paths), and make uninstall. 因此,再次提取源,再次配置(使用相同的路径),然后进行卸载。

Generally, if you're compiling something from source, the procedure will be 通常,如果您从源代码编译某些内容,则该过程将是

$ make
$ su
# make install

in which case, the vast majority of programs will have an uninstall target, which will let you reverse the steps that happened during install by 在这种情况下,绝大多数程序都有一个卸载目标,这将允许您反转安装过程中发生的步骤

$ su
# make uninstall

As always, read the program's README or INSTALL files to determine what's available. 与往常一样,阅读程序的README或INSTALL文件以确定可用的内容。 In most situations you'll either install something via a package manager (which will also handle the uninstall), or you'll have invoked some kind of manual process (which should have come with a readme explaining how to uninstall it). 在大多数情况下,您可以通过包管理器(也将处理卸载)安装一些东西,或者您将调用某种手动过程(应该附带一个自述文件,说明如何卸载它)。

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

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