Re-ordered commands to avoid executing pacman in incomplete environment.