Don't let Pkg downgrade packages automatically

Not only downgrading; upgrading packages may also be very breaking. But since the dependency trees of packages often involve dozens of other packages, any update or new package will most likely change the versions of others. So, in my opinion warnings or confirmation prompts would not be very informative or useful, because you would see them every time you update or add a package.

I’d rather say that you have to assume that ]add, ]rm and ]up can always break your code. So it’s good practice to get accustomed to create a different environment for each new project. (And that also makes your code more stable and reproducible, as indicated in the documentation that I linked in the previous post.)

For trying packages, I have a “sandbox” evironment that does not interfere with “serious work”, and I wipe it out (just deleting the Project.toml and Manifest.toml) as soon as I have finished my testing.

You might also be interested in ]undo, as mentioned here:

4 Likes