繁体   English   中英

如何为ubuntu编写安装脚本

[英]How to write an install script for ubuntu

我刚刚在linux(ubuntu)中开发了一个opengl游戏。现在,我想为该脚本编写一个安装脚本,使用该命令将游戏直接安装到apt中。

sudo apt-get install ...

这样它就可以在整个linux的任何地方运行,而无需进入游戏的指定文件夹。 有人知道该怎么做吗?

    #!/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

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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