diff --git a/ubuntu-setup.bash b/ubuntu-setup.bash
index 67b602abee2b9c083a00d4c97441f601d70cdb52..24f4af871d352db21ca77794ce4a3a1c576294a8 100644
--- a/ubuntu-setup.bash
+++ b/ubuntu-setup.bash
@@ -8,7 +8,8 @@
 shopt -s extglob
 
 # Check if the user has sudo privileges.
-[[ $( id -u) ]] && echo "$(whoami) has no sudo permissions on this machine" && exit 1
+sudo -v >/dev/null 2>&1 || { echo $(whoami) has no sudo privileges ; exit 1; }
+
 
 # Install build tools 
 echo "Installing build tools.."