Compiling NetHack from source

I was trying to install nethack from the Arch repo and for some weird reason the ownership of /var/games/nethack/record and /var/games/nethack/perm were messed with and the game couldn’t modify them. I tried:

sudo chmod 666 /var/games/nethack/record
sudo chmod 666 /var/games/nethack/perm
But that didn’t change anything so I decided to just compile from source. The NetHack wiki has a page on compiling but The directions are not really clear and also there is instructions for all OS’s there. So I decided to write a quick blog post describing how to compile the original NetHack on a Linux system. Make sure you have base-devel, a c compiler, libraries and development headers available(you should have most libraries by default). It’s pretty straight forward from here on out:

git clone https://github.com/NetHack/NetHack
cd NetHack
sys/unix/setup.sh sys/unix/hints/linux.370
make fetch-lua && make fetch-lua
make && make install
It will install NetHack to ~/nh/install/games/nethack . You can just add it to your path and enjoy good old NetHack!

Tags


| tutorial | linux | games |