I am in the process setting up Wordpress locally(not on the server) on my Inspirion 3520 that runs 13.10. I need to install a Theme and a plugin that was purchased. I am unable to copy and paste or move the file to /var/wordpress/wp-content/themes. I get "Access denied" and that I am not the owner.... How can I access or get privileges access and add the files I need to add?
Thank you in advance.

- 1
- 1
- 2
2 Answers
As a normal user you cannot simply copy files to system directories. Only root can do that. You can copy your file using the following command:
sudo cp YOURFILE /var/wordpress/wp-content/themes/
If you insist on using a file browser like Nautilus to do this, you can start Nautilus with super-user privileges, but I would personally avoid this. If at all, use with extreme caution:
gksudo nautilus
Finally, if you only want to install a theme for a single user, it is probably better to install it into your home directory, rather than a system directory.

- 13,196
- 5
- 57
- 65
If it is on the same computer, you should be able to copy the file with:
sudo cp /SOURCE/FILE /var/wordpress/wp-content/themes/DESTINATION-FILE
or a directory with
sudo cp -r /SOURCE/FOLDER/ /var/wordpress/wp-content/themes/DESTINATION-FOLDER/
If you want to move a file or folder, just use:
sudo mv /SOURCE/FILE /var/wordpress/wp-content/themes/DESTINATION-FILE
You could also just open file manager as root - but this should be used with caution:
gksudo nautilus
For more, see here.
All of the above can be done in terminal, which in Unity can be opened with Ctrl+Alt+T.
Edit:
If you want to modify the file as your normal user, just chmod
on it. This change the permissions so that it can be modified by users other than root.
sudo chmod -R 777 /var/wordpress/wp-content/themes/FILE
There is a manual page on chmod here
Another Edit:
A more secure way of doing it would be to make your user the 'owner' of the file - you can do this by:
sudo chown USERNAME:GROUP /PATH/TO/FILE/
You can usually use your USERNAME
in the place of GROUP
.
There is a another helpful web page here
I did a answer a while ago here that might be of use as well.
-
No luck. Here is what happened. I got this...karl@karl-Inspiron-3520:~$ sudo su [sudo] password for karl: root@karl-Inspiron-3520:/home/karl# sudo cp /home/karl/Downloads/IREX/irex /var/www/wordpress/wp-content/themes cp: omitting directory ‘/home/karl/Downloads/IREX/irex’ root@karl-Inspiron-3520:/home/karl# sudo cp /home/karl/Downloads/IREX/irex /usr/share/wordpress/wp-content/themes cp: omitting directory ‘/home/karl/Downloads/IREX/irex’ root@karl-Inspiron-3520:/home/karl# – user225713 Dec 15 '13 at 18:15
-
-
USE THE
-r
OPTION! :-) - I did mention it - just as a 'folder' instead of a 'directory'... – Wilf Dec 15 '13 at 18:43 -
BINGO. It worked. Awesome. I appreciate the help. I have migrated myself away from MS products and I am hoping to reduce my learning curve with Linux and the help from people like yourselves – user225713 Dec 15 '13 at 18:50
-
Glad to be of help - remember to upvote and mark as answered how you like :-) – Wilf Dec 15 '13 at 18:52
-
I was able to move the file but now the file cannot be accessed. I do not have permission to view contents. – user225713 Dec 15 '13 at 18:56
-
cp
copies the file - if you want to move it usemv
(don't use-r
though). The file cannot be accessed by normal users, but you could runchmod
on it - I'll update my answer. – Wilf Dec 15 '13 at 18:58 -
-
The manual page I linked to at the bottom of my answer is VERY useful - it has a little table to show which number you need to use (e.g.
777
). There is a short tutorial here, of which my answer is the most like Number 6. – Wilf Dec 15 '13 at 19:14 -
I would not recommend chmodding to 777. That means any user of can delete, add, or edit files in there. This is potentially a big security risk.
sudo
orgksudo
are a MUCH better way to go here. – Malte Skoruppa Dec 15 '13 at 20:14 -
Or chnaging the owner @MalteSkoruppa - did you read my edit :-)? Just added a bit more to it. – Wilf Dec 15 '13 at 20:19
-
1Yes I did. Thank you. I have to resolve another issue, which is a Wordpress issue. While I can access the file now, I established the properties being the same as the other themes in my wp-content/themes folder, I cannot access the new folder in my Wordpress Dashboard. So I am going over to WP to try to fix the problem. Thank you for your time and expertise. – user225713 Dec 15 '13 at 20:25
-
I'm no expert @user225713 - I just now some stuff... There is a WordPress site here - but it sounds like you have found it anyway ;-). – Wilf Dec 15 '13 at 20:27
gksudo
- see here - stops making the home directory only accessible as root. – Wilf Dec 15 '13 at 17:58