你如何在* nix中卸载?

时间:2022-02-05 15:28:45

One of the things I still can't wrap my head around is rules of thumb to uninstall programs in *nix environments. 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.

我仍然无法解决的一件事是在* nix环境中卸载程序的经验法则。大多数时候,我很高兴让睡觉的狗撒谎,而不是卸载我不再需要的软件。但是我不时会遇到几个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. Very rarely there's an uninstall script somewhere in the app's folder, something like uninstall.sh

1)如果使用apt-get或yum安装,则有一个卸载命令。很少在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. 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.

5)删除我不再想要的东西。如果应用程序仅安装在一个文件夹中,那么这个很容易,但如果有多个文件夹则很棘手。我听说过的一个技巧是运行一个带有时间范围的查找来查找安装发生时所发生变化的所有文件 - 大致显示更改和添加的内容。

Do you have anything to add/correct?

你有什么要补充/纠正的吗?

2 个解决方案

#1


6  

If you didn't use a package manager (rpm, apt, etc), then you probably installed from source. To install, you performed a process along the lines of ./configure && make && make install. If the application is well-behaved, that "install" make target should be coupled with an "uninstall" target. So extract the sources again, configure again (with the same paths), and make uninstall.

如果您没有使用包管理器(rpm,apt等),那么您可能从源代码安装。要安装,您执行了./configure && make && make install的过程。如果应用程序运行良好,那么“安装”make目标应该与“卸载”目标结合使用。因此,再次提取源,再次配置(使用相同的路径),然后进行卸载。

#2


5  

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. 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).

与往常一样,阅读程序的README或INSTALL文件以确定可用的内容。在大多数情况下,您可以通过包管理器安装一些东西(也可以处理卸载),或者您已经调用了某种手动过程(应该附带解释如何卸载它的自述文件)。

#1


6  

If you didn't use a package manager (rpm, apt, etc), then you probably installed from source. To install, you performed a process along the lines of ./configure && make && make install. If the application is well-behaved, that "install" make target should be coupled with an "uninstall" target. So extract the sources again, configure again (with the same paths), and make uninstall.

如果您没有使用包管理器(rpm,apt等),那么您可能从源代码安装。要安装,您执行了./configure && make && make install的过程。如果应用程序运行良好,那么“安装”make目标应该与“卸载”目标结合使用。因此,再次提取源,再次配置(使用相同的路径),然后进行卸载。

#2


5  

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. 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).

与往常一样,阅读程序的README或INSTALL文件以确定可用的内容。在大多数情况下,您可以通过包管理器安装一些东西(也可以处理卸载),或者您已经调用了某种手动过程(应该附带解释如何卸载它的自述文件)。