first build openairinterface5g, here do not use build_oai script to build complete thing. because it is often have error during running and if you run again it will takes long time again. so we will run step by step.

1. install uhd

if you are from China, I suggest you change apt-get source to other. I use 清华大学 source which work fine for me, open /etc/apt/sources.list and replace all the content as below:

# deb cdrom:[Ubuntu 16.04 LTS _Xenial Xerus_ - Release amd64 (20160420.1)]/ xenial main restricted
deb xenial main restricted
deb xenial-updates main restricted
deb xenial universe
deb xenial-updates universe
deb xenial multiverse
deb xenial-updates multiverse
deb xenial-backports main restricted universe multiverse
deb xenial-security main restricted
deb xenial-security universe
deb xenial-security multiverse

run the commands below one by one:

sudo apt-get remove -y uhd
sudo apt-get remove libuhd-dev libuhd003 uhd-host -y
sudo apt-add-repository --remove "deb trusty main"
sudo add-apt-repository ppa:ettusresearch/uhd -y
sudo apt-get update
sudo apt-get -y --allow-unauthenticated install python python-tk libboost-all-dev libusb-1.0-0-dev
sudo apt-get -y --allow-unauthenticated install libuhd-dev libuhd003 uhd-host

download usrp firmware:

sudo uhd_images_downloader -t b2xx

2. install low latency kernel

sudo apt-get install linux-lowlatency 
sudo apt-get install linux-image-`uname -r | cut -d- -f1-2`-lowlatency 
sudo apt-get install linux-headers-`uname -r | cut -d- -f1-2`-lowlatency

3. install other required package for openairinterface5g

sudo rm -rf /tmp/asn1c
git clone /tmp/asn1c
cd /tmp/asn1c
git checkout f12568d617dbf48497588f8e227d70388fa217c9
autoreconf -iv
make -j`nproc`
sudo make install
sudo ldconfig