How to use libapt (or libept) in debian-like system to list packages and get their infos?

前端 未结 3 1780
春和景丽
春和景丽 2021-01-02 01:01

Somebody used libapt or libept to list packages and get informations about package in a debian-like system?

Libapt is not well-documented at all, and i\'ve found few

3条回答
  •  感情败类
    2021-01-02 01:20

    Take a look at how apt-cache(8) is implemented. Obtaining the source with apt is easy:

    # apt-get source apt
    

    In the source file cmdline/apt-cache.cc theres is a function called DumpPackage() which extracts information from a named file in the cache.

提交回复
热议问题