Load plugins before purging packages, fixes #3557