### Method

# AppStream Component get_pkgname

#### Declaration [src]

    gchar*
    as_component_get_pkgname (
      AsComponent* cpt
    )

#### Description [src]

Get the first package name of the list of packages that need to be installed for this component to be present on the system. Since most components consist of only one package, this is safe to use for about 90% of all cases.

However, to support a component fully, please use %as_component_get_pkgnames() for getting all packages that need to be installed, and use this method only to e.g. get the main package to perform a quick “is it installed?” check.

#### Return value

Type: `gchar*`

String array of package names.

The returned data is owned by the instance.
The value is a NUL terminated UTF-8 string.