Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
04-05-2006, 10:55 PM
|
#1
|
Member
Registered: Dec 2004
Distribution: Debian Wheezy
Posts: 444
Rep:
|
Installing Software Properly from Source
Hi, I have been using linux (Slackware) for six months now, but I still do not know how to install software properly. I know the basic drill. Download the package. Unpack it it. Type these three commands:
./configure
make
make install
That's all it takes right? Nope. Because what if you want to uninstall something later. Ah, now we need to make a package in a .tgz, .deb, or .rpm. Oh, but now we need to pass parameters to ./config so that make will install all the files into a seperate directory. Oh, but make sometimes ignores directory paths set by ./configure. Now what? You see installing software is not trivial like most tutorials make it out to be. Give me a proper education and I will try my best to write a tutorial on making packages (I'm not kidding, I will submit it). I know a lot of you will point out the tutorial on linuxpackages.net. I know about it. It still does not explain much. It does not explain why we change the permission on the files or what the --prefix options are really for. Like what is the difference between /usr/local and /usr. Sure, the FHS document explains these differences abstractly. I like examples, don't you, and who wants to go on an easter egg hunt to find out the difference? To a novice linux user, who wants everything to work correctly, installing software can be the most frustrating part of linux. Let's help them (and me) out.
I have thought about using chroot to install very tricky programs that insist on installing in /usr/local. Is this possible or should I just stick with checkinstall? It would be nice to learn the hard way before using a program to make thing easier. It brings about an appreciation of work done and really gives you an understanding of what is being done. Please share your ideas. Thanks
|
|
|
04-05-2006, 10:57 PM
|
#2
|
Member
Registered: Oct 2004
Location: Small Town USA
Distribution: slamd64 2.6.12 Slackware 2.4.32 Windows XP x64 pro
Posts: 383
Rep:
|
check out checkinstall
|
|
|
04-05-2006, 11:15 PM
|
#3
|
Member
Registered: Dec 2004
Distribution: Debian Wheezy
Posts: 444
Original Poster
Rep:
|
I know my starting state/question is kind of long, but I mentioned that in the second to last sentence. Checkinstall is not the whole answer. That's what I'm pointing out. It is important to know the hard way too.
|
|
|
04-06-2006, 10:43 AM
|
#4
|
Senior Member
Registered: Feb 2006
Location: Seattle, WA: USA
Distribution: Slackware 11.0
Posts: 1,191
Rep:
|
Quote:
Because what if you want to uninstall something later.
|
Most make files come with an uninstall rutine. If you keep all of the source you install from, you can come back to it later and do a 'make uninstall'
Quote:
Ah, now we need to make a package in a .tgz, .deb, or .rpm
|
I prefere not to use these formats. You get more controll form compiling form the source.
Quote:
It does not explain why we change the permission on the files or what the --prefix options are really for.
|
I've never had to change file permissions on files I have just installed. This should not be necisary if you install in /usr/local. The --prefix options specifies the install path.
Quote:
what is the difference between /usr/local and /usr
|
/usr/local a common directory shared by all non root users. The standard is to install all new software (not installed by distro) in this folder.
Quote:
I have thought about using chroot to install very tricky programs that insist on installing in /usr/local.
|
I recommend installing all your programs in /usr/local. But that's just because I don't like to hunt around for my crap if I don't remember where I installed it at.
Let me know if you have any other questions. It took me awhile before I understood what's really going on when I install new software. Keep at it, you'll be a linux pro in no time.
regards,
...drkstr
Last edited by drkstr; 04-06-2006 at 10:46 AM.
|
|
|
04-06-2006, 11:04 AM
|
#5
|
Senior Member
Registered: Oct 2005
Location: Lithuania
Distribution: Hybrid
Posts: 2,247
Rep:
|
There is no easy way for uninstalling programs and make uninstall doesn't always work as well (sometimes there isn't such an option in the makefile). Checkinstall&installpkg helps because it remembers (writes into file) where each file is placed. When you try to uninstall it checks if this file isn't used by any other program and if it's not, then removes it. Otherwise you can look at makefile and delete the installed files manually (some kind of stupid suggestion because some programs have thousands of files and it will fed you up before removing all files). As well, this way can mess up your system easily because you can delete very important files. Linux is not Windows where each program has its own directory and package managers weren't created accidentally.
Last edited by Alien_Hominid; 04-06-2006 at 11:06 AM.
|
|
|
04-06-2006, 12:10 PM
|
#6
|
Member
Registered: Dec 2004
Distribution: Debian Wheezy
Posts: 444
Original Poster
Rep:
|
When I get two people saying contradictory things, I know I'm working with a complicated subject. I'm with Alien Hominid. Packaging the files after they are built makes a lot of sense even if it is overkill. As far as /usr/local is concerned, I recently had a lot of trouble installing glib in Slackware. The .pc file was not being copied to the correct location so pkg-congif was saying it wasn't installed. This held me up for about two weeks before I finally change --prefix and --exec-prefix options to /usr. This may not have been the best solution, but it is a working solution. After that amount of trouble, I decided to make this post to hammer everything out and to help newer users
I'm gonna say that to install something correctly, you need to build a package. That said, let's just deal with the ./configure script and possibly changing permissions on files as many other sites suggest. Before you build a package, you should configure it correctly. That requires us to become familiar with the configure options. Where do we find those options? Is the INSTALL file the only place to look for them? I looked up configure on google and came up with this site:
http://www.airs.com/ian/configure/
He says that --prefix and --exec-prefix are the only options we should have to deal with.
For permissions, it makes sense to change the permissions of say the /etc files to whatever permissions you have in /etc, but the way most sites recommend to change them seems strange. After all, the package program will want to change our settings anyway. Look at this site
http://www.linuxpackages.net/howto.p...=Package+Howto
if you don't know what I'm talking about.
Well, that's it from me for now. Thanks guys.
|
|
|
04-06-2006, 12:45 PM
|
#7
|
Senior Member
Registered: Oct 2005
Location: Lithuania
Distribution: Hybrid
Posts: 2,247
Rep:
|
For configure options, run ./configure --help. This will post them. Glib is default package in Slackware and it goes into /usr (/usr/lib). It is configured in install.sh script in the official package. However, you should know that by default user compiled packages in Slackware goes to /usr/local. That's why you couldn't find glib and that's why you should use official Slackware packages, because files are placed where they are expected to be. Or if you tried to compile yourself, you needed to change the default prefix into /usr because it's system wide package and it should be in your path.
|
|
|
04-06-2006, 11:30 PM
|
#8
|
Member
Registered: Dec 2004
Distribution: Debian Wheezy
Posts: 444
Original Poster
Rep:
|
Ya, I could find glib, but the system could not. I guess if a library was installed by Slackware, I need to place the program/library where Slackware put it. I still can't figure out why pkg-config could not find the .pc file. There should be two places for .pc files, one in /usr/lib/pkgconfig and one in /usr/local/lib/pkgconfig. There is only one directory that it looks in though. What happens if I get a program that needs to be put in /usr/local/ rather than user and also needs .pc file. Should I find the .pc file and alter it's contents and place it in /usr/lib/pkgconfig? I guess another way to ask this question would be: how does a .pc file get created, and where is it placed?
|
|
|
04-07-2006, 05:17 AM
|
#9
|
Senior Member
Registered: Oct 2005
Location: Lithuania
Distribution: Hybrid
Posts: 2,247
Rep:
|
Official Slackware and other common Unix system packages usually are placed in /usr, while the packages you compile and install usually go to /usr/local unless you change the prefix. You should export PKG_CONFIG=/some/path before installation to show where to search.
|
|
|
04-08-2006, 06:26 PM
|
#10
|
Member
Registered: Dec 2004
Distribution: Debian Wheezy
Posts: 444
Original Poster
Rep:
|
All right, we are doing much better now! Alien Hominid, thank you for sharing so much of your knowledge. I'm beginning to have a much easier time installing software. There is so much to learn though.
How might I change what architecture my compiler uses? ei: i386 to i686
No one has mentioned anything else about changing file permissions yet.
For those following along the PKG_CONFIG environment variable below should be PKG_CONFIG_PATH. I looked it up on the man page.
I have had problems compiling a program when I set the --prefix option to /usr instead of /usr/local. The compiler was unable to find a library with /usr set, but able to find the library when /usr/local was set. I'm not sure if this should be addressed in this thread (It is a common problem) or not.
Well, I think these are the last of the ./configure options that most people would want to know. I'll make sure to write up the first part of my tutorial after the two questions above are answered. Just as I said I would.
|
|
|
All times are GMT -5. The time now is 06:39 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|