Ubuntu System Write shell script program installs multiple packages at once

Source: Internet
Author: User

Ubuntu System Write shell script program installs multiple packages at once


Writing shell scripts installs multiple software at once, primarily for some software-dependent environment configurations.

1. The shell script must start with the following line (must be in the first line of the file):

#!/bin/sh

The symbol #! is used to tell the system that the parameter behind it is the program used to execute the file. In this example we use/BIN/SH to execute the program.

2. After editing the script, you must also make it executable.

To make the script executable:

chmod +x filename

3. You can then execute your script by entering:./filename.


As follows:

Here are the multiple packages that NS3 relies on before I install NS3:

1. Edit the following file in VI

#!/bin/sh
sudo apt-get install gcc g++ python-y
sudo apt-get install gcc g++ python python-dev-y
sudo apt-get install mercurial-y
sudo apt-get install bzr-y
sudo apt-get install gdb valgrind-y
sudo apt-get install gsl-bin libgsl0-dev libgsl0ldbl-y
sudo apt-get install Flex Bison libfl-dev-y
sudo apt-get install g++-3.4 gcc-3.4-y
sudo apt-get install tcpdump-y
sudo apt-get install aqlite aqlite3 libsqlite3-dev-y
sudo apt-get install libxml2 libxml2-dev-y
sudo apt-get install libgtk2.0-0 libgtk2.0-dev-y
sudo apt-get install Vtun lxc-y
sudo apt-get install uncrustify-y
sudo apt-get install Doxygen grphviz imagemagick-y
sudo apt-get install texlive texlive-extra-untils texlive-latex-extra-y
sudo apt-get install Python-sphinx dia-y
sudo apt-get install Python-pygraphviz python-kiwi python-pygoocanvas libgoocanvas-dev-y
sudo apt-get install Libboost-signals-dev libboost-filesystem-dev-y
sudo apt-get install openmpi*-y

: Wq mysetup # (note) saved as a file with Mysetup name


2. Compile in Terminal: chmod +x Mysetup

3, run the installation, the terminal input:./mysetup

Ubuntu System Write shell script program installs multiple packages at once

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.