Dealing with dependencies

If you have installed a program in Windows, you know it's hard. You need the .NET framework, the C++ redistributable from a certain year, maybe even an external framework.

Well, a similar thing happens when you try to install something in Linux without a package manager. At least if you have one, sometimes you can use --fix-missing or equivalent.

But what if you were to create a package manager?

The dependency hell starts, and it hits hard.

I was doing pat (Package Assistant Tool) for my distro, but I didn't knew how to start; All I knew was how package managers worked, to the end user .

  1. Check if a package exists
  2. Check dependencies
  3. Check if they exist
  4. Check their dependencies
  5. Check if they exist
  6. Repeat 3, 4 and 5 until everything satisfies
  7. Install the package

Seems reasonable enough, untill you realise how hard it actually is. Because you can't just do step 6 infinitely, the dependencies have to stop, right?

Well, there is this thing called "Circular Dependencies" where a program has a dependency of another, and that other has a dependency of the first. Or, you know, some loop of unkown size.

That was just the beggining of an endless program.