diff --git a/Tools/scripts/install-prereqs-ubuntu.sh b/Tools/scripts/install-prereqs-ubuntu.sh index 3052e7696a..92939be24c 100755 --- a/Tools/scripts/install-prereqs-ubuntu.sh +++ b/Tools/scripts/install-prereqs-ubuntu.sh @@ -2,21 +2,28 @@ set -e OPT="/opt" -BASE_PKGS="gawk make git arduino-core curl" -PYTHON_PKGS="pymavlink MAVProxy droneapi catkin_pkg lxml future" -PX4_PKGS="python-serial python-argparse openocd flex bison libncurses5-dev \ - autoconf texinfo build-essential libftdi-dev libtool zlib1g-dev \ +BASE_PKGS="build-essential ccache g++ gawk git make wget" +PYTHON_PKGS="future lxml pymavlink MAVProxy" +PX4_PKGS="python-argparse openocd flex bison libncurses5-dev \ + autoconf texinfo libftdi-dev zlib1g-dev \ zip genromfs python-empy libc6-i386" BEBOP_PKGS="g++-arm-linux-gnueabihf" -SITL_PKGS="g++ python-pip python-setuptools python-matplotlib python-serial python-scipy python-opencv python-numpy python-pyparsing ccache realpath" +SITL_PKGS="libtool python-pip python-setuptools python-matplotlib python-serial python-scipy python-opencv python-numpy python-pyparsing realpath" ASSUME_YES=false -read -r UBUNTU_CODENAME <<<$(lsb_release -c -s) +UBUNTU_YEAR="15" # Ubuntu Year were changes append +UBUNTU_MONTH="10" # Ubuntu Month were changes append -if [ "$UBUNTU_CODENAME" = "xenial" ]; then - SITL_PKGS+=" python-wxgtk3.0" -else - SITL_PKGS+=" python-wxgtk2.8" +version=$(lsb_release -r -s) +yrelease=$(echo "$version" | cut -d. -f1) +mrelease=$(echo "$version" | cut -d. -f2) + +if [ "$yrelease" -ge "$UBUNTU_YEAR" ]; then + if [ "$yrelease" -gt "$UBUNTU_YEAR" ] || [ "$mrelease" -ge "$UBUNTU_MONTH" ]; then + SITL_PKGS+=" python-wxgtk3.0 libtool-bin" + else + SITL_PKGS+=" python-wxgtk2.8" + fi fi # GNU Tools for ARM Embedded Processors @@ -64,7 +71,7 @@ sudo usermod -a -G dialout $USER $APT_GET remove modemmanager $APT_GET update $APT_GET install $BASE_PKGS $SITL_PKGS $PX4_PKGS $BEBOP_PKGS -sudo pip2 -q install $PYTHON_PKGS +sudo pip2 -q install -U $PYTHON_PKGS if [ ! -d $OPT/$ARM_ROOT ]; then (