Tuesday, May 7, 2024
2
rated 0 times [  2] [ 0]  / answers: 1 / hits: 938  / 3 Years ago, mon, october 11, 2021, 11:26:01

I'm comparing Ubuntu to other distributions for a number of factors, and for one factor I need the number of source packages, which is probably a better indicator than the total number of packages a distribution has.



It looks like I could use apt-cache dumpavail and from each section get the package name or the source name, if there is one, then get a unique count from that. But, is there an easier, faster way?


More From » package-management

 Answers
4

You can grep the number of Package: lines in the files whose names end in _Sources in the directory /var/lib/apt/lists/:



grep '^Package: ' /var/lib/apt/lists/*_Sources | wc -l


On my Ubuntu 11.10 machine I get the number 17150.


[#40450] Wednesday, October 13, 2021, 3 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
inciplyies

Total Points: 10
Total Questions: 114
Total Answers: 93

Location: French Polynesia
Member since Sun, Dec 20, 2020
3 Years ago
;