[controllers/packages] migrate to retrieveNeededLibraries