The main problem about using wordpress in Ubuntu is having problems with upgrading and installing via localhost. Everytimes we did, it’s always asking for our FTP credentials, ah yes, it is annoying much and we had to copy/paste files manually. So, here is the solution for that. Just type two commands via your terminal and it solved!
cd /var/www sudo chown -R www-data:www-data wordpress
You can change that wordpress with your wordpress installed folder. Yes, it is done!