Skip to content

Instantly share code, notes, and snippets.

@rossmacarthur
Created November 21, 2017 13:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rossmacarthur/364186f451086b2960cc504a354b6ee7 to your computer and use it in GitHub Desktop.
Save rossmacarthur/364186f451086b2960cc504a354b6ee7 to your computer and use it in GitHub Desktop.
Check download size of APT package/s
#!/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