简体   繁体   中英

How to write an install script for ubuntu

I just developed an opengl game in linux (ubuntu).. Now I would like to write a setup script for the same which installs the game directly into the apt using the command..

sudo apt-get install ...

so that it runs from anywhere throughout linux without going into the specified folder for the game. Anyone knows how to do that ?

    #!/bin/bash

    set -eu -o pipefail # fail on error , debug all lines

    sudo -n true
    test $? -eq 0 || exit 1 "you should have sudo priveledge to run this script"

    echo installing the must-have pre-requisites
    while read -r p ; do sudo apt-get install -y $p ; done < <(cat << "EOF"
        perl
        zip unzip
        exuberant-ctags
        mutt
        libxml-atom-perl
        postgresql-9.6
        libdbd-pgsql
        curl
        wget
        libwww-curl-perl
    EOF
    )

    echo installing the nice-to-have pre-requisites
    echo you have 5 seconds to proceed ...
    echo or
    echo hit Ctrl+C to quit
    echo -e "\n"
    sleep 6

    sudo apt-get install -y tig

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM