Bail out on upgrade in a more shell-friendly way

Manipulating env var might be problematic