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.
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,846
- 5
- 58
- 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.