methods/in_common.rb
# Check Ubuntu / Debian package is installed
Check Ubuntu / Debian package is installed
Check Ubuntu / Debian package is installed
def check_apt_package(options,package)
  message = "Information:\tChecking "+package+" is installed"
  command = "dpkg -l | grep '#{package}' |grep 'ii'"
  output  = execute_command(options,message,command)
  if not output.match(/#{package}/)
    message = "Information:\tInstalling "+package
    command = "apt-get -y -o Dpkg::Options::=--force-confdef -o Dpkg::Options::=--force-confnew install #{package}"
    execute_command(options,message,command)
  end
  return
end
def check_apt_package ( options , package ) message = "Information:\tChecking " + package + " is installed" command = "dpkg -l | grep '#{package}' |grep 'ii'" output = execute_command ( options , message , command ) if not output . match ( / #{ package } / ) message = "Information:\tInstalling " + package command = "apt-get -y -o Dpkg::Options::=--force-confdef -o Dpkg::Options::=--force-confnew install #{package}" execute_command ( options , message , command ) end return end
Check Ubuntu / Debian package is installed
Check Ubuntu / Debian package is installed
options
<not_specific>
package
<not_specific>