Module Installation: Unable to create directory 'temporary://update-extraction-f781a69c/ I have searched the answers on this site and have found threads like 
    Configuring the temporary directory which refer to this issue but could not arrive at a solution. My setup is Linux (Fedora), Apache, PHP 5.4.22 with Drupal 7.24 and I've done the following to ensure a correct configuration of the Drupal file tree: 

1) chown -R apache:apache Drupal
2) cd Drupal
3) mkdir tmp
4) chmod 777 tmp
5) Change temporary directory in drupal admin/config to "tmp"


When I try to install a module (either through direct file upload or via URL) I get the error: 

Module Installation: Unable to create directory 'temporary://update-extraction-f781a69c/


Now, the curious thing is that when I look in Drupal/tmp I see the following:

[root@localhost tmp]# ls -l
total 1448
-rw-rw-r-- 1 apache apache 1476650 Dec 13 23:24 bcommerce.tgz
drwxr-xr-x 2 apache apache    4096 Dec 13 23:24 update-extraction-f781a69c


So the extraction folder is created and seems to have proper ownership and permissions yet I'm still getting this error.

I've also ensured that the files in my tgz archive have proper permissions and are owned by apache, so their permissions should also be OK.

Any ideas on what might be wrong here would be much appreciated; I've been banging my head against this issue for a few hours now and have gotten nowhere.
For me, things like these were caused by selinux. Either disable it, or add appropriate policy:

grep httpd /var/log/audit/audit.log | tail -n 50 | audit2allow -M drupaltmp   
cat drupaltmp.te 


Look inside, may be tune a little. I've got this:

module drupaltmp 1.0;

require {
        type httpd_t;
        type var_lib_t;
        type etc_t;
        type etc_mail_t;
        class file { write setattr };
        class dir { search create getattr setattr };
}

#============= httpd_t ==============
allow httpd_t etc_mail_t:dir { search getattr };
allow httpd_t etc_t:dir setattr;
#!!!! This avc is allowed in the current policy

allow httpd_t etc_t:file { write setattr };
allow httpd_t var_lib_t:dir create;


Then install it inside selinux

semodule -i drupaltmp.pp