Skip to content

Instantly share code, notes, and snippets.

@syneart
Last active June 25, 2024 22:41
Show Gist options
  • Save syneart/5ee4c0dac2e6a0762f6e0cabdf5b0bff to your computer and use it in GitHub Desktop.
Save syneart/5ee4c0dac2e6a0762f6e0cabdf5b0bff to your computer and use it in GitHub Desktop.
Get latest USRP Hardware Driver from apt with install or upgrade
#!/bin/bash
# This shell script is made by SyneArt <sa@syneart.com>
#######################################
# INSTALL UHD ON UBUNTU OR DEBIAN #
#######################################
# | THIS SCRIPT IS TESTED CORRECTLY ON |
# |--------------------------------------------------------|
# | OS | UHD | Test | Last test |
# |----------------|------------------|------|-------------|
# | Ubuntu 22.04.2 | 4.1.0.5-release | OK | 24 May 2023 |
# | Ubuntu 18.04.1 | 4.1.0.4-release | OK | 07 Jan 2021 |
# | Ubuntu 20.04.1 | 3.15.0.0-release | OK | 10 Nov 2020 |
# | Ubuntu 18.04.1 | 3.15.0.0-release | OK | 10 Nov 2020 |
SUDO=$(command -v "sudo" & echo "sudo" | echo "" )
echo -e "\033[34mRemove old UHD!\033[0m"
$SUDO dpkg -l | grep 'uhd-host\|libuhd' | sort -r | awk '{print $2}' | $SUDO xargs dpkg -P
$SUDO apt purge libuhd-dev -y
$SUDO apt purge libuhd003 -y
$SUDO apt purge uhd-host -y
$SUDO apt autoremove -y
echo -e "\033[34mInstall latest UHD from apt!\033[0m"
$SUDO apt update
export DEBIAN_FRONTEND=noninteractive
ln -fs /usr/share/zoneinfo/$(wget -O - http://ip-api.com/line?fields=timezone) /etc/localtime
$SUDO apt-get install -y tzdata
$SUDO apt install libboost-all-dev libusb-1.0-0-dev doxygen \
python3-docutils python3-mako python3-numpy python3-requests \
python3-ruamel.yaml python3-setuptools cmake build-essential -y
$SUDO add-apt-repository ppa:ettusresearch/uhd -y
$SUDO apt update
$SUDO apt install libuhd003 -y
$SUDO apt install libuhd-dev uhd-host -y
$SUDO ldconfig
echo -e "\033[34mDownload UHD images!\033[0m"
$SUDO uhd_images_downloader
echo -e "\033[34mSetting UHD default image path ..\033[0m"
UHD_PKG_PATH=`uhd_config_info --pkg-path | cut -d : -f 2 | tr -d '[:space:]'`
UHD_DEFAULT_IMAGE_PATH=${UHD_PKG_PATH}/share/uhd/images
$SUDO mkdir -p ${UHD_DEFAULT_IMAGE_PATH/images/} # ${UHD_PKG_PATH}/share/uhd/
$SUDO ln -s /usr/share/uhd/images ${UHD_DEFAULT_IMAGE_PATH}
echo -e "\033[34mUHD is install or upgrade finish !\033[0m"
@syneart
Copy link
Author

syneart commented Nov 9, 2020

Use below command to install the latest UHD from apt with Ubuntu on your own operating system.
wget -O - https://gist.githubusercontent.com/syneart/5ee4c0dac2e6a0762f6e0cabdf5b0bff/raw/uhd_installer.sh | bash

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment