def Install(self, package_name):
    """Installs a PerfKit package on the VM."""
    package = linux_packages.PACKAGES[package_name]
    try:
      # Make sure another unit doesn't try
      # to install the charm at the same time
      with self.controller.installation_lock:
        if package_name not in self.controller._installed_packages:
          package.JujuInstall(self.controller, self.vm_group)
          self.controller._installed_packages.add(package_name)
    except __HOLE__ as e:
      logging.warn('Failed to install package %s, falling back to Apt (%s)'
                   % (package_name, e))
      if package_name not in self._installed_packages:
        package.AptInstall(self)
        self._installed_packages.add(package_name)
dataset/ETHPy150Open GoogleCloudPlatform/PerfKitBenchmarker/perfkitbenchmarker/linux_virtual_machine.py/JujuMixin.Install