Friday, May 3, 2024
4
rated 0 times [  4] [ 0]  / answers: 1 / hits: 1230  / 2 Years ago, wed, january 26, 2022, 9:05:07

I want to know how-much data is needed to download any package by apt without installing that package.



In other words if I run apt-get install xyz then it will download and install packages with their dependencies. But I want to know/show only how-much (Total)data (ex:need to get 73MB of archives) to download without downloading and installing that package(s).


More From » command-line

 Answers
3

Yep, it could be possible through parsing apt-get command. Try the below command to show how much disk space will be used for installing that package,



echo 'n' | sudo apt-get install package | sed -n '/^After/ s/^[^,]*, (.*)$/1/p'


Example:



$ echo 'n' | sudo apt-get install chromium-browser | sed -n '/^After/ s/^[^,]*, (.*)$/1/p'
176 MB of additional disk space will be used.


OR



Try the below command to show the size of archives needed to be downloaded for that particular package.



echo 'n' | sudo apt-get install package | sed -n '/^Need to get/p'    


Example:



$ echo 'n' | sudo apt-get install chromium-browser | sed -n '/^Need to get/p'
Need to get 44.4 MB of archives.

[#24874] Friday, January 28, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
ardtry

Total Points: 254
Total Questions: 99
Total Answers: 114

Location: Finland
Member since Fri, Oct 21, 2022
2 Years ago
;