[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Subject: How to install a source package?

I'm just a newbie, but as this seems like a newbie question, I'll give my
experiences on installing programmes from source-code.
You're surfing the web and you find a great utility that you just gotta have on
your brand-spanking new Linux box. After searching there site and the debian
site, you find that there isn't a .deb file for it : (. So, you download the
*.tar.gz file for the source code and decide to brave it out. I usually copy the
file to /tmp so that I don't end up filling my hard drive with lots of source
code that I already have in a tar file anyway. Then I use tar -zxvf *.tar.gz to
uncompress the file. Now I have a directory named *, I.E. whatever the programme
is. I cd to that directory and do am ls. Along with a lot of source code and
sub-directories, there are usually README, INSTALL and other text files. First,
read the README with either more or less. I find less to be a bit easier, but
that's personal taste. This will probably tell you a lot about what the
programme is supposed to do, how to use it, and possibly what lib's or tools you
need to have installed first before you can compile it. After you feel confident
with the info in the README, then read the INSTALL file. This will give you the
details of how to compile and install the programme itself. It may also tell you
more about required libs and toolkits. Quite often you will use the command make
to actually compile the source code into a binary programme. There is usually a
make_install that will actually copy the binaries to the usual directories so
you can run the programme without having to include a path to it. This may also
install man pages for the programme as well as other documentation. Many times
you will find that the programme was written to compile on different platforms,
like HP-UX, AIX etc. . . , Then there is usually a make_linux or some other tool
to specify what platform you are installing on. This information should be in
the INSTALL file. Read it and the README file well. If you do need to get lib's,
try to get .deb's for them. If you can't, when you do install the lib's, you
will probably need to run ldconf before your system will recognise them. This
can be rather hazardous. Lib's are what make everything in Linux work. But, If
you go slow, and read all the documentation, you will probably not have too much
trouble compiling and installing programmes from source code. All the files
created in the /tmp directory during this process should be wiped out when you
re-boot your system. I know my system clears the /tmp directory on re-boot. The
source code is still available in the *.tar.gz file if you need it, and the
make_install should put all the required files in there proper place.
Of course, the easiest way is to find a .deb file for the programme and use
dselect or dpkg -i to install it. But if you had found a .deb file, you wouldn't
be trying to install from source code then, would you.

This is my personal experience in compiling and installing programmes from
source code. It doesn't always work, but then neither does all software. I am
open to comments, complaints and constructive criticism.


     John Gay

Reply to: