diff --git a/23.Initialize_APT/0_setup.sh b/23.Initialize_APT/0_setup.sh
index 4483225303ef6e3023db10265d7252a39d162b65..22590e1fb3271ec0ea65c51fa45287b7c5e31d8d 100755
--- a/23.Initialize_APT/0_setup.sh
+++ b/23.Initialize_APT/0_setup.sh
@@ -22,8 +22,7 @@ apt-get install -y aptitude apt-transport-https
 apt-get dist-upgrade -y
 
 # modify sources.list to use ubicast cache
-grep ${APT_CACHE_HOST} /etc/apt/sources.list
-if [ $? = 1 ]; then
+if ( ! grep ${APT_CACHE_HOST} /etc/apt/sources.list ); then
 	sed -i "s@http://@http://${APT_CACHE_HOST}/@" /etc/apt/sources.list
 fi
 
@@ -46,4 +45,4 @@ APT::Periodic::Unattended-Upgrade "1";
 EOF
 
 # resolvconf
-aptitude purge -y resolvconf
+apt-get purge -y resolvconf