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.

Jorge Castro
  • 71,754
  • 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 05 '11 at 19:41
  • 1
    @Bobby the Aptana installation instructions for linux advise to install it in /usr/local http://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 05 '11 at 19:53
  • So, it is better to place it on /opt? – Keith Groben Feb 05 '11 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 06 '11 at 08:19

2 Answers2

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.

Zanna
  • 70,465
Allan
  • 11,582
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.

Zanna
  • 70,465
enzotib
  • 93,831
  • 2
    You can also type sudo -s, which makes every command thereafter "sudo" until you exit, either with exit or CTRL-D. – Scaine Feb 05 '11 at 19:40
  • 1
    @Scaine: sudo su does the same(just FYI). – John Feb 05 '11 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 06 '11 at 09:51