At first I wanted to install a package on a server to which I don't have root access. Since I don't have root access I tried to build it myself but I get an error in the configuration stage.

Here is the commands I run:

cd ~
git clone https://github.com/stella-emu/stella.git
cd stella/
./configure --prefix=$HOME/atari

Then I get the following error:

Running Stella configure...
mkdir: cannot create directory `/tmp/cg-2059': Permission denied
config.guess: cannot create a temporary directory in /tmp
Looking for C++ compiler... none found!

Is there any way I can fix this?

Here are some diagnosis information

-bash-4.2$ ls -ld /tmp
drwxr-xr-x 7 root root 4096 Dec  9 20:39 /tmp
-bash-4.2$ find /tmp -mindepth 1 -maxdepth 1 -printf x | wc -c
-bash-4.2$ mkdir ~/tmp
-bash-4.2$ ls
amin  bs94  Maildir  public_html  skel.tar.gz  speedtest_cli.py  speedtest.py  stella  tajdari  tmp
-bash-4.2$ cd stella/
-bash-4.2$ TMPDIR="$HOME/tmp" ./configure --prefix=$HOME/atari
Running Stella configure...
Looking for C++ compiler... none found!
-bash-4.2$ type -a c++ g++ clang++
c++ is /usr/bin/c++
g++ is /usr/bin/g++
-bash: type: clang++: not found
-bash-4.2$ lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description:    Debian GNU/Linux 7.11 (wheezy)
Release:    7.11
Codename:   wheezy

So now I'm trying to use junest but again after running:

git clone git://github.com/fsquillace/junest ~/.local/share/junest
export PATH=~/.local/share/junest/bin:$PATH

I get:

-bash-4.2$ junest
mktemp: failed to create directory via template `/tmp/junest.XXXXXXXXXX': Permission denied
Error: null argument 
-bash-4.2$ junest -u
mktemp: failed to create directory via template `/tmp/junest.XXXXXXXXXX': Permission denied
Error: null argument 
  • What ary your permissions on /tmp? Check with ls -ld /tmp.
    – Kusalananda
    Nov 1, 2018 at 15:14

2 Answers 2


You need to arrange for the system administrator to fix the broken permissions on /tmp.

ls -ld /tmp
drwxr-xr-x 7 root root 4096 Dec 9 20:39 /tmp

Fix with:

chmod a=rwx,u+t /tmp

And check to make sure it's correct:

ls -ld /tmp
drwxrwxrwt 7 root root 8192 Nov  1 14:19 /tmp

Then you can address the rest of the build process.

  • 1
    Note that the TMPDIR fix in the question is good enough to get past the mktemp problem. Dec 9, 2017 at 19:29
  • @StephenKitt yes, but how much else is going to break on this system with a badly configured /tmp? Dec 9, 2017 at 19:43
  • Oh yes, I definitely agree the /tmp issue needs fixing. My comment was mostly in reaction to your last sentence (but that’s mostly there to link to my answer, I take it!). Dec 9, 2017 at 19:55
  • 1
    @aran the correct settings are as I have described them. Yours is broken. Dec 9, 2017 at 21:32
  • 2
    @aran, /tmp is used by many other things than application installs.
    – ilkkachu
    Dec 9, 2017 at 21:49

See roaima’s answer for the mktemp issue.

Even with that fixed though, you won’t be able to build the current release of Stella. Stella needs GCC 4.8 or later to build, but Debian 7 only has GCC 4.7. You’ll need an older release of Stella (such as 3.7.2 which is the version in Debian 7; I think 4.2 should be OK too).

(I’m the Debian Stella maintainer.)

  • Can you provide the download link for the appropriate version please!? Dec 9, 2017 at 20:43
  • I’ve added links in my answer. Dec 11, 2017 at 7:51
  • Looking for sdl-config... none found! Dec 11, 2017 at 14:42
  • apt install libsdl1.2-dev (look at debian/control for the list of build dependencies). Dec 11, 2017 at 14:46
  • apt does not exist on the system. Dec 11, 2017 at 14:47

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .