diff --git a/tools/apt-get-install-deps.sh b/tools/apt-get-install-deps.sh index 7df3ebc1b..f4f39640f 100755 --- a/tools/apt-get-install-deps.sh +++ b/tools/apt-get-install-deps.sh @@ -14,8 +14,12 @@ # See the License for the specific language governing permissions and # limitations under the License. -sudo apt-get update -q -sudo apt-get install -q -y \ +if [ "$(whoami)" != "root" ]; then + SUDO=sudo +fi + +${SUDO} apt-get update -q +${SUDO} apt-get install -q -y \ make cmake \ gcc gcc-multilib \ doxygen \ diff --git a/tools/apt-get-install-qemu-arm.sh b/tools/apt-get-install-qemu-arm.sh index 7658ccd6b..b38373bb4 100755 --- a/tools/apt-get-install-qemu-arm.sh +++ b/tools/apt-get-install-qemu-arm.sh @@ -14,7 +14,11 @@ # See the License for the specific language governing permissions and # limitations under the License. -sudo apt-get update -q -sudo apt-get install -q -y \ +if [ "$(whoami)" != "root" ]; then + SUDO=sudo +fi + +${SUDO} apt-get update -q +${SUDO} apt-get install -q -y \ gcc-arm-linux-gnueabihf libc6-dev-armhf-cross \ qemu-user-static