def METHOD_NAME(self, pkg: PackageEntry):
    """ Modify repository in the database.
    Args:
        pkg: Repository object.
    Raises:
        PackageManagerError: Raises when repository with the given name does not exist
                             in the database.
    """
    name = pkg.name
    if not self.has_package(name):
        raise PackageNotFoundError(name)
    self._database[name] = pkg