LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
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

Reply
 
Search this Thread
Old 10-04-2009, 11:36 AM   #1
knobby67
Member
 
Registered: Mar 2006
Posts: 536

Rep: Reputation: 42
copy files into /usr folder


Hi all,
as a user I need to copy some .h files into /use/include, however it says I don't have permission to cp or to move using paste drag and drop. I've tried to change the permissions on usr using chmod but it won't allow that. So how without going root do I copy the .h files and .so files into my include and lib folders in usr? Thanks! Moving over to using user rather than root is more difficult than I thought :s

Using gnome, debian lenny
 
Old 10-04-2009, 11:40 AM   #2
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Linux Mint
Posts: 8,497

Rep: Reputation: 883Reputation: 883Reputation: 883Reputation: 883Reputation: 883Reputation: 883Reputation: 883
You need to be root in order to copy files to
/usr/include

open a terminal
type
Code:
su
password
to become root
then type
Code:
cp files_you_want_to_copy /usr/include
 
Old 10-04-2009, 12:35 PM   #3
knobby67
Member
 
Registered: Mar 2006
Posts: 536

Original Poster
Rep: Reputation: 42
Thanks, so there's no way apart from root/sudo.

One other question if anyone can help, in my code I use "make install" to copy libraries using cp in the make file. This won't work so I have to "hand" copy with sudo, is there a work round this? Thanks.
 
Old 10-04-2009, 12:45 PM   #4
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Linux Mint
Posts: 8,497

Rep: Reputation: 883Reputation: 883Reputation: 883Reputation: 883Reputation: 883Reputation: 883Reputation: 883
Quote:
Originally Posted by knobby67 View Post
Thanks, so there's no way apart from root/sudo.

One other question if anyone can help, in my code I use "make install" to copy libraries using cp in the make file. This won't work so I have to "hand" copy with sudo, is there a work round this? Thanks.

execute make install as root, or copy the files to places where you have write access
 
Old 10-04-2009, 01:19 PM   #5
Elv13
Member
 
Registered: Apr 2006
Location: Montreal,Quebec
Distribution: Gentoo
Posts: 825

Rep: Reputation: 128Reputation: 128
It is because your system protect itself from peoples trying to add files in critical area where they could affect other users. If the files stay in your home folder, then it affect only you (you can disable execution of apps in your home if you want to protect you even more).

Only root or other administrator account can install stuff system wide.

If you want to install something without root privileges, you can create a folder and specify it when you do ./configure. It work like that ./configure --prefix="/home/<path>/<to>/<folder>/"

Then, make install will install the files in the folder instead of /usr

If you have executables, you will have to add /home/<path>/<to>/<folder>/bin to the $PATH variable by adding this line at the end of your ~/.bashrc file
PATH="$PATH:/home/<path>/<to>/<folder>/bin"

Last edited by Elv13; 10-04-2009 at 01:20 PM.
 
  


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
copy folder/files according to modification date bkcreddy17 Programming 14 10-15-2008 07:24 PM
Exactly where are chat files(Frost Wire/folder usr/)stored on my .... DAVE666 Linux - Newbie 16 01-27-2008 12:28 PM
To copy files from a CD to a folder on your system Gins Linux - General 20 10-30-2006 12:53 PM
How to copy in a script files to a samba folder? Julianus Linux - Networking 1 10-09-2004 07:29 PM
can't copy folder to usr/local ontwolf Linux - Hardware 5 04-23-2004 12:56 PM


All times are GMT -5. The time now is 11:01 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration