【问题标题】:How to write an install script for ubuntu如何为 ubuntu 编写安装脚本
【发布时间】:2011-01-26 17:35:52
【问题描述】:

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

sudo apt-get install ...

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

【问题讨论】:

    标签: linux installation


    【解决方案1】:
    【解决方案2】:
        #!/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
    

    【讨论】:

      猜你喜欢
      • 2020-04-15
      • 2015-04-23
      • 2011-11-30
      • 2011-01-21
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-08-10
      • 1970-01-01
      相关资源
      最近更新 更多