Saturday, May 4, 2024
 Popular · Latest · Hot · Upcoming
3
rated 0 times [  3] [ 0]  / answers: 1 / hits: 1724  / 2 Years ago, mon, october 17, 2022, 4:17:49

I'm trying to look at some statistics on the size of packages in the Ubuntu repositories, and I'm hoping to sort my searches of packages in the repositories by file size. Is there a command that will let me look at file sizes of packages in the repositories/cache, sort them by file size, etc? `apt-cache stats' doesn't provide all the information I'd like.



I'm interested in only the official repositories at the moment, and I'm interested in sorting all packages in the repositories, not simply the ones I have installed.


More From » apt

 Answers
1

That should work:



apt-cache -f dumpavail | 
egrep '^Package:|^Size:' |
sed -e 's,Size: ,,' -e 's,Package: ,
,' |
awk '{RS=""; FS="
"} {print $1, $2}' |
sort -k2 -n


I'm not proud of it but that was done in a bit of a hurry :)


[#33976] Monday, October 17, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
ranquctive

Total Points: 391
Total Questions: 103
Total Answers: 104

Location: South Sudan
Member since Thu, Feb 4, 2021
3 Years ago
ranquctive questions
;