【问题标题】:Automated custom software installation using bash script in Linux [closed]在 Linux 中使用 bash 脚本自动安装自定义软件 [关闭]
【发布时间】:2017-07-29 01:09:56
【问题描述】:

我在笔记本电脑中使用 Ubuntu 14.04 LTS。我有自己定制的 Ubuntu,其中大部分软件包都已安装。 我们在安装 Jupiter 之前制作了这个定制的 Ubuntu。它在那里错过了 Jupiter 包。使用 Ubuntu 14.04, 我的笔记本电脑总是过热。为此,每次我新安装 Jupiter 电源管理工具。 我必须在sources.list中添加ppa然后安装。我想自动化这个过程。请在这里帮帮我。

【问题讨论】:

  • 你用的是哪个版本的ubuntu 14.04?
  • 3rd,我已经安装了这么多包。所以,我不想安装新系统的全新安装并安装所有软件。
  • 您可以尝试最新的 Ubuntu LTE 版本 14.04 5th 或 16.04。我相信他们在那里增强了很多功能。
  • StackOverflow 旨在帮助人们修复他们的编程代码。对教程、研究、工具、建议、库和代码的请求是题外话。 阅读stackoverflow.com/help/how-to-askstackoverflow.com/help/dont-askstackoverflow.com/help/mcve,并在此处发布更多问题之前使用tour。祝你好运。

标签: linux bash ubuntu


【解决方案1】:

您可以运行此 bash 脚本文件。您必须以 root 用户身份运行此脚本。

/* 你必须把 xenial 改成 trusty。或者你可以去打开文件夹/etc/apt/sources.d.list/。打开文件 jolicloud-team-ubuntu.. 一些东西(注意:它基于您的操作系统版本,并提供变量 CHECK 的值,就像我给我的 xenial (16.04) 系统一样 */

/* OUTCHECK 变量代表路径/etc/apt/sources.list.d/jolicloud-team-ubuntu-ppa-xenial.list,其中有源引用。而“deb http://ppa.launchpad.net/jolicloud-team/ppa/ubuntuxenial main”是jolicloud-team-ubuntu-ppa-xenial.list文件里面的内容*/

我无法安装 jupiter,因为它已停产。在这个链接https://askubuntu.com/questions/285434/is-there-a-power-saving-application-similar-to-jupiter,他们说,有更好的替代TLP。

可能它仍然适用于您的 14.04。

现在,您的完整脚本看起来像这样。

 # -y for auto ENTER press by own
export CHECK="deb http://ppa.launchpad.net/jolicloud-team/ppa/ubuntu xenial main" 
export OUTCHECK="$(grep "$CHECK" "/etc/apt/sources.list.d/jolicloud-team-ubuntu-ppa-xenial.list")" 
if [ "$OUTCHECK" ]
then
    echo "repository source is already added"
else
        #if /etc/apt/sources.list doen not contains repository of jupiter then add this
        add-apt-repository ppa:jolicloud-team/ppa -y
        export OUT=$?
        while [ $OUT != 0 ]
            do 
                apt-get update
        done
fi

if ! dpkg -l | grep -qw "jupiter*" # -l for listing, -qw for  matching whole words in quite/silent mode 
    then
        #install using this line of code
#I can't install jupiter because it is discontinued for my OS.
#Probably it still works for your 14.04.
        apt-get install jupiter
else 
    echo "Jupiter is already installed in your system"
fi

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-01-15
    相关资源
    最近更新 更多