How to save the list of installed packages?