v50 Steam/Premium information for editors
  • v50 information can now be added to pages in the main namespace. v0.47 information can still be found in the DF2014 namespace. See here for more details on the new versioning policy.
  • Use this page to report any issues related to the migration.
This notice may be cached—the current version can be found here.

Difference between revisions of "Installation"

From Dwarf Fortress Wiki
Jump to navigation Jump to search
(Undo revision 237509 by 110.145.128.74 (talk))
(46 intermediate revisions by 15 users not shown)
Line 8: Line 8:
 
You can always get Dwarf Fortress as [[Main:Toady One|Toady One]], the developer, released it from the [http://www.bay12games.com/dwarves/ Bay12 site] (listed at the top of the page).
 
You can always get Dwarf Fortress as [[Main:Toady One|Toady One]], the developer, released it from the [http://www.bay12games.com/dwarves/ Bay12 site] (listed at the top of the page).
  
You can also download the latest version from the links at the top of this page.
+
As of v0.43.05, the three downloads linked on the main page are 64-bit versions of DF for Windows, macOS, and Linux. "All versions" links to a page with additional choices, including 32-bit builds for all platforms, "small" builds for Windows (which lack sound files), and "legacy" builds for Windows. Generally, the SDL builds for Windows should be preferred, although the Legacy builds may be necessary on some older computers.
  
Windows users should generally download one of the "Main" (SDL) versions (listed in the first row), unless the "Legacy" version is required for some reason.
+
== Third-Party Packages ==
  
Mac and Linux users should generally download the SDL version for their platform. While it is possible to run the Windows version under WINE, it is often slower and less stable than the native version.
+
{{main|Utility:Lazy Newb Pack}}
 
 
== Third-Party Packages ==
 
  
These packages include the game as well as several utilities and graphics sets, configurable with an included launcher.
+
There are several packages which bundle the game with several utilities and graphics sets, usually configurable with an included launcher. These are listed on the [[Utility:Lazy Newb Pack|Lazy Newb Pack]] page.
*[http://www.bay12forums.com/smf/index.php?topic=126076 PeridexisErrant's Dwarf Fortress Starter Pack] (Windows) - A more comprehensive, and more importantly, up-to-date implementation of LusasUP's original Lazy Newb Pack.
 
*[http://www.bay12forums.com/smf/index.php?topic=128960 Fricy's MacNewbie] - essentially a very well maintained Lazy Newb Pack, for OS X.
 
*[http://www.bay12forums.com/smf/index.php?topic=140966 Beautato's Linux Lazy Newb Pack] - a basic unmaintained (Last update March 29, 2015) package for Linux
 
  
The Dwarf Fortress community often creates custom [[Graphics set repository|graphics sets]], [[Tileset repository|tilesets]] and [[Color_scheme#Custom_color_schemes|color schemes]]. They're like graphical mods that make DF look prettier or just different. A lot of people pack the game folder with the tileset installed and everything already set up, so all you have to do is extract and play. Among the most popular of these are [http://www.bay12forums.com/smf/index.php?topic=53180.0 Ironhand's Graphics Set] and [http://www.bay12forums.com/smf/index.php?topic=57557.0 Phoebus' Graphic Set].  Most notable graphics sets are included in the packs above.
+
The Dwarf Fortress community often creates custom [[Graphics set repository|graphics sets]], [[Tileset repository|tilesets]] and [[Color_scheme#Custom_color_schemes|color schemes]]. They're like graphical mods that make DF look prettier or just different. A lot of people pack the game folder with the tileset installed and everything already set up, so all you have to do is extract and play. Among the most popular of these are [http://www.bay12forums.com/smf/index.php?topic=53180.0 Ironhand's Graphics Set] and [http://www.bay12forums.com/smf/index.php?topic=57557.0 Phoebus' Graphic Set].  Most notable graphics sets are included in the packs mentioned above.
  
 
= Installation =
 
= Installation =
Line 31: Line 26:
  
 
Make sure to actually ''extract'' the archive; do not just open the archive and run the game from the window that appears. If you do this then it may appear to work, but your save game data will get discarded. This is the cause of many "my saved games keep getting deleted" complaints. The game also needs to be able to write to its own folder, so do '''not''' install it in C:\Program Files if you are running Windows Vista or later.
 
Make sure to actually ''extract'' the archive; do not just open the archive and run the game from the window that appears. If you do this then it may appear to work, but your save game data will get discarded. This is the cause of many "my saved games keep getting deleted" complaints. The game also needs to be able to write to its own folder, so do '''not''' install it in C:\Program Files if you are running Windows Vista or later.
 +
 +
If you have an error stating that MSVCP140.dll is missing, it can be obtained by downloading [https://www.microsoft.com/en-us/download/details.aspx?id=48145 Visual C++ Redistributable for Visual Studio 2015]. When prompted choose the x64 version for 64-bit DF, or the x86 version for 32-bit DF.
  
 
== Mac ==
 
== Mac ==
Line 41: Line 38:
 
* [https://www.libsdl.org/projects/SDL_ttf/release/SDL_ttf-2.0.11.dmg Download] SDL_ttf 2.0.11 and replace the file libs/SDL_ttf.framework with the one from the downloaded folder.
 
* [https://www.libsdl.org/projects/SDL_ttf/release/SDL_ttf-2.0.11.dmg Download] SDL_ttf 2.0.11 and replace the file libs/SDL_ttf.framework with the one from the downloaded folder.
  
On OS X 10.11 and above, you will need to [http://www.bay12games.com/dwarves/mantisbt/view.php?id=2624#c33110 update the SDL library]:
+
On OS X 10.11 and above, for the 32-bit version of DF only, you will need to [http://www.bay12games.com/dwarves/mantisbt/view.php?id=2624#c33110 update the SDL library]:
 
* [https://www.libsdl.org/release/SDL-1.2.15.dmg Download] SDL 1.2.15 and replace the file libs/SDL.framework with the one from the downloaded folder
 
* [https://www.libsdl.org/release/SDL-1.2.15.dmg Download] SDL 1.2.15 and replace the file libs/SDL.framework with the one from the downloaded folder
  
Line 50: Line 47:
 
== Linux ==
 
== Linux ==
  
The Linux version of the game is shipped as a compiled 32-bit x86 (Intel/AMD) application. It will also run on a system with a 64-bit AMD or Intel processor and a 64-bit kernel, provided that you have the (32-bit) shared libraries available that the program needs.
+
As of 0.43.05, both 64-bit and 32-bit compiled editions are available for Dwarf Fortress. For older versions you can run the 32-bit compiled edition with a 64-bit system, provided that you have the (32-bit) shared libraries available that the program needs. Note that users of 32-bit systems have to click the All Versions button on the Dwarf Fortress download page in order to get the 32-bit edition.
  
 
Dwarf Fortress for Linux is meant to be run from a terminal (command-line) interface, and so the instructions here will assume you know how to login and get to a command prompt.  At least in the default mode, however, Dwarf Fortress is an X client (graphical desktop) program, so you should be in a terminal inside an X session before starting the game.  Dwarf Fortress will create a new X window outside of the terminal window, so don't worry about the size of the terminal.
 
Dwarf Fortress for Linux is meant to be run from a terminal (command-line) interface, and so the instructions here will assume you know how to login and get to a command prompt.  At least in the default mode, however, Dwarf Fortress is an X client (graphical desktop) program, so you should be in a terminal inside an X session before starting the game.  Dwarf Fortress will create a new X window outside of the terminal window, so don't worry about the size of the terminal.
  
*'''Downloading''': Either download it from the [http://www.bay12games.com/dwarves/ Dwarf Fortress Homepage], or from the terminal call  
+
*'''Downloading''': Either download it from the [http://www.bay12games.com/dwarves/ Dwarf Fortress Homepage], or from the terminal call (replacing "XX_YY" with the numbers in the most current Dwarf Fortress file version, found on the [http://www.bay12games.com/dwarves/ site]):
'wget http://www.bay12games.com/dwarves/df_XX_YY_linux.tar.bz2'
+
<code>wget http://www.bay12games.com/dwarves/df_XX_YY_linux.tar.bz2</code>
* '''Unpacking''': Dwarf Fortress is shipped as a (bzip2) compressed tar archive.  It will extract into a new directory called '''df_linux'''.  So, cd to wherever you want the game to be unpacked, and then run '''tar xjf /path/to/df_XX_YY_linux.tar.bz2''' (where df_XX_YY_linux.tar.bz2 is the filename).  Then run '''cd df_linux''' to change into the new directory, and run '''./df''' to execute the Dwarf Fortress wrapper script.
+
* '''Unpacking''': Dwarf Fortress is shipped as a (bzip2) compressed tar archive.  It will extract into a new directory called '''df_linux'''.  So, cd to wherever you want the game to be unpacked, and then run
 +
tar -xjf /path/to/df_XX_YY_linux.tar.bz2
 +
(where df_XX_YY_linux.tar.bz2 is the filename).  Then
 +
cd df_linux
 +
to change into the new directory, and
 +
./df
 +
to execute the Dwarf Fortress wrapper script.
  
(note: tar xjvf /df_XX_YY_linux.tar.bz2 may be needed in some cases.)
+
(note: <code>tar -xjvf ./df_XX_YY_linux.tar.bz2</code> may be needed in some cases.)
  
Modern desktop PCs (of the Intel/AMD persuasion) contain CPUs that can run in either 32-bit or 64-bit modes.  When you install Linux, you choose one of these architectures. The programs on your system will then be compiled either for the 32-bit (i386, x86) arch, or the 64-bit (amd64, x86_64) arch.  If you've forgotten which one you have, you can check:
+
When you installed Linux, you chose one of a 32-bit or 64-bit architectures. The programs on your system will then be compiled either for the 32-bit (i386, x86) arch, or the 64-bit (amd64, x86_64) arch.  If you've forgotten which one you have, you can check by running the command <code>uname -m</code> in a terminal. A result of <code>x86_64</code> and <code>i686</code> would indicate a 64-bit or a 32-bit system respectively.
  
$ uname -m
+
All that's needed now is to install the required dependencies. If you are getting errors about missing SDL_image libraries (etc.) then you simply need to install them. Use your distribution's package manager for this -- details will be extremely distribution-specific. You don't need the development versions of the packages with the headers (although that won't hurt) -- you just need the runtime versions, with the actual shared libraries. Specific installation commands for some popular distributions are listed below.
x86_64
 
  
The above would indicate a 64-bit system. Here's one from a 32-bit system:
+
Since Dwarf Fortress 0.43.05 is now compiled for both architectures, running natively shouldn't be an issue. However if you're wanting to run an older version of Dwarf Fortress on a 64-bit system, things get a bit trickier. Since older DF is only a 32-bit application, it will need 32-bit versions of the shared libraries. Some Linux distributions provide these in one or more packages that you can download. For example, in Debian, you'll need to enable the 32bit architecture in your package manager and install the relevant 32-bit libraries like libSDL. If your distribution does not include these, then you may have to supply them manually.
  
$ uname -m
 
i686
 
  
Dwarf Fortress is compiled for 32-bit systems, so if you're on a 32-bit system, things will be slightly easier.  If you are getting errors about missing SDL_image libraries (etc.) then you simply need to install them.  Use your distribution's package manager for this -- details will be extremely distribution-specific.  You don't need the development versions of the packages with the headers (although that won't hurt) -- you just need the runtime versions, with the actual shared libraries.
+
=== Debian-based ===
 +
==== 64bit ====
  
If you're on a 64-bit system, then things get a bit trickier.  Since DF is a 32-bit application, it needs 32-bit versions of the shared libraries.  Some Linux distributions provide these in one or more packages that you can download.  For example, in Debian, the ia32-libs package contains most of the common 32-bit libraries, including libSDL. If your distribution does not include these, then you may have to supply them manually.
+
The error:
  
 +
  ./libs/Dwarf_Fortress: error while loading shared libraries: libSDL-1.2.so.0: cannot open shared object file: No such file or
 +
  directory
 +
 +
indicates you are missing one or more libraries.
  
=== Debian-based ===
+
In Ubuntu 16 you can solve it with the command:
  
If you get an error like this:
+
  $ sudo apt-get install libsdl1.2debian libsdl-image1.2 libSDL-ttf2.0-0
  ./libs/Dwarf_Fortress: error while loading shared libraries: libSDL_image-1.2.so.0:
 
cannot open shared object file: No such file or directory
 
or
 
  ./df: ./libs/Dwarf_Fortress: not found
 
: it means that your system is missing one or more shared libraries.
 
  
On Ubuntu/Debian and its derivatives, installing 32-bit libraries is as easy as appending ":i386" to the name of the library. For libsdl-image and libsdl-ttf, this amounts to:
+
If you're trying to run a version of Dwarf Fortress older than 0.43.05, you'll need to install the 32bit versions of the libraries. You can do this like:
  
 
   $ sudo dpkg --add-architecture i386
 
   $ sudo dpkg --add-architecture i386
 
   $ sudo apt-get update
 
   $ sudo apt-get update
   $ sudo apt-get install libsdl-image1.2:i386 libsdl-ttf2.0-0:i386 libgtk2.0-0:i386 libjpeg62-turbo:i386 libglu1-mesa:i386 libopenal1:i386
+
   $ sudo apt-get install libsdl-image1.2:i386 libsdl-ttf2.0-0:i386 libgtk2.0-0:i386 libglu1-mesa:i386 libopenal1:i386
  
Ubuntu 14 doesn't have a package named libjpeg62-turbo, so if your system reports that no package with that name can be found, you may still install libjpeg-turbo8 (and libjpeg8) on Ubuntu14, or even omit the libjpeg62-turbo package name and your game would still work. (Both approaches have been tested and are known to work).
+
Otherwise, it's just a simple
 +
 
 +
  $ sudo apt-get install libsdl-image1.2 libsdl-ttf2.0-0 libgtk2.0-0 libglu1-mesa libopenal1
 +
 
 +
In Linux Mint 18 you might come across the error:
 +
 
 +
  ./libs/Dwarf_Fortress: error while loading shared libraries: libSDL_ttf-2.0.so.0: cannot open shared object file:
 +
  No such file or directory
 +
 
 +
Download and install the missing library with:
 +
 
 +
  $ sudo apt-get install libSDL-ttf2.0-0
 +
 
 +
==== 32bit ====
 +
Nice and easy:
 +
 
 +
  $ sudo apt-get install libsdl-image1.2 libsdl-ttf2.0-0 libgtk2.0-0 libglu1-mesa libopenal1
  
On Ubuntu 13 and below:
 
  $ sudo apt-get install ia32-libs libsdl-image1.2 libsdl-sound1.2 libsdl-ttf2.0-0
 
  
 
=== Fedora ===
 
=== Fedora ===
  
On 64-bit Fedora installations you can install 32-bit libraries by appending ".i686" to the package name:
+
Dwarf Fortress has been packaged in [https://rpmfusion.org/ RPM Fusion Nonfree], using a similar method as it is done in Arch Linux (see below). After [https://rpmfusion.org/Configuration installing RPM Fusion] you can simply run the following commands to install and run Dwarf Fortress, which will pull in all the required dependencies:
 +
 
 +
  $ sudo dnf install dwarffortress
 +
  $ dwarffortress
 +
 
 +
Some other tool are provided by the same packager in the [https://mars.arosser.com/fedora/dwarffortress/dwarffortress.repo "Dwarf Fortress for Fedora"] repository. For more information please [http://www.bay12forums.com/smf/index.php?topic=158289.msg7009116#msg7009116 see this forum thread].
 +
 
 +
If you want to install 64-bit Dwarf Fortress manually, you can run the following:
 +
 
 +
  $ sudo dnf install SDL SDL_image SDL_ttf gtk2-devel openal-soft alsa-lib alsa-plugins-pulseaudio mesa-dri-drivers
  
   $ sudo dnf install SDL.i686 SDL_image.i686 SDL_ttf.i686 gtk2-devel-2.24.28-1.fc22.i686 openal-soft.i686 alsa-lib.i686 alsa-plugins-pulseaudio.i686 mesa-dri-drivers-10.6.9-1.20151008.fc22.i686
+
On 64-bit Fedora installations, to install 32-bit Dwarf Fortress you can install 32-bit libraries by appending ".i686" to the package name:
 +
 
 +
   $ sudo dnf install SDL.i686 SDL_image.i686 SDL_ttf.i686 gtk2-devel.i686 openal-soft.i686 alsa-lib.i686 alsa-plugins-pulseaudio.i686 mesa-dri-drivers.i686
  
 
Fedora installs all 32-bit libraries to /usr/lib and 64-bit libraries to /usr/lib64 (with /lib and /lib64 being links to these two directories), so if you need to install stuff manually, look in there.
 
Fedora installs all 32-bit libraries to /usr/lib and 64-bit libraries to /usr/lib64 (with /lib and /lib64 being links to these two directories), so if you need to install stuff manually, look in there.
Line 129: Line 154:
 
To enable the [multilib] repository run:
 
To enable the [multilib] repository run:
 
   nano /etc/pacman.conf
 
   nano /etc/pacman.conf
And delete the pound symbol(#) in front of these three lines (Make sure the top one says #[multilib] NOT #[multilib-testing]
+
And delete the pound symbol(#) in front of these three lines (Make sure the top one says #[multilib] NOT #[multilib-testing]. Note that the <code>SigLevel</code> line may not be present under [multilib] and it will most likely be higher up in the pacman.conf. This is fine and you can then simply remove the pound symbol from the two other lines.
 
  #[multilib]
 
  #[multilib]
 
  #SigLevel = PackageRequired
 
  #SigLevel = PackageRequired
Line 171: Line 196:
  
 
=== CentOS 7 ===
 
=== CentOS 7 ===
CentOS7 is 64-bit, and not all of the required libraries are in the repositories.  However, the process is not all that bad, and the last step for the openal library could probably be extended to all of the required libraries for running Dwarf Fortress on other versions of linux.
 
  
Install the 32-bit libsdl.  The .i686 implies 32-bit:
+
Dwarf Fortress is now 64-bit, so simply run:
  sudo yum install SDL.i686
 
  
Fortunately, the PUIAS repos have compiled SDL_image for CentOS7 (PUIAS seems to be it's own version of linux, but all of the related libraries seem to have CentOS7 as the distribution).  Get it [http://pkgs.org/centos-7/puias-x86_64/SDL_image-1.2.12-7.sdl7.i686.rpm.html here].  For SDL_ttf, you can use the i686 rpm intended for Fedora 18.  Other versions would probably work, but this one is tested on at least one system.  Get it here [http://rpmfind.net/linux/rpm2html/search.php?query=libSDL_ttf-2.0.so.0 here]; the filename is SDL_ttf-2.0.11-2.fc18.i686.rpm.  *Note: since this rpm was intended for Fedora, there may be some conflicts related to it - if you feel uneasy, you could probably apply the local library method to this rpm.  Install both rpm's:
+
   sudo yum install SDL SDL_image SDL_ttf openal
   sudo rpm -Uvh SDL_image-1.2.12-7.sdl7.i686.rpm
 
  sudo rpm -Uvh SDL_ttf-2.0.11-2.fc18.i686.rpm
 
  
The PUIAS repository also has a CentOS7 32-bit openal library. However, if you have a media player installed such as VLC, the rpm will conflict and fail to install. A solution to this is to make a custom libraries folder in your home path. Download the rpm [http://pkgs.org/centos-7/puias-x86_64/openal-soft-1.15.1-3.sdl7.i686.rpm.html here], and move it to its own directory for simplicity, such as ~/test.  Then, extract the rpm, copy the /usr/ files to your local folder, and finally fix a library linking issue:
+
Note that CentOS 7 ships with glibc 2.17, but Dwarf Fortress by default would like 2.18. [http://www.bay12games.com/dwarves/mantisbt/view.php?id=9893 This bug] has a fix, simply copy the [http://pastebin.com/jX4Wf062 Pastebin script], then move the libraries into a new folder.
  rpm2cpio openal-soft-1.15.1-3.sdl7.i686.rpm | cpio -idmv
 
  cp -r ./usr/* ~/local
 
  ln -s ~/local/lib/libopenal.so.1 ~/local/lib/libopenal.so
 
  
Finally, create a custom run script which will link the openal libraries to Dwarf Fortress and the launch the game.  cd into df_linux, and then open your favorite text editor and save the following script in a file with a name such as 'run':
+
  cd df_linux
   #!/bin/bash
+
   curl -L http://pastebin.com/raw/jX4Wf062 > df
   export LD_LIBRARY_PATH=~/local/lib
+
  mkdir c_libs
  ./df
+
   mv libs/libgcc_s.so.1 libs/libstdc++.so.6 c_libs/
 
+
   chmod a+x df
Save the script, and set it to executable:
 
   sudo chmod 777 run
 
  
 
Then run it!
 
Then run it!
   ./run
+
   ./df
  
 
=== Gentoo ===
 
=== Gentoo ===

Revision as of 04:06, 13 September 2018

This article is about the current version of DF.
Note that some content may still need to be updated.


Download: Linux · Mac OS X ·Windows · all versions · starter packs


Download

You can always get Dwarf Fortress as Toady One, the developer, released it from the Bay12 site (listed at the top of the page).

As of v0.43.05, the three downloads linked on the main page are 64-bit versions of DF for Windows, macOS, and Linux. "All versions" links to a page with additional choices, including 32-bit builds for all platforms, "small" builds for Windows (which lack sound files), and "legacy" builds for Windows. Generally, the SDL builds for Windows should be preferred, although the Legacy builds may be necessary on some older computers.

Third-Party Packages

There are several packages which bundle the game with several utilities and graphics sets, usually configurable with an included launcher. These are listed on the Lazy Newb Pack page.

The Dwarf Fortress community often creates custom graphics sets, tilesets and color schemes. They're like graphical mods that make DF look prettier or just different. A lot of people pack the game folder with the tileset installed and everything already set up, so all you have to do is extract and play. Among the most popular of these are Ironhand's Graphics Set and Phoebus' Graphic Set. Most notable graphics sets are included in the packs mentioned above.

Installation

Also see: System requirements

Windows

There is no installer for the game. Simply extract the archive file to a folder somewhere and run the game from within the folder by opening "Dwarf Fortress.exe".

Make sure to actually extract the archive; do not just open the archive and run the game from the window that appears. If you do this then it may appear to work, but your save game data will get discarded. This is the cause of many "my saved games keep getting deleted" complaints. The game also needs to be able to write to its own folder, so do not install it in C:\Program Files if you are running Windows Vista or later.

If you have an error stating that MSVCP140.dll is missing, it can be obtained by downloading Visual C++ Redistributable for Visual Studio 2015. When prompted choose the x64 version for 64-bit DF, or the x86 version for 32-bit DF.

Mac

The Mac version is not a single application bundle, but like the Windows version it consists of a folder containing the application along with data files and there is no installer. The entire folder can be dragged into the Applications folder or placed elsewhere. As with the Windows version, the game must be able to write to its own folder.

To start the game execute the launch script "df". Launching "dwarfort.exe" by itself will not work (since the "df" script sets up environment variables pointing to DF's libraries).

On OS X 10.8 and above, you will need to update the SDL_ttf library to run Dwarf Fortress. Bug:7389

  • Download SDL_ttf 2.0.11 and replace the file libs/SDL_ttf.framework with the one from the downloaded folder.

On OS X 10.11 and above, for the 32-bit version of DF only, you will need to update the SDL library:

  • Download SDL 1.2.15 and replace the file libs/SDL.framework with the one from the downloaded folder

Alternatively, instead of replacing SDL, you can change the PRINT_MODE setting in data/init/init.txt to STANDARD (or anything not related to 2D). Bug:2624

Retina display users will also need to change PRINT_MODE to STANDARD (or any non-2D option) in init.txt. Bug:6031

Linux

As of 0.43.05, both 64-bit and 32-bit compiled editions are available for Dwarf Fortress. For older versions you can run the 32-bit compiled edition with a 64-bit system, provided that you have the (32-bit) shared libraries available that the program needs. Note that users of 32-bit systems have to click the All Versions button on the Dwarf Fortress download page in order to get the 32-bit edition.

Dwarf Fortress for Linux is meant to be run from a terminal (command-line) interface, and so the instructions here will assume you know how to login and get to a command prompt. At least in the default mode, however, Dwarf Fortress is an X client (graphical desktop) program, so you should be in a terminal inside an X session before starting the game. Dwarf Fortress will create a new X window outside of the terminal window, so don't worry about the size of the terminal.

  • Downloading: Either download it from the Dwarf Fortress Homepage, or from the terminal call (replacing "XX_YY" with the numbers in the most current Dwarf Fortress file version, found on the site):

wget http://www.bay12games.com/dwarves/df_XX_YY_linux.tar.bz2

  • Unpacking: Dwarf Fortress is shipped as a (bzip2) compressed tar archive. It will extract into a new directory called df_linux. So, cd to wherever you want the game to be unpacked, and then run
tar -xjf /path/to/df_XX_YY_linux.tar.bz2

(where df_XX_YY_linux.tar.bz2 is the filename). Then

cd df_linux

to change into the new directory, and

./df

to execute the Dwarf Fortress wrapper script.

(note: tar -xjvf ./df_XX_YY_linux.tar.bz2 may be needed in some cases.)

When you installed Linux, you chose one of a 32-bit or 64-bit architectures. The programs on your system will then be compiled either for the 32-bit (i386, x86) arch, or the 64-bit (amd64, x86_64) arch. If you've forgotten which one you have, you can check by running the command uname -m in a terminal. A result of x86_64 and i686 would indicate a 64-bit or a 32-bit system respectively.

All that's needed now is to install the required dependencies. If you are getting errors about missing SDL_image libraries (etc.) then you simply need to install them. Use your distribution's package manager for this -- details will be extremely distribution-specific. You don't need the development versions of the packages with the headers (although that won't hurt) -- you just need the runtime versions, with the actual shared libraries. Specific installation commands for some popular distributions are listed below.

Since Dwarf Fortress 0.43.05 is now compiled for both architectures, running natively shouldn't be an issue. However if you're wanting to run an older version of Dwarf Fortress on a 64-bit system, things get a bit trickier. Since older DF is only a 32-bit application, it will need 32-bit versions of the shared libraries. Some Linux distributions provide these in one or more packages that you can download. For example, in Debian, you'll need to enable the 32bit architecture in your package manager and install the relevant 32-bit libraries like libSDL. If your distribution does not include these, then you may have to supply them manually.


Debian-based

64bit

The error:

 ./libs/Dwarf_Fortress: error while loading shared libraries: libSDL-1.2.so.0: cannot open shared object file: No such file or 
 directory

indicates you are missing one or more libraries.

In Ubuntu 16 you can solve it with the command:

 $ sudo apt-get install libsdl1.2debian libsdl-image1.2 libSDL-ttf2.0-0

If you're trying to run a version of Dwarf Fortress older than 0.43.05, you'll need to install the 32bit versions of the libraries. You can do this like:

 $ sudo dpkg --add-architecture i386
 $ sudo apt-get update
 $ sudo apt-get install libsdl-image1.2:i386 libsdl-ttf2.0-0:i386 libgtk2.0-0:i386 libglu1-mesa:i386 libopenal1:i386

Otherwise, it's just a simple

 $ sudo apt-get install libsdl-image1.2 libsdl-ttf2.0-0 libgtk2.0-0 libglu1-mesa libopenal1

In Linux Mint 18 you might come across the error:

 ./libs/Dwarf_Fortress: error while loading shared libraries: libSDL_ttf-2.0.so.0: cannot open shared object file: 
 No such file or directory

Download and install the missing library with:

 $ sudo apt-get install libSDL-ttf2.0-0

32bit

Nice and easy:

 $ sudo apt-get install libsdl-image1.2 libsdl-ttf2.0-0 libgtk2.0-0 libglu1-mesa libopenal1


Fedora

Dwarf Fortress has been packaged in RPM Fusion Nonfree, using a similar method as it is done in Arch Linux (see below). After installing RPM Fusion you can simply run the following commands to install and run Dwarf Fortress, which will pull in all the required dependencies:

 $ sudo dnf install dwarffortress
 $ dwarffortress

Some other tool are provided by the same packager in the "Dwarf Fortress for Fedora" repository. For more information please see this forum thread.

If you want to install 64-bit Dwarf Fortress manually, you can run the following:

 $ sudo dnf install SDL SDL_image SDL_ttf gtk2-devel openal-soft alsa-lib alsa-plugins-pulseaudio mesa-dri-drivers

On 64-bit Fedora installations, to install 32-bit Dwarf Fortress you can install 32-bit libraries by appending ".i686" to the package name:

 $ sudo dnf install SDL.i686 SDL_image.i686 SDL_ttf.i686 gtk2-devel.i686 openal-soft.i686 alsa-lib.i686 alsa-plugins-pulseaudio.i686 mesa-dri-drivers.i686

Fedora installs all 32-bit libraries to /usr/lib and 64-bit libraries to /usr/lib64 (with /lib and /lib64 being links to these two directories), so if you need to install stuff manually, look in there.

Arch Linux

Although Dwarf Fortress may be installed using the method above (with some modifications), it is available through pacman (Arch Linux's package management system), in the [community], for 32-bit, and the [multilib], for 64-bit, repositories. These packages are updated as Dwarf fortress is updated, and handle required dependencies.

32-bit

All of the following commands must be run as root

First, download and install Dwarf Fortress with pacman

 pacman -S dwarffortress

Any required dependencies will be installed, too.

Next you need to add the user(s) that will be playing the game to the games group

 gpasswd -a [users] games

Any users you added to the games group must now be logged out, if they were logged in

Now Dwarf Fortress should be playable by typing:

 dwarffortress

As any user in the games group. Any edits to game files must be done in the '.dwarffortress' directory in the user's home directory, not /opt/dwarffortress.

64-Bit

Installing Dwarf Fortress on 64-bit installs of Arch Linux is the same as installing it on 32-bit systems, with the exception of the [multilib] repository needing to be enabled prior to install.

These commands also must be run as root.

To enable the [multilib] repository run:

 nano /etc/pacman.conf

And delete the pound symbol(#) in front of these three lines (Make sure the top one says #[multilib] NOT #[multilib-testing]. Note that the SigLevel line may not be present under [multilib] and it will most likely be higher up in the pacman.conf. This is fine and you can then simply remove the pound symbol from the two other lines.

#[multilib]
#SigLevel = PackageRequired
#Include = /etc/pacman.d/mirrorlist

So that they look like this

[multilib]
SigLevel = PackageRequired
Include = /etc/pacman.d/mirrorlist

Save the file by typing

 ctrl x

Then run:

 pacman -Syyu
Sound and Graphics

After that you can continue the install as detailed in the 32-bit section. Required 32-bit dependencies will automatically be installed, however you may have to install more dependencies, depending on what sound support you use, and your graphics card

If you use alsa sound, install lib32-alsa-lib with:

 pacman -S lib32-alsa-lib

If use use pulse sound install lib32-libpulse with:

 pacman -S lib32-libpulse

You will also need to install a 32-bit graphics driver. Install the driver from multilib that corresponds to your driver/device on this chart. For example, if you have xf86-video-nouveau installed, you would run:

 pacman -S lib32-mesa-libgl

If you don't know what driver/device you're currently using run:

 lspci -k

Find the line that starts with "VGA compatible controller." Your driver will be listed under "kernel driver in use", like so:

 01:00.0 VGA compatible controller: NVIDIA Corporation GK106M [GeForce GTX 765M] (rev a1)
         Subsystem: ASUSTeK Computer Inc. Device 119d
         Kernel driver in use: nvidia
         Kernel modules: nouveau, nvidia

If you are using/wish to use the AMD catalyst drivers, please note that they are no longer available within the main arch repositories. You will have to install them from the AUR. See here for more information.

If you have Nvidia graphics, you may also want to install lib32-nvidia-utils with:

 pacman -S lib32-nvidia-utils

CentOS 7

Dwarf Fortress is now 64-bit, so simply run:

 sudo yum install SDL SDL_image SDL_ttf openal

Note that CentOS 7 ships with glibc 2.17, but Dwarf Fortress by default would like 2.18. This bug has a fix, simply copy the Pastebin script, then move the libraries into a new folder.

 cd df_linux
 curl -L http://pastebin.com/raw/jX4Wf062 > df
 mkdir c_libs
 mv libs/libgcc_s.so.1 libs/libstdc++.so.6 c_libs/
 chmod a+x df

Then run it!

 ./df

Gentoo

There is a a Dwarf Fortress ebuild in the main Gentoo's portage tree compatible with the new multilib support.

 # emerge -av games-roguelike/dwarf-fortress

Wine

Downloading the windows version and running it with Wine works fine (platinum on 1.7.47 as of .4x.xx, which means the program runs flawlessly without any initial user configuration). This also avoids any issues with 32-bit versus 64-bit mode.

Troubleshooting

If you get errors, it is likely that others will have had the same problem; Try searching the bay12games forum with the error message.

Sound

After installing, DF will run, but will complain that it cannot find the OpenAL library and cannot play sounds, even when OpenAL (i386) has been installed. This is due to a bug/feature in which there is no link from the name of the library that DF is looking for ("libopenal.so") to its implementation ("libopenal.so.1" - technically another link). To fix this, simply provide the necessary links in DF's own libs directory:

 $ cd df_linux/libs
 $ ln -s /usr/lib/i386-linux-gnu/libopenal.so.1 ./libopenal.so
 $ ln -s /usr/lib/i386-linux-gnu/libsndfile.so.1 ./libsndfile.so

Upgrading

Since every new version of Dwarf Fortress unpacks in a directory named df_linux you have to manage upgrades yourself - or use the Linux Updater Script. As on all systems, you should not unpack a new version of DF on top of an old version's directory -- this will cause things to break, usually in subtle and mysterious ways. Instead, you should either delete or rename the old df_linux directory first, before extracting the new version.

Manually installing 32-bit libraries

If you do need to manually install the libraries, then the first step is to figure out where you will be putting them. Check to see where your other 32-bit libraries are already installed; for example, on Debian, some are in /lib32 and others are in /usr/lib32. Since libSDL is in /usr/lib32 on a Debian system, that's where we'll want to put libSDL_image and libSDL_ttf. On other distributions, the path could be different.

The second step is to get the 32-bit libraries. You can typically do this by downloading them directly from your distribution's 32-bit package repository. Again using Debian as our example, we can perform a search at http://packages.debian.org/ for files containing the word libSDL_image for the Intel x86 architecture. This takes us to a results page from which we can proceed to the libsdl-image1.2 package page with a list of download links arranged by architecture. Grab the i386 package from here, and repeat this for the libSDL_ttf package, and whatever other library you are missing. Store these package files somewhere convenient.

The third step is to extract the libraries from the packages and get them in the proper location. You probably won't be able simply to install the packages using your package manager, because they are for the wrong architecture. Instead, you'll probably have to extract them by hand. The steps for doing this are distribution-specific, so when in doubt consult your distribution's help resources. Here are the steps for a .deb package.

  • cd into some temporary working directory such as /tmp
  • Extract the files from the .deb archive, which is in ar(1) format:
 tar x /path/to/libsdl-image1.2*_i386.deb
This creates three files: debian-binary, control.tar.gz and data.tar.gz. We only care about data.tar.gz.
  • Extract data.tar.gz:
 tar xzf data.tar.gz
This creates a subdirectory named usr with various files inside it. We only care about usr/lib/libSDL_image-1.2.so.0.8.2 (or whatever precise version yours has).
  • Move the shared library into place:
 sudo mv usr/lib/libSDL_image-1.2.so.* /usr/lib32/
  • Create a symlink to it:
 cd /usr/lib32
 sudo ln -s libSDL_image-1.2.so.0.* libSDL_image-1.2.so.0
 cd -

Repeat this for libSDL_ttf and whatever other libraries are required.

NOTE: If you get the error that libsndfile.so is not found, you must use the following:

 find */libsndfile.so*

cd to the correct directory, then use ln as shown above.


"Not found: /data/art/mouse.png" and similar errors

Fix 1: Preload zlib

Due to incompatibilities between DF's included zlib and newer versions of zlib, libpng can fail on newer systems. A solution is to add this line to the beginning of /your/path/df_linux/df (or /your/path/df_linux/dfhack if you use DFHack):

export LD_PRELOAD=/usr/lib/libz.so.1

Note that this path can vary - be sure that it is referring to a 32-bit zlib.

Fix 2: Use bmp instead

Another solution (if preloading zlib doesn't work) is to force DF to use the BMP versions of image files. You must first edit the /data/init/init.txt file and change all occurrences of "png" to "bmp". This should solve all the error messages except for one: "Not found: data/art/mouse.png" since there is no setting in the init files to change it. The workaround for this is to edit the Dwarf_Fortress file found in the /your/path/df_linux/libs folder which contains the setting for the mouse cursor. If you don't know how to do that, you can try this:

  • cd to the /df_linux/libs folder
  • open Dwarf_Fortress in vi or any other editor of your choise:
 vi ./Dwarf_Fortress
This opens the file for editing (text mode). If you are not familiar with vi, it would be a good idea to follow these steps exactly and not press any other keys since they all activate specific commands. If you do press a key though, you can press the ESC key a few times to cancel the command.
  • With vi open, write the following string and press Enter:
 /mouse
This will search for all the strings that contain the word "mouse" and place the cursor on the first match. Pressing the n key will cycle through all the matches.
  • Press the n key until the cursor moves to the desired string, which is "data/art/mouse.png". If you accidentally move past the string, you can cycle back through the matched strings using the N key (shift + n).
  • Once you find the right string, you will have to move the cursor over the "p" in "[..]/mouse.png". You do that by pressing the l key which will move the cursor to the right. There is also the h key to move the cursor to the left, in case you move past it.
  • With the cursor in the right position press the following key sequence:
 xxxibmp
This will replace the .png extension with the .bmp one which solves the problem of the missing /data/art/mouse.png error.
  • All there is left to do is to save the modifications to the file and quit vi. For that, press the ESC key once or twice and then press the following key sequence after which you press Enter:
 :wq
This saves the changes and quits 'vi'

Now the game should work properly. Have fun!

FreeBSD

Although there is no official version ported to FreeBSD, Dwarf Fortress can nevertheless be run using either Wine or FreeBSD's compatibility with Linux. However, attempting to run the Linux version out of the blue will result in an error about missing library files. Such files must be downloaded from special linux-compatible packages or ports; using your preferred installation method, install the following:

linux-c6

 sudo pkg install linux-c6-gtk2 linux-c6-sdl linux-c6-sdl_image linux-c6-sdl_ttf linux-c6-libGLU \
 linux-c6-openal-soft linux-c6-libsndfile linux-c6-alsa-plugins-oss

linux-f10

If you don't have the linux-c6 ports available in your system, you can still run Dwarf Fortress (albeit without sound) using the following packages:

 sudo pkg install linux-f10-alsa-lib linux-f10-atk linux-f10-cairo linux-f10-expat linux-f10-fontconfig \
 linux-f10-gtk2 linux-f10-jpeg linux-f10-pango linux-f10-png linux-f10-sdl linux-f10-sdl_image linux-f10-tiff \
 linux-f10-xorg-libs linux-sdl_ttf linux_base-f10 linux_dri linux-f10-libGLU

linux_dri might be optional if you have the NVIDIA driver. Note that due to the lack of a linux-f10-libsndfile port, the sound will not work. Requests are being made to port it, as well as a DF port itself.


After you install the required packages, copy (or symlink) DF's own library files to the linux-compatible directory:

 cd dwarf_fortress_directory
 sudo cp libs/lib* /compat/linux/usr/lib/

Or

 cd dwarf_fortress_directory
 sudo ln -s libs/lib* /compat/linux/usr/lib/

You can then run df normally. Although it will likely display a bunch of warnings and errors about fonts, it should work.

If you want to avoid polluting your linux-compatible directory, you can always just set LD_LIBRARY_PATH when running df:

 LD_LIBRARY_PATH=libs:$LD_LIBRARY_PATH ./df

Documentation

Fortunately the documentation on this wiki is very detailed and extensive. You may want to start out with:

Then move on to: