Fixing Permissions for WordPress to Update/Upgrade

Activated a new theme on my wordpress install on localhost. I had to make these changes:

1. follow the instructions: http://www.hongkiat.com/blog/update-wordpress-without-ftp/
2. Change the permissions for the wp-content and plugins folders:
sudo chmod 777 Your_wordpress_root_folder/wp-content
sudo chmod 777 Your_wordpress_root_folder/wp-content/plugins

3. Install the plug-in, it should work fine.
To change back the permission for protecting the wordpress contents and plug-in, otherwise you can leave it as is if the security is not a big concern :
4. change back the original permission :
sudo chmod 751 Your_wordpress_root_folder/wp-content
sudo chmod 751 Your_wordpress_root_folder/wp-content/plugins

Found the fix here:
https://wordpress.org/support/topic/core-or-plugin-update-could-not-create-directory-httpdocs#post-5602273

Installing WordPress Locally on Ubuntu

Installing WordPress in Ubuntu
https://www.youtube.com/watch?v=qiNybMFB_Xg

1. Install Tasksel
https://help.ubuntu.com/community/Tasksel

2. Install lampserver
sudo apt-get install lamp-server^

3. set password for mysql

4. check php version
php --version

5. enter the root directory
cd /

6. check the directory listing
ls -lah

7. change ownership of /var/www
cd /var/www
sudo chown -R GROUP:USERNAME www

8. download wordpress
https://wordpress.org/download/

9. unzip wordpress
cd ~/Downloads/
unzip wordpress-VERSION.NUMBER.zip -d /var/www

10. verify that wordpress directory exists
cd /var/www
ls -lah

11. create config file from sample
cd wordpress/
cp wp-config-sample.php wp-config.php

12. use vim to edit wp-config.php
vim wp-config.php

13. In separate terminal, start MySQL monitor
mysql -u root -p
Enter password: (PASSWORD FROM STEP 3)

14. create database
mysql> CREATE DATABASE (DB_NAME);

15. create user
mysql> CREATE USER (DB_USER)@localhost;

16. set a password for the mysql database user
mysql> SET PASSWORD FOR (DB_USER)@localhost= PASSWORD('DB_PASSWORD');

17. set privileges for user
mysql> GRANT ALL PRIVILEGES ON (DB_NAME).* TO (DB_USER)@localhost IDENTIFIED BY 'DB_PASSWORD';

18 reset database and exit
mysql> FLUSH PRIVILEGES;
mysql> exit

19. return to vim window and update values in wp-config.php
‘database_name_here’ is DB_NAME from step 14
‘username_here’ is DB_USER from step 15
‘password_here’ is DB_PASSWORD from step 16

20. (IF NEEDED) http://localhost/wordpress may give 404. If so, move wordpress directory under /var/www/html/

21. Fill out “Information needed” on localhost/wordpress/wp-admin/install.php