LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Where to install programs? (https://www.linuxquestions.org/questions/linux-newbie-8/where-to-install-programs-192905/)

jrdioko 06-13-2004 01:13 AM

Where to install programs?
 
It's time to hop over to the newbie forum and ask a very basic question.

I recently set up Slackware 9.1 on my laptop and I'm going to try to use Linux as my primary operating system. I've experimented before and installed and untarred things all over the place, but since I want to approach this install more carefully, I'd like to do it right. In a situation with one user using a system (e.g. a root account and a user account for one person), where should programs be untarred and installed? What determines (or is it user preference) if these generally go in /usr, /usr/local, /usr/local/bin, /usr/bin, /home/username, etc.? Should you download a tarball to a "download" folder, untar and make the program, then move/copy the executable somewhere? What is the most common/recommended way to install programs?

One more thing, how are permissions usually handled on a single-user system with a root and user account? If the user account will be running most of the programs and root is only used for making major changes, what determines what files/folders are given permissions for whom? Is it as easy as chmod (some number) for the path to whatever the executable is for the program you just installed, or does each situation require you to figure out exactly what files/folders a user needs certain permissions for?

Thanks,
Johnathan

Demonbane 06-13-2004 01:20 AM

Code:

What is the most common/recommended way to install programs?
find precompiled packages for your distro.

When installing from source usually you leave the prefix on default (/usr/local) so that you can see what you've installed, but making them into Slackpacks using checkinstall is a better way to keep track of your packages IMO.

auditek747 06-13-2004 01:28 AM

I'm not sure of the proper etiquette, but I think /usr/local is the proper
place for tarballs (maybe /usr/local/src), but on a single user machine
it's really ok to create a directory of your choosing in /home/foo/ and
put them there. Untaring them there is ok too.
Just don't remove them after install!
When you do ./configure, make, make install everything will go where
it needs to.
If you need to remove something, cd to whatever directory you installed
from (/home/foo/downloads/mypackage-x.x.x for example) and do a
make uninstall. (as su)

jrdioko 06-13-2004 01:33 AM

I've seen those Slack packages around, but it seems like the source is always a more recent version, so I assumed I'd be going with those most of the time. I knew there were ways to convert rpms to slackpacks, but I didn't know about doing that with source. Is that common among Slack users (downloading source, converting to package, installing)?

auditek747 06-13-2004 01:36 AM

Demonbane is right about making Slackpacks, they are convenient.
As far as permisions, whatever build process you use things will automatically
get installed where they belong. (/usr/bin, /usr/local/bin, or wherever)
The permisions for these directorys are already set correctly.

EThitop 06-13-2004 01:36 AM

OMG this is the exact question I have been meaning to ask for a while now. The "EXACT" question!!! I am so glad you asked it and I feel you worded it very well, thank you.

jrdioko 06-13-2004 01:41 AM

Is checkinstall a command? I just looked around and I don't see any easy way to create a slackpack except makepkg which seems like it's meant for creating your own package, not converting source to a package.

auditek747 06-13-2004 01:53 AM

I believe makepkg will do fine. Read the proper section of the Slack book
for instructions.

I think the quickie is:

untar, cd to the newly created directory, go su, makepkg -l mypackage-x.x.x.tgz

I think.

jrdioko 06-13-2004 02:05 AM

I read through the Slack book section on makepkg and it doesn't sound like it's as easy as that. They make it sound like there's no guarantee that everything will end up extracting right. Do any slack users do this (makepkg -l to the source and then installpkg to install all programs)? Maybe I'll ask this in another thread at the Slack forum to clear that part up.

I'm still a little confused about permissions though. I suppose I need to read up on setting them and how inheriting folder permissions works, but I'm just wondering what I need to do so that I can download a program, su, install as root, logout back to my user account, and run the program without running into permissions problems.

Demonbane 06-13-2004 02:07 AM

checkinstall:
http://asic-linux.com.mx/~izto/checkinstall/

auditek747 06-13-2004 02:17 AM

As a regular user, download you tarball, untar it
(tar -xvzf blah.tar.gz or a gui extractor)
cd to the newly created directory (cd blah-x.x.x)
./configure
make
su
(password)
make install
make clean
exit (back to regular user)

./configure --help will list some options, but as Demonbane said
you'll rarely need to worry about this.

In case the package installs with a script, there will be a readme or
install.txt in the untarred directory explaining it.
You may need to su before running the script.

These are generic of course. On rare occasions with Slack I've had to pass
prefix options to ./configure.
gnomepython2, pyorbit2, and pygtk2 needed ./configure --prefix=/usr

You should not do ./configure and make as root. Only make install.

jrdioko 06-13-2004 02:20 AM

Thanks again for the info. I see now what checkinstall is and that seems like it's probably the best way to go. I'll go download and look into that now. Thanks!

EThitop 06-13-2004 02:21 AM

Here are the results I get while trying to compile amaroK, I used the method that auditek747 described. Check it out:

http://www.linuxquestions.org/questi...hreadid=192910

Demonbane 06-13-2004 02:22 AM

Quote:

I read through the Slack book section on makepkg and it doesn't sound like it's as easy as that. They make it sound like there's no guarantee that everything will end up extracting right. Do any slack users do this (makepkg -l to the source and then installpkg to install all programs)? Maybe I'll ask this in another thread at the Slack forum to clear that part up.
In order in use makepkg you first need to have the binaries compile and create a directory tree somewhere else, then run makepkg there. So for example I run ./configure --prefix=/slackpacks on my source package, make install(which installs the files into /slackpacks), then run makepkg in /slackpacks to create it. Checkinstall is a little bit easier imo, since you just run "checkinstall -S" instead of "make install".

Quote:

I'm still a little confused about permissions though. I suppose I need to read up on setting them and how inheriting folder permissions works, but I'm just wondering what I need to do so that I can download a program, su, install as root, logout back to my user account, and run the program without running into permissions problems.
Most "make install" scripts will install files with proper permissions so this shouldn't be an issue except for source packages that doesn't have install target.


All times are GMT -5. The time now is 10:14 AM.