wrapped apt-get in an if statement