def METHOD_NAME(
    self, *, package_repo: package_repository.PackageRepository
) -> bool:
    """Install required key for specified package repository.
    For both PPA and other Apt package repositories:
    1) If key is already installed, return False.
    2) Install key from local asset, if available.
    3) Install key from key server, if available. An unspecified
       keyserver will default to using keyserver.ubuntu.com.
    :param package_repo: Apt PackageRepository configuration.
    :returns: True if key configuration was changed. False if
        key already installed.
    :raises: AptGPGKeyInstallError if unable to install key.
    """
    key_server: Optional[str] = None
    if isinstance(package_repo, package_repository.PackageRepositoryAptPpa):
        key_id = apt_ppa.get_launchpad_ppa_key_id(ppa=package_repo.ppa)
    elif isinstance(package_repo, package_repository.PackageRepositoryApt):
        key_id = package_repo.key_id
        key_server = package_repo.key_server
    else:
        raise RuntimeError(f"unhandled package repo type: {package_repo!r}")
    # Already installed, nothing to do.
    if self.is_key_installed(key_id=key_id):
        return False
    key_path = self.find_asset_with_key_id(key_id=key_id)
    if key_path is not None:
        self.install_key(key=key_path.read_text())
    else:
        if key_server is None:
            key_server = "keyserver.ubuntu.com"
        self.install_key_from_keyserver(key_id=key_id, key_server=key_server)
    return True