Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision Next revisionBoth sides next revision | ||
| user:vvkjndl:opkg-list-packages-sorted [2020/10/10 20:18] – vvkjndl | user:vvkjndl:opkg-list-packages-sorted [2020/10/30 15:24] – vvkjndl | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ===== Opkg List All Installed Packages Sorted by Size===== | + | ===== Opkg List All Installed Packages Sorted by Size ===== |
| :!: This script is inspired by [[https:// | :!: This script is inspired by [[https:// | ||
| Line 5: | Line 5: | ||
| :!: This script will list all packages instead of listing only user-installed packages. | :!: This script will list all packages instead of listing only user-installed packages. | ||
| - | Three conditions are applied in determining a package size (in order, if first is not application | + | Three conditions are applied in determining a package size (in order, if the first one is not applicable |
| * Calculate size of all files in package list file ''/ | * Calculate size of all files in package list file ''/ | ||
| - | * Calculate package size using opkg itself. '' | + | * Calculate package size using opkg itself. '' |
| * Mark package size as unknown using '' | * Mark package size as unknown using '' | ||
| + | |||
| + | :!: This script should work on base installation without requiring any additional packages to be installed. | ||
| <file bash opkg-list-installed-packages-sorted-by-size.sh> | <file bash opkg-list-installed-packages-sorted-by-size.sh> | ||
| Line 23: | Line 25: | ||
| if [[ -z " | if [[ -z " | ||
| then | then | ||
| - | packagesizeb=$(opkg info $packagename | grep Size | sed ' | + | packagesizeb=$(opkg info $packagename | grep Size\: | sed ' |
| if [[ -z $packagesizeb ]] | if [[ -z $packagesizeb ]] | ||
| then | then | ||
| echo -e "-.- KB \t\t$packagename" | echo -e "-.- KB \t\t$packagename" | ||
| else | else | ||
| - | packagesizekb=$(opkg info $packagename | grep Size | sed ' | + | packagesizekb=$(opkg info $packagename | grep Size\: | sed ' |
| printf ' | printf ' | ||
| fi | fi | ||