Order packages according to dependencies
Take the whole dependency graph and compute topological order of packages. Consider breaking cycles somehow (and possibly marking the defective packages, but we don't want to fail right now, since these packages may not need to be installed).