Linux make install remove

How do I remove/uninstall a program that I have complied from source? [duplicate]

How do I remove a program that I have compiled from source using the ./configure; make; make install method? Does it matter whether I have kept the original directory that the source was stored in or not?

You don’t really need to keep the makefile if you’ve just done a straight configure, you can just configure again and make uninstall .

Install them with a custom prefix/DESTDIR into your home directory; do not let the makefile run as root. If using a Debian or Redhat-based Linux flavor, better still, use fpm and the package manager shipped with the distro.

1 Answer 1

There are a couple of approaches that you can pursue.

  1. Re-run ./configure with the same options you originally passed to it and then run make uninstall . If you no longer have the original files, re-download the tarball of the corresponding version and use that.
  2. Use find or locate to track down the relevant files (only really practicable for smaller programmes) and remove them manually.

To avoid this scenario again, you could always look at a tool like checkinstall for building from source and tracking the installed files; it was developed for precisely this reason:

A lot of people has asked me how can they remove from their boxes a program they compiled and installed from source. Some times -very few- the program’s author adds an uninstall rule to their Makefile, but that’s not usually the case. This is my primary reason to write CheckInstall. After you ./configure; make your program, CheckInstall will run make install (or whatever you tell it to run) and keep track of every file modified by this installation.

Источник

If I build a package from source how can I uninstall or remove completely?

But unfortunately, i discovered that its the latest version, and has lot of bugs, so i need to remove it/uninstall it. But how can i do so? I tried make clean; make uninstall but still i see it exist:

# pkg-config --list-all | grep Myplugin myplugin-. $ ls /usr/lib/myplugin/libXYZ.so exist. 

10 Answers 10

if the app was installed as root.

Читайте также:  Системное администрирование linux ubuntu

But this will work only if the developer of the package has taken care of making a good uninstall rule.

You can also try to get a look at the steps used to install the software by running:

And then try to reverse those steps manually.

In the future to avoid that kind of problems try to use checkinstall instead of make install whenever possible (AFAIK always unless you want to keep both the compiled and a packaged version at the same time). It will create and install a deb file that you can then uninstall using your favorite package manager.

make clean usually cleans the building directories, it doesn’t uninstall the package. It’s used when you want to be sure that the whole thing is compiled, not just the changed files.

@Google: If make uninstall doesn’t work, you’ll need to track what make install did and undo it manually.

Does make uninstall work after a make clean ? I believe to need to make sure it’s still ./configured’d the same way.

Another thing to keep in mind is that if make install was run as root (e.g., sudo make install ), which is typically the case, it’s virtual always necessary to run sudo make uninstall to remove the software.

If you have already run make install , you can still use checkinstall . Normally checkinstall will overwrite everything that make install created. After that just use dpkg -r , and everything should be removed.

I do not think this is a bug, it would be a good idea to read about and learn to use checkinstall when installing from source.

you can install checkinstall from the repositories, a short description of the package;

CheckInstall keeps track of all the files created or modified by your installation script («make install» «make install_modules», «setup», etc), builds a standard binary package and installs it in your system giving you the ability to uninstall it with your distribution’s standard package management utilities.

These links below may be helpful to get a better understanding. http://en.wikipedia.org/wiki/CheckInstall

This is not a bug — compiling from source is an unsupported method of installing software that bypasses the package management system (which is used by the Software Centre) completely.

There is no standard way that software compiled from source is installed or uninstalled so no way Ubuntu can know what to do. The software is not even listed as an installed program.

You should follow the distributor’s instructions for installation and removal of such custom software. You could also contact the developer to ask for them to create a Debian package so that the package management system can be used.

Make is a program that’s used to compile and install programs from source code. It’s not a package manager so it doesn’t keep track of the files it installs. This makes it difficult to uninstall the files afterwards.

Читайте также:  Kali linux настройка безопасности

The make install command copies the built program and packages into the library directory and specified locations from the makefile. These locations can vary based on the examination that’s performed by the configure script.

CheckInstall

CheckInstall is a program that’s used to install or uninstall programs that are compiled from the source code. It monitors and copies the files that are installed using the make program. It also installs the files using the package manager which allows it to be uninstalled like any regular package.

The checkinstall command is calls the make install command. It monitors the files that are installed and creates a binary package from them. It also installs the binary package with the Linux package manager.

Replace source_location.deb and name in the screenshot with your own information:

Screenshot

Execute the following commands in the source package directory:

sudo apt-get install checkinstall 
sudo dpkg --install --force-overwrite source_location.deb
sudo apt remove name

Here’s an article I wrote that goes through the entire process with explanations.

Источник

Как удалить пакет после «make install» в deb-like Linux системах.

SYSOS (~ root# echo

Столкнулся с таким вопросом — как удалить пакет собранный из исходников и установленный make install.

Для памятки оставлю для метода как это сделать, все ниже действия производится на Debian 10 (более чем уверен что все описанное ниже будет применимо для всех deb-like Linux систем).

Метод #1 (make uninstall)

В случае если каталог сборки не был удален, то можно попробовать выполнить удаление, командой:

cd $SOURCE_DIR sudo make uninstall

В случае если каталог сборки был удален, то можно загрузить его по новой, выполнить сборку (make) и удалить пакет методом #2.

Метод #2 (install_manifest.txt)

Если файл install_manifest.txt существует в вашем исходном каталоге, он должен содержать имена файлов каждого отдельного файла, созданного установкой.

Сначала проверяем список файлов и время их обновления:

cd $SOURCE_DIR sudo xargs -I<> stat -c "%z %n" "<>" < install_manifest.txt

Вы должны получить ноль ошибок, а время обновления перечисленных файлов должно быть включено или после времени установки.

Если все в порядке, то собираем файлы в один каталог для удаления:

cd $SOURCE_DIR mkdir deleted-by-uninstall sudo xargs -I<> mv -t deleted-by-uninstall "<>" < install_manifest.txt

ИНФОРМАЦИЯ. Хочу обратить внимание что файлы не удаляются на прямую, а копируются в созданный каталог (deleted-by-uninstall), для последующего его удаления. Это мера предосторожности, на случай если какой то другой пакет использовал в работе какой то из перемещенных файлов и чтобы его можно было вернуть на место в случае проблемы, в ином случае если все хорошо, то можно смело удалить каталог deleted-by-uninstall.

Читайте также:  Linux где файлы virtualbox

ПОНРАВИЛАСЬ ИЛИ ОКАЗАЛАСЬ ПОЛЕЗНОЙ СТАТЬЯ, ПОБЛАГОДАРИ АВТОРА

Источник

Удаление программ, установленных через make install

Собственно сабж. Поставил себе через make install Mplayer, по компилил первый раз в жизни - что-то пошло не так и плеер просит перекомпилить его с несколькими ключами.

Скажите, как можно удалить Мплеер, установленный таким образом? (в мане по Mplayer про это не слово) =(

Re: Удаление программ, установленных через make install

make uninstall разве там нет?

Re: Удаление программ, установленных через make install

А make uninstall выполняется в исходном архиве, или в уже прошедшем ./configure и make? Или оно без разницы?

Re: Удаление программ, установленных через make install

Re: Удаление программ, установленных через make install

Плюс совет на будущее: НИКОГДА не делай make install, если только не делал ./configure --prefix=/usr/local/myprogram. По возможности используй checkinstall.

Re: Удаление программ, установленных через make install

make uninstall делай там же, где делал make, make install - в корне каталога с исходниками. Если удалил этот каталог уже - можешь распаковать опять исходники, сделать configure как раньше, а потом сразу make uninstall.

Вообще лично я у себя для таких программ, которые нужно компилить из исходников, или которые не устанавливаются через пакеты, сделал в домашнем каталоге каталог apps, и всегда делаю configure --prefix=$HOME/apps - не рутом, а обычным пользователем.

В ~/.bashrc нужно выставить следующие переменные: export PATH=$PATH:$HOME/apps/bin LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$HOME/apps/lib

2 последние переменные нужны, если устанавливать таким образом какие-нибудь библиотеки для разработки.

Как уже посоветовали, можно тоже самое делать в /usr/local, но лично мне дальше своего домашнего каталога вылезать не хочется, тем более некоторые пакеты ставят тоже в этот каталог, так что все равно пакеты будут мешаться с кашей из программ make install.

А еще лучше собирать свой пакет для своего дистрибутива и ставить его по-человечески - rpm'ки как оказалось делать вообще очень просто (правда лично у меня за 6 лет только месяц назад дошли руки узнать, как это делается http://www.linux.org.ru/view-message.jsp?msgid=2141724).

Re: Удаление программ, установленных через make install

> в /usr/local, но лично мне дальше своего домашнего каталога вылезать не хочется, тем более некоторые пакеты ставят тоже в этот каталог

Выбрось этот дистрибутив. В /usr/local никогда и ничего не должно ставиться из дистрибутивных пакетов. /usr/local -- это специальная помойка для админа машины.

Похожие темы

  • Форум XFree86 не компилятся. ошибка когда делаю make install. Помогите. (2002)
  • Форум Как узнать параметры сборки программы? (2013)
  • Форум удаление tar пакетов (2001)
  • Форум Пересборка ядра, make install: слака хочет lilo (2010)
  • Форум make суп (2007)
  • Форум fluxbox 0.9.14 (2005)
  • Форум как удалить неправильно установленное ядро (нет в списках установленных пакетов) (2013)
  • Форум Удалить ghostscript (2005)
  • Форум модули или ядро впервую очередь? (2019)
  • Форум mpeg4 (2001)

Источник

Оцените статью
Adblock
detector