I know of few packages that support "make uninstall" but many more that support make install DESTDIR=xxx" for staged installs.
You can use this to create a package which you install instead of installing directly from the source. I had no luck with checkinstall but fpm works very well.
This can also help you remove a package previously installed using make install. You simply force install your built package over the make installed one and then uninstall it.
For example, I used this recently to deal with protobuf-3.3.0.
On RHEL7:
make install DESTDIR=dest
cd dest
fpm -f -s dir -t rpm -n protobuf -v 3.3.0 \
--vendor "You Not RedHat" \
--license "Google?" \
--description "protocol buffers" \
--rpm-dist el7 \
-m you@youraddress.com \
--url "http:/somewhere/where/you/get/the/package/oritssource" \
--rpm-autoreqprov \
usr
sudo rpm -i -f protobuf-3.3.0-1.el7.x86_64.rpm
sudo rpm -e protobuf-3.3.0
Prefer yum to rpm if you can.
On Debian9:
make install DESTDIR=dest
cd dest
fpm -f -s dir -t deb -n protobuf -v 3.3.0 \
-C `pwd` \
--prefix / \
--vendor "You Not Debian" \
--license "$(grep Copyright ../../LICENSE)" \
--description "$(cat README.adoc)" \
--deb-upstream-changelog ../../CHANGES.txt \
--url "http:/somewhere/where/you/get/the/package/oritssource" \
usr/local/bin \
usr/local/lib \
usr/local/include
sudo apt install -f *.deb
sudo apt-get remove protobuf
Prefer apt to dpkg where you can.
I've also posted this answer on stackoverflow
checkinstall
- it makes this whole problem evaporate. – Oli Dec 12 '11 at 12:00make uninstall
work after amake clean
? I believe to need to make sure it's still ./configured'd the same way. – user606723 Dec 12 '11 at 16:10make clean
does not undo./configure
, it undomake
. The only way to "deconfigure" would be to either delete theMakefile
itself (and perhapsconfig.h
too), or run ./configure again – MestreLion Oct 02 '12 at 19:27make install
was run as root (e.g.,sudo make install
), which is typically the case, it's virtual always necessary to runsudo make uninstall
to remove the software. – Eliah Kagan Jul 09 '13 at 01:46checkinstall
because it mentions theauto-apt
which can auto resolves missing header dependencies! – Daniel Sokolowski Oct 25 '15 at 15:21make install
, you can still usecheckinstall
. Normallycheckinstall
will overwrite everything thatmake install
created. After that just usedpkg -r <package.deb>
, and everything should be removed. – user502144 Oct 15 '17 at 18:00