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
Asked
Active
Viewed 8,378 times
2

Kiruthika kanagarajan
- 824
- 9
- 12
2 Answers
4
May be you could have deleted your /tmp
directory
mkdir -p /tmp/mkstempc
resolves the problem.

Kiruthika kanagarajan
- 824
- 9
- 12
2
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

Iain4D
- 21
- 4
-
Could also be a full /tmp directory. In that case, Check /tmp for anything which could be removed. Here is some more background information: https://unix.stackexchange.com/questions/277387/tab-completion-errors-bash-cannot-create-temp-file-for-here-document-no-space – Iain4D Sep 06 '21 at 21:51