Ubuntu 16.04 安装 NS 3.26

0.使用管理员权限打开VMware

(这样,真机复制的内容可粘贴到虚拟机的系统中)

1.官网下载:

https://www.nsnam.org/releases/
这里选择的版本是: ns-allinone-3.26.

然后解压 ns-allinone-3.26的压缩包到自定义的目录中。

2.0 设置最合适的源服务器

打开设置:
Ubuntu 16.04 安装 NS 3.26_第1张图片
打开Software & Updates:
在Download from一栏选择:Other
Ubuntu 16.04 安装 NS 3.26_第2张图片点击:Select Best Server,然后等待自动搜索,更新即可。
Ubuntu 16.04 安装 NS 3.26_第3张图片

2.1 打开控制台:

sudo apt-get update

Ubuntu 16.04 安装 NS 3.26_第4张图片

3.安装依赖包

sudo apt-get install gcc g++ python python-dev mercurial bzr gdb valgrind gsl-bin libgsl0-dev flex bison libfl-dev tcpdump sqlite sqlite3 libsqlite3-dev libxml2 libxml2-dev libgtk2.0-0 libgtk2.0-dev vtun lxc uncrustify doxygen graphviz imagemagick texlive texlive-extra-utils texlive-latex-extra texlive-generic-extra texlive-generic-recommended texi2html python-sphinx dia python-pygraphviz python-kiwi python-pygoocanvas libgoocanvas-dev python-pygccxml libboost-signals-dev libboost-filesystem-dev openmpi-bin openmpi-doc libopenmpi-dev libgsl2

然后全程自动
Ubuntu 16.04 安装 NS 3.26_第5张图片结束:
Ubuntu 16.04 安装 NS 3.26_第6张图片
4.检查解压后的安装包是否齐全

#1.打开ns3解压包中的bake文件夹
cd /home/mengmeng/Desktop/ns-allinone-3.26/bake

#2.检查包
./bake.py check                      

Ubuntu 16.04 安装 NS 3.26_第7张图片有漏掉的包

sudo apt-get install  ###补充漏掉的包
sudo apt-get install cmake autoconf p7zip-full git cvs unrar

若出现问题:
Unable to locate package XXX
尝试sudo apt-get update,若问题依旧存在,则打开source.list在这里插入图片描述

sudo vi /etc/apt/sources.list

添加阿里云源:

deb http://mirrors.aliyun.com/ubuntu/ trusty main multiverse restricted universe
deb http://mirrors.aliyun.com/ubuntu/ trusty-backports main multiverse restricted universe
deb http://mirrors.aliyun.com/ubuntu/ trusty-proposed main multiverse restricted universe
deb http://mirrors.aliyun.com/ubuntu/ trusty-security main multiverse restricted universe
deb http://mirrors.aliyun.com/ubuntu/ trusty-updates main multiverse restricted universe
deb-src http://mirrors.aliyun.com/ubuntu/ trusty main multiverse restricted universe
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-backports main multiverse restricted universe
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-proposed main multiverse restricted universe
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-security main multiverse restricted universe
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-updates main multiverse restricted universe

然后sudo apt-get update,下载包:

sudo apt-get install cmake autoconf p7zip-full
apt-get install git cvs unrar


Ubuntu 16.04 安装 NS 3.26_第8张图片

5.安装

cd /home/mengmeng/Desktop/ns-allinone-3.26 #进入解压主目录
sudo ./build.py

6.安装Aqua-sim

cd /home/mengmeng/Desktop/ns-allinone-3.26/ns-3.26/src

git clone https://github.com/rmartin5/aqua-sim-ng.git

7.编译

cd /home/mengmeng/Desktop/ns-allinone-3.26/ns-3.26/
sudo ./waf --enable-examples --enable-tests configure
 sudo ./waf build

8.测试

sudo ./waf  --run hello-simulator

成功,则输出hello语句

你可能感兴趣的:(安装配置)