'List all installed packages.
:param software_components: log in a format suitable for the
SoftwareComponent schema'

def list_all(self, software_components=True):

    logging.debug('Listing    all    system    packages    (may    take    a    while)')
    if software_components:
        cmd_format = "rpm    -qa    --qf    '%s'    |    sort"
        query_format = ('%s\n' % self.SOFTWARE_COMPONENT_QRY)
        cmd_format = (cmd_format % query_format)
        cmd_result = utils.run(cmd_format, verbose=False)
    else:
        cmd_result = utils.run('rpm    -qa    |    sort', verbose=False)
    out = cmd_result.stdout.strip()
    installed_packages = out.splitlines()
    return installed_packages
