Troubleshooting This section provides solutions for some common problems. See the Nix bug tracker for a list of currently known issues.
Collisions in <command>nix-env</command> Symptom: when installing or upgrading, you get an error message such as $ nix-env -i docbook-xml ... adding /nix/store/s5hyxgm62gk2...-docbook-xml-4.2 collission between `/nix/store/s5hyxgm62gk2...-docbook-xml-4.2/xml/dtd/docbook/calstblx.dtd' and `/nix/store/06h377hr4b33...-docbook-xml-4.3/xml/dtd/docbook/calstblx.dtd' at /nix/store/...-builder.pl line 62. The cause is that two installed packages in the user environment have overlapping filenames (e.g., xml/dtd/docbook/calstblx.dtd. This usually happens when you accidentally try to install two versions of the same package. For instance, in the example above, the Nix Packages collection contains two versions of docbook-xml, so nix-env -i will try to install both. The default user environment builder has no way to way to resolve such conflicts, so it just gives up. Solution: remove one of the offending packages from the user environment (if already installed) using nix-env -e, or specify exactly which version should be installed (e.g., nix-env -i docbook-xml-4.2). Alternatively, you can modify the user environment builder script (in prefix/share/nix/corepkgs/buildenv/builder.pl) to implement some conflict resolution policy. E.g., the script could be modified to rename conflicting file names, or to pick one over the other.
<quote>Too many links</quote> error in the Nix store Symptom: when building something, you get an error message such as ... mkdir: cannot create directory `/nix/store/name': Too many links This is usually because you have more than 32,000 subdirectories in /nix/store, as can be seen using ls -l: $ ls -l /nix/store drwxrwxrwt 32000 nix nix 4620288 Sep 8 15:08 store The ext2 file system is limited to a inode link count of 32,000 (each subdirectory increasing the count by one). Furthermore, the st_nlink field of the stat system call is a 16-bit value. This only happens on very large Nix installations (such as build machines). Quick solution: run the garbage collector. You may want to use the option. Real solution: put the Nix store on a file system that supports more than 32,000 subdirectories per directory, such as ReiserFS. (This doesn’t solve the st_nlink limit, but ReiserFS lies to the kernel by reporting a link count of 1 if it exceeds the limit.)