I am trying to paste an install
file into the /usr
directory, but when I right-click on the file manager in the /usr
directory, the paste option is inactive and if I try drag and drop permission is denied for my action.
Asked
Active
Viewed 1.7k times
2
1 Answers
7
This is because you do not have permission to write to the /usr
directory.
drwxr-xr-x 12 root root 4096 May 28 17:06 usr/
As you see the owner and group of /usr
is root
. As a normal user, you only have read and execute (for directories, this means access) permissions. Placing a file here is a write operation, so you will need to perform that action as root.
In Ubuntu we run commands (or programs) as root using sudo
.
GUI method:
sudo -H nautilus
This opens an instance of nautilus as root. We use the -H
option (this sets HOME to avoid root becoming owner of local config files, a problem that may arise if you make the mistake of running graphical applications with normal sudo.
Now you will be able to copy (and delete) files anywhere, so please be very careful.
Command line method
Simply use the cp
command with root access:
sudo cp /path/to/your/file /usr

Ali Razmdideh
- 5,758