Uninstalling programs compiled via source code

Hi,
I am using openSUSE 11.0, gnome version. Due to absence of net facilities i compiled a few applications like mplayer, ffmpeg etc. Now that i have net facilities i wish to install these apps from the repositories. So how do i uninstall the previously compiled programs? I compiled them without using the option --prefix=DIR. Do i just delete the includes, binaries and libs?

Hi
In the directory where you compiled;


sudo make uninstall


Cheers Malcolm °¿° (Linux Counter #276890)
openSUSE 11.0 x86 Kernel 2.6.25.18-0.2-default
up 1 day 16:02, 1 user, load average: 1.73, 0.69, 0.33
GPU GeForce 6600 TE/6200 TE - Driver Version: 177.80

Hi,
Unfortunately i deleted the directories where i compiled the programs. I didn’t know that they were important. So what do i do now?

If you installed the package on a single day and didn’t install other system stuff that day, you could do a search for files created that day using “find” and the mtime option.

BTW, a couple of good reasons why you want to use --prefix=/usr/local in future are that it helps you isolate stuff you compiled yourself, and also allows to upgrade OS versions without losing your local stuff.

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Re-extract, recompile, then do ‘make uninstall’ anyway.

Keep in mind that ‘uninstall’ may not be a defined target of your
application’s specific Makefile… I could be wrong but I’m fairly sure
it is not required. With that said you can find out what ‘make install’
did by going through the same Makefile to see what was copied to the
system during ‘make install’ and undo those changes. One of the joys of
package management is it takes care of all of this for you. All of the
apps you mentioned have RPM versions, many of them in the Packman
repository (Google or check opensuse.org for references).

Good luck.

samrat rao wrote:
> Hi,
> Unfortunately i deleted the directories where i compiled the
> programs. I didn’t know that they were important. So what do i do now?
>
>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFJGEKc3s42bA80+9kRAiuOAKCIv7L8DSjCdnjXgDC1cxXSFfKXNQCeKjAw
z3/2h1tw+W7hoh7dUNUawH8=
=1MSi
-----END PGP SIGNATURE-----

I compiled mplayer, ffmpeg, mad and a couple of others about 3 months back, so it will be difficult to isolate the corresponding files. At that time i didn’t know much, but now if i have to compile i use the prefix=/usr/local option. But i think that mplayer etc are installed in /usr/local (the configure utility perhaps had that default option). So do i just delete the corresponding files?

But chances are the timestamp on one file will be the same for the others from the same package so you only need to look at one file to find out when and then use this date to narrow the search.

Ok, i’ll try what you said. Thanks.

In future, if you “cross this bridge again”, then an alternative when compiling from souce code, is to build a custom home built rpm with: ./configure, make, su, checkinstall (instead of “make install”) . You need to have installed “checkinstall” for that to work.

That will create a custom rpm, that you can then install via zypper or the rpm command (on openSUSE-11.0). The rpm is “crude” in comparison to a “properly built rpm” but it does allow one’s application built by the rpm to be tracked by the rpm database, and it is easy to remove with a package manager command. And thus you will not at that stage have to keep the compilation directory.

Now sometimes checkinstall fails, and one instead has to do: ./configure, make, su, make install, checkinstall . (ie run “checkinstall” after “make install” ) . And then even though “make install” has already installed the application, install it again the rpm created by “checkinstall”. The files from the rpm will simply be installed on top of the “make install” installation, and the advantage is the same as noted above - it allows one’s application built by the rpm to be tracked by the rpm database, and it is easy to remove with a package manager command. And thus you will also not have to keep the compilation directory.

^^ Nice! Thanks for that post oldcpu. I didn’t realize there was an easy (realtivley) option that made things more convenient than just ensuring I didn’t delete the directories.

Thanks for the tip!

Right, i just installed ‘checkinstall’. But if i use it, does it mean that that the option --prefix=/usr/local/xyz will not be used and everything will be installed in /usr/local/include, /usr/lib etc. ? Also, since you say that ‘The rpm is “crude” in comparison to a “properly built rpm”’, does this mean that the application will not function properly? And if i upgrade to openSUSE 11.1, will these be deleted? Due to the nature of my work, sometimes i need to compile from source code as the latest rpms are not available.

checkinstall is to be used at compilation time. If the compilation directories are already deleted, then its to late to use checkinstall, unless, of course, you put the directories back in place and recompile again.

Checkinstall, when it completes, will tell you precisely where it has located the rpms. You simply need to navigate that directory, and install the rpms from there, or copy the rpms to you own home directory, and install from there. In my case, I like to drag my “custom/crude” rpms back to my arbitrary /home/oldcpu/rpms directory and I typically rename them, such instead of just application-1.0.15-1.i586.rpm, I will rename it to application-1.0.15-1.oldcpu.i586.rpm so I can tell it is one of my home brewed rpms.

Note I mentioned two possibilities. (1) One case where checkinstall is run in lieu of “make install” . In that case, the application is not yet installed, so one must install the checkinstall created rpm for the application to function. (2) The second case was where “make install” was run first and after successfully running “make install” one runs “checkinstall”. This will also create an rpm, but of course the application was already installed by “make install”. By then installing the rpm built by checkinstall, one is simply re-installing the application, and also, more importantly, having the application now tracked by the rpm database, so it can be recognized by the software package manager when doing dependency checks and such … plus it is easy to remove. Easy to update with precompiled rpms of others.

If the ./configure, make is done correctly, the the application functionality aspect of the rpm is built properly by checkinstall. However the database aspect of the rpm is very limited. It may not have all the typical dependency checks. Its description may not be accurate. Its listing of various files (as seen by the rpm database) may not be as good as a properly built rpm. … There may be other limitations. BUT from a application functionality perspective, it will run well on the PC in which it was built.

Because of these limitations of an rpm built by checkinstall, it is best to use it only one one’s own PC, but not of PCs of others. On our home LAN, where I have 4 PCs running openSUSE, on the same openSUSE versions, which I maintain in parallel, I will use checkinstall a bit more than perhaps it was originally intended, in that I’ll build an rpm with checkinstall on PC-A, and then use that rpm on PC-B, PC-C, and PC-D. But I keep the configuration of these PCs very very close, so I can get away with that.

Is this not a ./configure option?

That does not change.

Does this mean that the paths to these packages will be automatically set and i do not have to add them? Automatic adding of paths may or may not be useful for me.
Also since i installed quite a few packages from the repositories, will these be still there if i upgrade to openSUSE 11.1? And since some libraries may be replaced i guess i might have to recompile some of the packages that i compiled and installed.

The path to where the applications (their libraries, config files, executables) will be to the location you specified in the ./configure.

The rpms will be located in a consistent location, that I can not reliably tell you because I am not at a Linux PC right now. But it is stated by checkinstall, right at the end, where the rpms are located after being built.

In summary, I don’t understand your question about paths.

I don’t understand this comment. You specify, when you run ./configure, where the applications are located. That has NOTHING to do with checkinstall . Checkinstall just follows your instructions as YOU specified during the ./configure and make process. Checkinstall does not have any quality/supervisory code. It has the “make install” instruction inside and it basically tracks where the applications would go, and builds an rpm based on that. But where those applications would go are decided by YOU when you run the ./configure and make.

Again, I don’t understand your question. … or are you simply confused in general about the compilation process (which is not related to checkinstall).

It depends. I think it unlikely.

But if you custom compiled applications, and did not enter them in the rpm database (via checkinstall) then you could have many old libraries, config files, executeables left, and it could make your system into a bit of a mess.

Yes, you will likely have to recompile and install.

Also, if you have many custom compiled, or 3rd party compiled rpms, you will have many many dependency errors if you try a simple “upgrade” to 11.1. It may not be possible to resolve these dependency errors That is one major reason why I always do a clean install with every openSUSE release. I keep my /home on a separate partition from my / (root) and only reformat my / (root) and all works well for me.

What i meant by adding paths is that after i ./configure --prefix=/usr/local/xyz, make and make install (i have not yet used checkinstall), i need to explicitly set paths in $HOME/.bashrc to the executables and includes in /usr/local/xyz/bin, /usr/local/xyz/include, add the libs in /etc/ld.so.conf. So if i create and install a custom made crude rpm, does this do away with the process of explicitly setting paths?

I am currently having trouble with the setting of these paths. A couple of the packages i compiled created executables of the same names and so i am having difficulties saying which executables are to be used. (i have posted this problem in this forum section itself)

I am not a programmer and so the inner workings of the process is not very clear to me. I am just getting used to working around with this process.

And on reading that you just install the latest openSUSE versions in /root, i am unhappy because i have no separate partitions for /root and /home. While installing i had used manual partition setup and i do not recall seeing any option for setting up separate partitions for the same. In any case till now i kept installing all my compiled packages in /usr/local. I also do not recollect many of the packages that i installed from the repos. So i have lot of work to do if i go for a new version.

If you are having problems with the ./configure, make, make install process, then you will have the same problems with using checkinstall. My understanding it simply replays the “make install” process and records the file copying locations (and then duplicates the file copying when the rpm is installed).

I should clarify.

That is separate partitions for / and /home.

Not /root and /home.

I think my calling it " / " (root) confused you.

Now if you do not have a separate " / " and " /home " now is a very good time to do this. For me, it was back in my migration from SuSE-9.3 pro to openSUSE-10.1 that I separated my /home to a separate partition (… I know … I know … I should have done this years earlier, but I’m a slow learner). The migration was a LOT of work, as not only did I have to make a backup of /home (which I always do) but I had to restore from backup (which I never do). But it was most definitely worth it.

My subsequent clean install from openSUSE-10.1 to 10.3 went very smooth.

I am having not too much trouble running ./configure, make, make install, it is the setting up of the paths that is causing problems.
And i guess i need to make a separate partition for /home pretty soon. I am dicey about the process ie using gparted and creating a separate partition, plus i don’t know how to mount /home (maybe i need to add in fstab) and shall post the questions in the appropriate section.

This is easy in openSUSE-11.0 and 11.1 beta4, although the first time its always a bit dicey as one does not have experience with the method. One does not know what icons to press.

In essence, one has to first backup their /home.

Then there are various approaches. One approach is to use a liveCD such as GParted or Parted Magic, and then reformat one’s / and divide it into two partitions. Say a / of about 20 GBytes and a /home of 25 GBytes or more. (For example, on one PC I have a 25 GByte / and a 250 GByte /home ).

Then start the openSUSE-11.0 installation. Typically openSUSE installer will NOT guess correctly what you want to do. It will propose something different. No worries. You simply look for an advanced user setting, and then go in and tell the advanced user setting to format and put / on the partition that you have decided to use for / . And you tell the openSUSE-11.0 installer to format and put /home on the partition that you have reserved for /home. This is important, as often the openSUSE installer will try and steal hard drive space from an MS-Windows or other Linux install, that you may wish not to touch.

Once installed, one can then restore the data files from one’s /home.

Later, once you have a separate / and /home, when installing openSUSE again, you again go into the advanced setup for installing (as openSUSE will guess wrong) and you again tell it to format and put / on the partition that you have decided to use for / (writing over the old / contents). And you tell the openSUSE-11.0 installer to mount the /home on the partition that you have reserved for /home, but do NOT format. Hence you will keep the old /home.

It reads more complex than it is, but one MUST be exact, and triple checks one’s work. I even take digital pictures of the computer screen (during install) in key phases, so I can go back and take a look at what I did.

Till yesterday, i was singing praises about Linux and telling folks the oft quoted remark that ‘Linux is user-friendly, it is just particular about who its friends are.’ Now i am also having trouble about setting paths and environment variables. One learns slowly, very slowly…