It's not read/write permission causing your problem - directories need x
permission to be accessed. That one should have mode 755
, not 666
sudo chmod 755 /usr/share/themes
Check it looks like this:
$ ls -ld /usr/share/themes
drwxr-xr-x 43 root root 4096 Apr 20 23:13 /usr/share/themes
Check the permissions on the theme directories inside - they need to have 755
permissions as well
When you really need to add something to a system (root owned) directory, don't touch the file permissions at all - just use sudo
to get elevated permissions for one command, for example:
sudo cp my_file /path/to/system/directory
You're not the root user. In some Linux distros, you are root by default and have to set up other users (because being root is bad practice for security reasons) yourself. In Ubuntu, the user you create during installation is a user with rights to run all commands using the sudo
program.
This means you can do pretty much anything you want, but you need to use sudo
to elevate permissions temporarily when you want to do something that requires root permission, such as writing to system directories of which your user is not the owner. The sudo
program allows you to run commands as root
Therefore, to copy a file to a directory you don't own and that does not have permission for you to write to, you could run (in a terminal, open one with Ctrl+Alt+T)
sudo cp /path/to/file /path/to/destination
Or to use a graphical browser:
sudo -i # to open a root shell
nautilus # or caja or dolphin or whatever program you use
do your thing, and when done, enter
exit
in the terminal, to drop privileges.
Best Answer
Mallik is right. You don't own this directory, since it is a system-directory and not a user-directory, like
/home/Username
, where you can copy/paste files as you wish!Please don't change the root permission of any system-directory permanently, since your system manages on its own and you can only break it that way. Instead open Terminal and use
sudo
before your command to copycp
, or movemv
files/folders.Put the folder you want to copy (I call it myNewTheme) on your desktop!
Your command should be as followed: (you need to replace the path/dir and name of the folder you want to copy/move):
The
-r
stands for recursive, since it is a folder (parent), with sub-folders/files (children) and therefore recursion is mandatory!!