WordPress Update Installation Failed How To Fix SELinux

How To Guides Feb 26, 2020

I recently came across a problem when trying to update WordPress that was running on Centos 7. Whenever I tried to run the WordPress update from the admin area I got the following error:

Unpacking the update…

The update cannot be installed because we will be unable to copy some files. This is usually due to inconsistent file permissions.: wp-admin/includes/update-core.php

Installation Failed

From the error I initially thought this was a simple file permissions issue however after checking the the permissions on the WordPress installation everything appeared to be OK.

After some reading up online there were a number of people talking about SELinux. SELinux stands for Security Enhanced Linux and its a security module that supports access control policies and is built into a number of Linux distributions including Centos 7.

In my case this module was causing the updates to fail with the above error.

So before you run your updates you need to SSH to your server and run the following command to disable SELinux:

Sudo setenforce 0

Then run your Wordpress updates. Once they are complete, enable SELinux again by running the following command:

Sudo setenforce 1

Hope you find this useful.

Tags

Jonathan Blench

I enjoy all things geeky and techie. Work in IT with a focus on Cloud and Data Centre.

Great! You've successfully subscribed.
Great! Next, complete checkout for full access.
Welcome back! You've successfully signed in.
Success! Your account is fully activated, you now have access to all content.