It might make sense to try and "deactivate" a package before installing the new package. Looking into some second-try fallback for package-install to refresh the package index if a package was not found would also be a good idea ^^