def METHOD_NAME(msgCallback = None, progressCallback = None,
                            getArch=None, getInfo = None):
    """ Return list of packages. Package is hash with keys name, epoch,
        version, release and optionaly arch and cookie
    """
    pkg_list = []
    if msgCallback != None:
        msgCallback(_("Getting list of packages installed on the system"))
    _ts = transaction.initReadOnlyTransaction()
    count = 0
    total = 0
    dbmatch = _ts.dbMatch()
    for h in dbmatch:
        if h == None:
            break
        count = count + 1
    total = count
    count = 0
    dbmatch = _ts.dbMatch()
    for h in dbmatch:
        if h == None:
            break
        if not (is_utf8(sstr(h['name'])) and is_utf8(sstr(h['version']))
                and is_utf8(sstr(h['release']))):
            log = up2dateLog.initLog()
            log.log_me("Package with invalid character set found. Skipping: '%s-%s-%s'" %
                    (h['name'].decode('UTF-8', errors='replace'),
                     h['version'].decode('UTF-8', errors='replace'),
                     h['release'].decode('UTF-8', errors='replace')))
            continue
        package = {
            'name': sstr(h['name']),
            'epoch': h['epoch'],
            'version': sstr(h['version']),
            'release': sstr(h['release']),
            'installtime': h['installtime']
        }
        if package['epoch'] == None:
            package['epoch'] = ""
        else: # convert it to string
            package['epoch'] = "%s" % package['epoch']
        if getArch:
            package['arch'] = h['arch']
            # the arch on gpg-pubkeys is "None"...
            if package['arch']:
                package['arch'] = sstr(package['arch'])
                pkg_list.append(package)
        elif getInfo:
            if h['arch']:
                package['arch'] = sstr(h['arch'])
            if h['cookie']:
                package['cookie'] = sstr(h['cookie'])
            pkg_list.append(package)
        else:
            pkg_list.append(package)
        if progressCallback != None:
            progressCallback(count, total)
        count = count + 1
    dbmatch = None
    _ts.ts.closeDB()
    pkg_list.sort(key=lambda x:(x['name'], x['epoch'], x['version'], x['release']))
    return pkg_list