一、使用的原因
部分软件安装前,需要大量的配置,逐条安装太过耗时,所以,可以使用脚本安装。
二、举例(配置NS3环境)
1. 创建脚本
ns3_install.sh
2. 添加脚本信息
apt-get install g++ python3
apt-get install g++ python3 python3-dev pkg-config sqlite3
apt-get install python3-setuptools git
apt-get install qt5-default mercurial
apt-get install python-pygraphviz python-kiwi python-pygoocanvas libgoocanvas-dev ipython
apt-get install gir1.2-goocanvas-2.0 python-gi python-gi-cairo python-pygraphviz python3-gi python3-gi-cairo python3-pygraphviz gir1.2-gtk-3.0 ipython ipython3
apt-get install openmpi-bin openmpi-common openmpi-doc libopenmpi-dev
apt-get install autoconf cvs bzr unrar
apt-get install gdb valgrind
apt-get install uncrustify
apt-get install doxygen graphviz imagemagick
apt-get install texlive texlive-extra-utils texlive-latex-extra texlive-font-utils dvipng latexmk
apt-get install python3-sphinx dia
apt-get install gsl-bin libgsl-dev libgsl23 libgslcblas0
apt-get install tcpdump
apt-get install sqlite sqlite3 libsqlite3-dev
apt-get install libxml2 libxml2-dev
apt-get install cmake libc6-dev libc6-dev-i386 libclang-6.0-dev llvm-6.0-dev automake pip
python3 -m pip install --user cxxfilt
apt-get install libgtk-3-dev
apt-get install vtun lxc uml-utilities
apt-get install libboost-signals-dev libboost-filesystem-dev
3. 授予执行权限
chmod a+x ns3_install.sh
4. 执行脚本
sudo ./ns3_install.sh