Could not create directory

I have followed the instructions from

  • https://help.ubuntu.com/community/WordPress
  • https://www.digitalocean.com/community/tutorials/how-to-configure-secure-updates-and-installations-in-wordpress-on-ubuntu

Every time I try to update or install a new plugin, I get the following error:

Downloading update from https://downloads.wordpress.org/plugin/akismet.3.0.1.zip…
Unpacking the update…
An error occurred while updating Akismet: Could not create directory.
All updates have been completed.

I have set up /var/www/html with

sudo ln -s /usr/share/wordpress /var/www/html
sudo chown wp-user:www-data -RL /var/www
sudo chmod g+w -R /var/www

I have tried

  • Adding define('WP_CONTENT_DIR', '/var/www/html/wp-content'); to /etc/wordpress/config-my.host.php
  • sudo chmod o+w -R /var/www/html/wp-content
  • sudo -u wp-user touch /var/www/html/wp-content/test succeeds
  • sudo -u www-data touch /var/www/html/wp-content/test succeeds

System info:

$ cat /etc/*-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=14.04
DISTRIB_CODENAME=trusty
DISTRIB_DESCRIPTION="Ubuntu 14.04 LTS"
NAME="Ubuntu"
VERSION="14.04, Trusty Tahr"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 14.04 LTS"
VERSION_ID="14.04"
HOME_URL="http://www.ubuntu.com/"
SUPPORT_URL="http://help.ubuntu.com/"
BUG_REPORT_URL="http://bugs.launchpad.net/ubuntu/"
$ apt-show-versions wordpress apache2 php5 mysql-server
apache2:amd64/trusty 2.4.7-1ubuntu4 uptodate
mysql-server:all/trusty-security 5.5.37-0ubuntu0.14.04.1 uptodate
php5:all/trusty-security 5.5.9+dfsg-1ubuntu4.3 uptodate
wordpress:all/trusty 3.8.2+dfsg-1 uptodate

2 Answers
2

You are using Ubuntu package for WordPress right? Had you tried conventional install (just downloading official WP archive and setting it up with LAMP)?

While it’s not very “Linux way” maybe, it’s commonly suggested to stick with that for WordPress. I briefly dealt with Ubuntu WP package in the past and ended up doing just that as well.

PS if that 3.8.2 stands for WP version it’s not current either.

Leave a Comment