Hamid Fadishei's Blog

November 25, 2010

How to revert the “make install” mess?

Filed under: Linux — fadishei @ 10:20 am
Tags: ,

Aesthetically speaking, every Makefile should provide a revert target for any target that changes the file system on the host operating system. For example a make file that provides an “install” target should also provide an “uninstall” one. Unfortunately, things are not always the way they should be. Personally I always hesitate to install applications from their sources and prefer to use the package manager on my Linux as long as it provides the application I need. But what if it does not? what if the binary in the repository is not as up-to-date as you need?

I’m aware of two ways for alleviating this shortcoming. I’d be glad if you comment me about alternate solutions though.

Method 1 – Using checkinstall application

checkinstall is an application that can build binary packages (deb, rpm etc) from your sources. Then you can easily install and of course cleanly uninstall your programs. First you need to install this utility:

$ sudo apt-get install checkinstall

Then you proceed to the normal make process but at last instead of issuing “sudo make install” you will issue “sudo checkinstall”. This will build a package and also install it:

$ cd foo
$ ./configure
$ make
$ sudo checkinstall

Later if you decide to clean your system from the package “foo” you just enter:

sudo dpkg -r foo

Method 2 – Using paco application

paco (package organizer) is another useful utility to be introduced here. It works by monitoring and logging the filesystem modifications during the installation process. Then you can use the logged information to view the installed files or uninstall them

$ sudo apt-get install paco

This time, instead of doing “make install” directly, you should request paco to do the installation:

$ cd foo
$ ./configure
$ make
$ sudo paco -lp foo "make install"

Later if you decide to clean your system from the package “foo” you just enter:

sudo paco -r foo

Remember that there is a graphical interface to paco named gpaco that may be useful to be “sudo apt-get install”ed!

Advertisements

Leave a Comment »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Blog at WordPress.com.

%d bloggers like this: