[SATLUG] Running a script in CLI

herb cee hc at lookcee.com
Thu Jan 10 23:33:57 CST 2008


Samuel Leon wrote:
> herb cee wrote:
>> I can't seem to find a comment on this question:
>> If I want to run a script in the CLI that contains lines such as this:
>> sudo apt-get install vlc
>> and I already have VLC installed should I comment that line out or 
>> does it not hurt anything to just run the script as is?
>> Thanks
>> herb
>
>
> No, running a command to install a package that is already installed 
> will result in nothing, no error and no extra prompt. I would 
> recommend using aptitude instead of apt-get though. It handles 
> dependency install and removal better.
>
> For example, if you install packageA and packageA depends on packageB 
> and packageC both apt-get and aptitude will install the extra 
> dependency packages but "apt-get remove packageA" will result in only 
> packageA being removed and dependency packageB & C being left behind. 
> "aptitude remove packageA" will result in all the packages that were 
> installed with it being removed as well as long as they don't have any 
> packages depending on them also.
>
> Also if this is just a script to install packages, you don't have to 
> have it formated as:
> apt-get install packageA
> apt-get install packageB
> apt-get install packageC
>
> but
> apt-get install packageA packageB packageC
>
> will do the same.
>
> Sam
Ok thanks Sam here is why I asked the question:
http://www.linuxlove.org/2007/12/31/things-to-do-right-after-installing-ubuntu-gusty-gibbon/

This is what you get:

# Medibuntu repository (Multimedia, Entertainment & Distractions In 
Ubuntu) is a repository of packages that cannot be included into the 
Ubuntu distribution for legal reasons (copyright, license, patent, etc).
# win32 codecs (divx, xvid etc) and DVD support globally
# Firefox support for Flash, Java, MPEG, DVD, DivX support
# Google Earth
# RAR compressor/decompressor
# Compiz Config Settings Manager
# Ubuntu Tweak
# media player similar to KDE’s Amarok but for Gnome
# MPlayer and VLC video players
# SSH Server to allow you to connect remotely to your computer
# The ability to listen and rip Internet radio stations
# More codecs

Get the script:
|$ wget http://www.linuxlove.org/stuff/postinstall.sh|

Edit and add/remove things you need/don’t need (add a ‘#’ in front of 
the line installing what you don’t want):
|$ nano -w postinstall.sh|

Run the script:
|$ chmod +x postinstall.sh
$ ./postinstall
|

|So I DLed the script from the url above and in looking at it i realized 
I was sure about some things but not all to '#' out. I'm new and do not 
always understand when looking at commands how the hell Linux knows what 
to do from the command, so makes me nervous.
Thanks for the info.
|




More information about the SATLUG mailing list