[SATLUG] Running a script in CLI

Samuel Leon leon36 at gmail.com
Thu Jan 10 22:41:50 CST 2008

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

apt-get install packageA packageB packageC

will do the same.


More information about the SATLUG mailing list