Results 1 to 6 of 6

Thread: How will I do this? Creating a script to automate installation

  1. #1
    Join Date
    Oct 2009
    Beans
    5

    Question How will I do this? Creating a script to automate installation

    Hey everyone this is my first thread here. And hope I am in the correct section for this.

    And also I'm very new to linux and ubuntu and I will be very glad if someone can help me with this one.

    Anyway this is my problem.

    I am creating a script to install this 2.

    sudo apt-get install libgtk2.0-dev
    sudo apt-get install libcurl4-gnutls-dev

    and my script looks like this
    #!/bin/bash
    sudo apt-get install libgtk2.0-dev
    sudo apt-get install libcurl4-gnutls-dev
    but the problem is that every time these 2
    sudo apt-get install libgtk2.0-dev
    sudo apt-get install libcurl4-gnutls-dev

    gets executed I get this message in the terminal

    The following packages will be upgraded:
    libfreetype6 libglib2.0-0 libxcb-render0 libxcb1 libxi6
    5 upgraded, 59 newly installed, 0 to remove and 245 not upgraded.
    Need to get 20.8MB of archives.
    After this operation, 68.6MB of additional disk space will be used.
    Do you want to continue [Y/n]?
    So, I am wondering if there is a way that I can include my "Y" answer on my script so that I won't be inputing "Y" every time I run the script.

    Guys I really appreciate any of your time...

    Thanks a lot in advance....

  2. #2
    Join Date
    May 2008
    Location
    London
    Beans
    330
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: How will I do this? Creating a script to automate installation

    Quote Originally Posted by realskinner View Post
    Anyway this is my problem.

    sudo apt-get install libgtk2.0-dev
    sudo apt-get install libcurl4-gnutls-dev

    and my script looks like this
    but the problem is that every time these 2
    sudo apt-get install libgtk2.0-dev
    sudo apt-get install libcurl4-gnutls-dev

    So, I am wondering if there is a way that I can include my "Y" answer on my script so that I won't be inputing "Y" every time I run the script.
    Hi, You can use the -y flag to answer yes to the question. For example:

    Code:
    sudo apt-get install -y libgtk2.0-dev

  3. #3
    Join Date
    Dec 2008
    Beans
    52

    Re: How will I do this? Creating a script to automate installation

    Another suggestion: You can do the following:
    Code:
    sudo apt-get -y install libgtk2.0-dev libcurl4-gnutls-dev

  4. #4
    Join Date
    Oct 2009
    Beans
    5

    Question Re: How will I do this? Creating a script to automate installation

    Wow that was FAST... awesome bro... It works...

    Thank you very much...

    By the way I would just like to add...

    Is there also a way that I can launch a message box from the script?
    Last edited by realskinner; October 15th, 2009 at 04:13 PM.

  5. #5
    Join Date
    May 2008
    Location
    London
    Beans
    330
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: How will I do this? Creating a script to automate installation

    Quote Originally Posted by realskinner View Post
    Is there also a way that I can launch a message box from the script?
    Erm, you might find 'zenity' useful for message boxes.

    http://linux.byexamples.com/archives...og-examples-1/

  6. #6
    Join Date
    Oct 2009
    Beans
    5

    Wink Re: How will I do this? Creating a script to automate installation

    Thank you very much guys....

    petersohn and rampageoberon I really appreciate the BIG help...

    Thanks

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •