Refactors apt functionality to clean after snapshot.