Add an option to skip confirmation prompt.
Extract the interactive prompt into a separate function.
Extract the code ensuring all packages in a list are installed.
Extract the code ensuring no other installed package requires packages being deleted.