installPackage :: (MonadCric m, Package p) => p -> m (Either PkgManagerError BS.ByteString)
installPackage pkg = do
  logMsg Info $ "Installing " ++ show pkg ++ " ..."
  pkgMgr <- getPackageManager
  os     <- getOS
  result <- case pkgMgr of
    Yum    -> installWithYum    os pkg
    APT    -> installWithAPT    os pkg
    RPM    -> installWithRPM    os pkg
    PkgAdd -> installWithPkgAdd os pkg
    UnknownPackageManager -> return $ Left NoPackageManagerFound
  case result of
    Left err -> logMsg Error $ "Error installing " ++ show pkg ++ " (" ++ show err ++ ")"
    Right _  -> logMsg Info  $ "Package " ++ show pkg ++ " installed successfully."
  return result
installPackage :: (MonadCric m, Package p) => p -> m (Either PkgManagerError BS.ByteString)
installPackage pkg = do
  logMsg Info $ "Installing " ++ show pkg ++ " ..."
  pkgMgr <- getPackageManager
  os     <- getOS
  result <- case pkgMgr of
    Yum    -> installWithYum    os pkg
    APT    -> installWithAPT    os pkg
    RPM    -> installWithRPM    os pkg
    PkgAdd -> installWithPkgAdd os pkg
    UnknownPackageManager -> return $ Left NoPackageManagerFound
  case result of
    Left err -> logMsg Error $ "Error installing " ++ show pkg ++ " (" ++ show err ++ ")"
    Right _  -> logMsg Info  $ "Package " ++ show pkg ++ " installed successfully."
  return result
installPackage pkg = do
  logMsg Info $ "Installing " ++ show pkg ++ " ..."
  pkgMgr <- getPackageManager
  os     <- getOS
  result <- case pkgMgr of
    Yum    -> installWithYum    os pkg
    APT    -> installWithAPT    os pkg
    RPM    -> installWithRPM    os pkg
    PkgAdd -> installWithPkgAdd os pkg
    UnknownPackageManager -> return $ Left NoPackageManagerFound
  case result of
    Left err -> logMsg Error $ "Error installing " ++ show pkg ++ " (" ++ show err ++ ")"
    Right _  -> logMsg Info  $ "Package " ++ show pkg ++ " installed successfully."
  return result