Cannot create temporary file - mkstemp: No such file or directory

11k views Asked by At

In centos when installing package yum install <package> it didn't work & throws the error as Cannot create temporary file - mkstemp: No such file or directory

3

There are 3 answers

0
Kiruthika kanagarajan On

May be you could have deleted your /tmp directory mkdir -p /tmp/mkstempc resolves the problem.

1
Iain4D On

I had a similar issue.

Discovered that my environment variable TMP was set to ~/tmp . As root, dnf didn't like that. so I

$ unset TMP

Then (CentOS stream 8) 'dnf install <package>' worked fine.

For more background, a similar question was asked, but no specific resolution: https://serverfault.com/questions/1030768/linux-error-creating-temporary-file-var-tmp

0
Shuhaib N C On

Most probably you have deleted /tmp directory

Create /tmp directory again

sudo mkdir /tmp

For termux mkdir /data/data/com.termux/files/usr/tmp