When comparing Nix vs YUM, the Slant community recommends Nix for most people. In the question“What are the best Linux package managers?” Nix is ranked 6th while YUM is ranked 15th. The most important reason people chose Nix is:
Nix is a purely functional package management system. This means that the act of building a package does not have side effects, such as destructively updating or deleting files that may be used by other packages.
Ranked in these QuestionsQuestion Ranking
Pros
Pro No side effects when building packages
Nix is a purely functional package management system. This means that the act of building a package does not have side effects, such as destructively updating or deleting files that may be used by other packages.
Pro Isolated development environments
Nix allows the creation of project-specific shell and build environments which are isolated from the rest of the system. These environments are defined declaratively to ensure reproducibility.
Pro Can replace docker in some places
Pro Can use multiple versions of the same package
Because of the functional approach it takes, Nix makes it easy for systems to use multiple versions of the same package simultaneously, and ensure that updating or removing a package can't break other packages.
Pro The configuration works on "All machines"
No more of the traditional: "it works on my machine". When it says reproducible, this is the real deal.
Pro Avoids dependency hell
All the metadata for installed software is stored into a XML file. This is used to avoid conflicting dependencies among packages. What's more, YUM also automatically syncs remote metadata to the local client in order to avoid failures if a command is not run at the correct interval.
Pro Simple syntax
Pro Binary delta for faster transfer times
Yum supports Delta RPMs which allow transmitting only the parts of the package that have changed.
Pro Is/was the industry standard
YUM is still widely used in corporate environments.
Pro Provides pre and post install sanity checks
What might be thought of a standard feature, isn't. Thankfully RPM provides both a transaction test and a post install verification to make sure everything installs neatly.
Pro Supports multiple verification methods
Supports verification with GPG and MD5.
Pro Clean and easy to understand
Pro Supports multiple compression methods
Supports gzip, bzip2, lzma, or xz compression.
Pro Allows for complex dependency definitions
Alongside allowing dependency on a certain package, it allows depending on a library, versioned symbol, or a GAC'd Mono assembly.
Cons
Con Does not work well for services on non-NixOS systems
When using Nix with anything other than NixOS you can run into difficulties with trying to start up services. For example, you can install docker with Nix, but it won't integrate with the host system's systemd leaving you to handcraft awkward workarounds in order to start the background service that docker requires. This seems like a critical flaw when using Nix on anything that is not NixOS, and it's unfortunate because this affects many of the packages many users would be most interested in using Nix to handle.
Con Steep learning curve
Con Cannot handle filetypes that have different semantics across different versions
While the functional approach that Nix takes is great for sandboxing binary artifacts of packages, it seriously lacks any power in handling configuration files or user data. It's difficult to upgrade and downgrade files where semantics and syntax can change between versions. Especially in Debian/Ubuntu it can cause severe problems where the upgrade process blocks and the user needs to resolve the 3-way merge.
Con Feels slightly over-complicated
Con Can be very slow to download headers if not on broadband
Yum can be much slower than other package managers if the internet speed is not at least average to high.
Con Slow (and might be fragile) dependency resolution
YUM dependency resolution is very slow. In addition to it, the people often experiencing very hard dependencies (it might be not a YUM problem).
Con Does fsync often
Like its successor, DNF, YUM does fsync too often. The result is poor YUM and system performance while YUM does its work.
Con Very slow overall
YUM is very slow - beginning with relatively slow startup, extremely slow default plugins, slow dependency resolution, and ending with slow installation of packages.
Con Poor design
YUM is written in Python 2 and people often blaming the quality of YUM's code.