在Linux上卸载 [英] uninstalling on linux

查看:116
本文介绍了在Linux上卸载的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是在Linux上编译和安装程序的新手.我了解常见的流程是 ./configure

I'm new to compiling and installing programs on linux. I understand the common process is to do ./configure

make

make install

我想知道如果我在某个地方犯了错误或出了什么问题,是否可以通过某种方式回滚".

I'd like to know if there is some way I can "rollback" if I make a mistake somewhere or if something goes wrong.

推荐答案

同意其他答案,我想澄清一下.如果我的理解是正确的,通常./configure是可确保/设置系统以便正确进行编译的脚本.然后make运行一个实际编译的Makefile.然后make install使用install作为参数运行makefile,该文件实际上将二进制文件和配置文件复制到适当的(由脚本作者确定)系统目录,这就是为什么make install经常必须以提升的特权运行的原因.

Agree with other answers, and I wanted to clarify a bit. If my understanding is correct, typically ./configure is a script that makes sure / sets up your system so that compilation will go correctly. Then make runs a Makefile that actually compiles. Then make install runs the makefile with install as a parameter that actually copies your binaries and config files to the appropriate (as determined by the script author) system directories, which is why often make install must be run with elevated privileges.

通常,make脚本使用一个uninstall参数,该参数实际上会擦除复制到系统目录中的所有内容.以我的经验,这并不总是一个干净的过程.在没有确保自己能够完美跟踪所有更改并自己编写回滚脚本的情况下,没有回滚的防火方法.

Often the make script takes an uninstall parameter that actually erases everything that was copied to system directories. In my experience, this isn't always going to be a clean process. There's no fireproof way to roll back without ensuring yourself that all changes are tracked perfectly and writing the rollback script yourself.

简而言之,请尝试make uninstall,如果该方法不起作用并且您自己也无法解决,请尝试在与该特定产品相关的邮件列表或论坛上发帖.

In short, try make uninstall and if that doesn't work and you can't figure it out yourself, try posting on a mailing list or forum pertaining to the particular product in question.

编辑以获取更多信息: 只要将make运行在任何地方,只要将工作目录保留在运行make的位置即可,它就会为您提供运行程序所需的一切.也就是说,make将创建所有二进制文件和配置文件等,并且您可以从该目录中正常使用该软件.但是,如果不将内容复制到系统目录(例如,使用make install进行复制),则将没有任何全局可访问的二进制文件或适当的环境变量.因此,如果您只是试图运行一个自包含的二进制文件,而该二进制文件不是其他东西要依赖的软件,则实际上不需要运行make install,也不必担心会回滚.一切都将包含在您的原始工作目录中.

Edit for more info: just running make should get you everything you need to run a program, as long as you keep your working directory as wherever you ran make from. That is, make will create all your binaries and config files, etc, and you can use the software fine from that directory. You won't have any globally accessible binaries or proper environment variables, though, if you don't copy things to system directories, such as with make install. So if you're just trying to run a self-contained binary that isn't software that something else will rely on, you don't actually need to run make install and won't have to worry about rolling back. Everything will be contained within your original working directory.

这篇关于在Linux上卸载的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆