Example #1
0
 /**
  * Install a software package from the Ubuntu Package archive.
  *
  * @param string $package Name of package to install  as used by `apt-get install`.
  * @return void
  */
 public function add($package)
 {
     $this->logStart("Please wait... installing apt package {$package}");
     if (CakeboxUtility::packageInstalled($package)) {
         $this->exitBashWarning("* Skipping: package already installed");
     }
     if (!$this->Execute->installPackage($package)) {
         $this->exitBashError('Error installing package.');
     }
     $this->exitBashSuccess("Package installed successfully.");
 }
Example #2
0
 /**
  * Install a software package from the Ubuntu Package archive.
  *
  * @param string $package Name of package to install  as used by `apt-get install`.
  * @return boolean True if installed successfully
  */
 public function installPackage($package)
 {
     $this->_log("Installing Ubuntu package {$package}");
     if (CakeboxUtility::packageInstalled($package)) {
         $this->_warn("* Package already installed");
         return false;
     }
     // not installed, shell installation
     if (!$this->shell("DEBIAN_FRONTEND=noninteractive apt-get install -y {$package}", 'root')) {
         $this->_error("* Error installing package");
         return false;
     }
     $this->_log("* Package installed successfully");
     return true;
 }