Find the answer to your Linux question:
Results 1 to 4 of 4
Hi! I want to write a Bash script to check (on startup) and install some packages automatically if they are not installed. Someone helps me please!!!...
  1. #1
    Just Joined!
    Join Date
    Aug 2007
    Posts
    3

    Bash script for installing packages automatically??

    Hi!
    I want to write a Bash script to check (on startup) and install some packages automatically if they are not installed.
    Someone helps me please!!!

  2. #2
    scm
    scm is offline
    Linux Engineer
    Join Date
    Feb 2005
    Posts
    1,044
    Well, you could use the exit status from "rpm -q packagename >/dev/null 2>&1" to check the presence of packages (it returns 0 (true) if the package you're querying is present and 1 it it's not), and then call yum to get and install them (assuming you're having more success with yum than I am). Put a call to your script in rc.local and you're done!

  3. #3
    Just Joined!
    Join Date
    Aug 2007
    Posts
    3
    Thanks for replying my post, scm!
    But I'm using Debian and Ubuntu. Can you tell me how to do that?

  4. #4
    Linux User Agent-X's Avatar
    Join Date
    May 2005
    Location
    Dimension X
    Posts
    261
    sudo dpkg -i file.deb

Posting Permissions

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