28

I'm still a little new to Ubuntu and was wondering how I can copy files, in this case Aptana Studio, to /usr/local/ without being denied.

Is there a way to do it in terminal? Or a way to allow myself permission? I should add that I am using 10.10 Desktop edition, not server.

4
  • Why do you want that? You're most likely looking for /opt or you want to install it in your home directory. /usr is managed by apt, so what ever you copy in there can change without notification or break your system.
    – Bobby
    Feb 5, 2011 at 19:41
  • 1
    @Bobby the Aptana installation instructions for linux advise to install it in /usr/local docs.aptana.com/docs/index.php/Installing_Aptana_on_Linux but I do agree with you /opt is the more "sensible place" to put it which is why I have it there especially if they get a ppa at launchpad could cause problems down the road.
    – Allan
    Feb 5, 2011 at 19:53
  • So, it is better to place it on /opt? Feb 5, 2011 at 22:34
  • Yes opt is classed as the place to put non package programs as the opt directory is not touched by the system so no automatic upgrades or removals you have to everything manually. BTW if you use XAMPP which I do (to lazy to install a proper lampp stack) this is where you would put it.
    – Allan
    Feb 6, 2011 at 8:19

2 Answers 2

22

There are a couple of different ways

  1. Open Nautilus with sudo by typing sudo -H nautilus in terminal then copy the files as you would normally. Warning: I would close nautilus straight after so you don't accidently use it for moving normal files.

  2. Open terminal and type sudo cp file1 /usr/local/ obviously replacing file1 with aptana

  3. Add open as admin option to nautilus and open the local folder by right clicking and selecting open as administrator.

1
  • Thanks for the advise. I think it is too. I just am having a tough time getting it installed. Feb 5, 2011 at 22:33
10

/usr/local is a directory belonging to the user root, so you need to use sudo to achieve your end:

sudo mkdir /usr/local/mydir
sudo cp file.txt /usr/local/mydir

for example.

3
  • 2
    You can also type sudo -s, which makes every command thereafter "sudo" until you exit, either with exit or CTRL-D.
    – Scaine
    Feb 5, 2011 at 19:40
  • 1
    @Scaine: sudo su does the same(just FYI).
    – John
    Feb 5, 2011 at 21:27
  • 3
    Not quite, John. sudo su will give you a root shell as root. sudo -s will give you a root shell as /you/. Try both and do an echo $HOME to see the difference. sudo su is the equivalent to sudo -i.
    – Scaine
    Feb 6, 2011 at 9:51

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .