LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   copy files into /usr folder (https://www.linuxquestions.org/questions/linux-software-2/copy-files-into-usr-folder-759618/)

knobby67 10-04-2009 11:36 AM

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

repo 10-04-2009 11:40 AM

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

knobby67 10-04-2009 12:35 PM

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.

repo 10-04-2009 12:45 PM

Quote:

Originally Posted by knobby67 (Post 3707373)
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

Elv13 10-04-2009 01:19 PM

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"


All times are GMT -5. The time now is 07:12 PM.