为方便读者,本教材中连续四行及以上程序源码(脚本),本网站将直接提供,直接输入使用。
sudo apt-get -y update
sudo apt-get -y install ncurses-dev bison flex build-essential
sudo apt-get -y install libx11-dev libxmu-dev libxmu-headers libxt-dev libtool g++ patch tcl tk tcl-dev tk-dev gnuplot
#降低gcc和g++版本,NS-2无法兼容高版本
sudo apt -y install gcc-5 g++-5
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-5 30
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-9 40
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-5 30
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-9 40
sudo update-alternatives --config gcc
sudo update-alternatives --config g++
deb http://archive.ubuntu.com/ubuntu/ trusty main universe restricted multiverse
deb https://mirrors.aliyun.com/ubuntu/ xenial main
deb-src https://mirrors.aliyun.com/ubuntu/ xenial main
deb https://mirrors.aliyun.com/ubuntu/ xenial universe
deb-src https://mirrors.aliyun.com/ubuntu/ xenial universe
deb http://cz.archive.ubuntu.com/ubuntu bionic main universe
deb http://mirrors.aliyun.com/ubuntu bionic main universe