LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 06-13-2004, 02:13 AM   #1
jrdioko
Member
 
Registered: Oct 2002
Distribution: Debian 6.0.2 (squeeze)
Posts: 944

Rep: Reputation: 30
Post 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

Last edited by jrdioko; 06-13-2004 at 02:21 AM.
 
Old 06-13-2004, 02:20 AM   #2
Demonbane
LQ Guru
 
Registered: Aug 2003
Location: Sydney, Australia
Distribution: Gentoo
Posts: 1,796

Rep: Reputation: 47
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.
 
Old 06-13-2004, 02:28 AM   #3
auditek747
Member
 
Registered: Feb 2004
Location: Ohio, USA
Distribution: Arch Linux
Posts: 464

Rep: Reputation: 30
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)
 
Old 06-13-2004, 02:33 AM   #4
jrdioko
Member
 
Registered: Oct 2002
Distribution: Debian 6.0.2 (squeeze)
Posts: 944

Original Poster
Rep: Reputation: 30
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)?
 
Old 06-13-2004, 02:36 AM   #5
auditek747
Member
 
Registered: Feb 2004
Location: Ohio, USA
Distribution: Arch Linux
Posts: 464

Rep: Reputation: 30
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.
 
Old 06-13-2004, 02:36 AM   #6
EThitop
Member
 
Registered: May 2004
Distribution: Slackware 10
Posts: 146

Rep: Reputation: 15
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.
 
Old 06-13-2004, 02:41 AM   #7
jrdioko
Member
 
Registered: Oct 2002
Distribution: Debian 6.0.2 (squeeze)
Posts: 944

Original Poster
Rep: Reputation: 30
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.
 
Old 06-13-2004, 02:53 AM   #8
auditek747
Member
 
Registered: Feb 2004
Location: Ohio, USA
Distribution: Arch Linux
Posts: 464

Rep: Reputation: 30
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.
 
Old 06-13-2004, 03:05 AM   #9
jrdioko
Member
 
Registered: Oct 2002
Distribution: Debian 6.0.2 (squeeze)
Posts: 944

Original Poster
Rep: Reputation: 30
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.
 
Old 06-13-2004, 03:07 AM   #10
Demonbane
LQ Guru
 
Registered: Aug 2003
Location: Sydney, Australia
Distribution: Gentoo
Posts: 1,796

Rep: Reputation: 47
checkinstall:
http://asic-linux.com.mx/~izto/checkinstall/
 
Old 06-13-2004, 03:17 AM   #11
auditek747
Member
 
Registered: Feb 2004
Location: Ohio, USA
Distribution: Arch Linux
Posts: 464

Rep: Reputation: 30
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.
 
Old 06-13-2004, 03:20 AM   #12
jrdioko
Member
 
Registered: Oct 2002
Distribution: Debian 6.0.2 (squeeze)
Posts: 944

Original Poster
Rep: Reputation: 30
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!
 
Old 06-13-2004, 03:21 AM   #13
EThitop
Member
 
Registered: May 2004
Distribution: Slackware 10
Posts: 146

Rep: Reputation: 15
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
 
Old 06-13-2004, 03:22 AM   #14
Demonbane
LQ Guru
 
Registered: Aug 2003
Location: Sydney, Australia
Distribution: Gentoo
Posts: 1,796

Rep: Reputation: 47
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
can't install g++ so I can't compile and install any programs musicmaniac414 Linux - Software 12 02-06-2008 10:31 PM
How to install programs ??????? antisocialiting Linux - Newbie 6 08-15-2005 03:03 AM
Programs Won't Install dumbsheep Linux - Newbie 9 01-11-2005 01:39 PM
How do I install programs?? twitch88 Linux - Newbie 4 07-22-2004 05:02 PM
Can't install programs tagbre Linux - Newbie 5 12-30-2003 07:28 AM


All times are GMT -5. The time now is 08:39 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration