Created
November 21, 2017 13:21
-
-
Save rossmacarthur/364186f451086b2960cc504a354b6ee7 to your computer and use it in GitHub Desktop.
Check download size of APT package/s
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
package_and_size() { | |
local size=$(apt-get -y --print-uris install $1 | sed -n -e 's/Need to get \(.*\) of archives./\1/p') | |
printf "%-30s%s\n" "${1}" "${size}" | |
} | |
for pkg in "$@"; | |
do | |
package_and_size $pkg | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment