[Solved] OPKG - How to list only packages that I have installed?


#1

By following the EXTROOT configuration guide, I was told to remove the packages I have installed:

These devices should have enough space to install the packages we need. Remove all packages you have installed to add functionality, as they are only wasting space now. After you make the extroot you will have all space you need.

But, how to do that? opkg list-installed isn't what I need, because it lists all installed packages, not just the ones I have installed. Neither is opkg list-installed | cut -d- -f1 | opkg status | grep -B 3 "user installed", because it still lists more "user installed" packages than I really installed.


Firstboot and default config generation without reboot
#2

opkg list-installed is the correct command...what are you trying to accomplish???

WHAT!?!?!?

If you have an image from the LEDE site that needs packages uninstalled to make more space, you will have to create a custom image for your needs. Uninstalling included packages doesn't free space.


#3

opkg list-installed is the correct command…what are you trying to accomplish???

opkg list-installed lists busybox and opkg as installed by me. I have not installed opkg using opkg! I remember installing gparted, for example, so I removed it, but there are 125 packages on the result, as I could check with opkg list-installed | grep "." -c.

If you have an image from the LEDE site that needs packages uninstalled to make more space, you will have to create a custom image for your needs. Uninstalling included packages doesn’t free space.

I don't want to remove packages already present on the distro, just the ones I installed after the distro was installed. So, I don't want a smaller LEDE package, but that my LEDE, that already had some packages installed by me, have those packages removed, to free up space on the overlay partition.


#4
  • Make a backup of your config
  • Perform a firstboot and restart
  • Restore your config

All the packages you installed will be removed.


#5

Perhaps

ls /overlay/upper/usr/lib/opkg/info/*.list | sed -e 's/.*\///' | sed -e 's/\.list//'

(That also shows the ones you have updated, as well as added)


#6

If all the stuff you need to install to get extroot working still fits into your flash, then there's no need to remove anything you installed after flashing.


#7

I asked due to the possibility of removing the USB drive on the future, and then needing to deal with a smaller space again...


#8

https://wiki.openwrt.org/doc/howto/generic.sysupgrade

There is section close to tha top of the page that describes how to list user installed packages.

#!/bin/ash
echo >&2 User-installed packages are the following:
sed -ne '/^Package:[[:blank:]]*/ {
	s///
	h
}
/user installed/ {
	g
	p
}' /usr/lib/opkg/status

#10

That actually lists user and default packages

... In addition, packages installed as dependences of other packages may show here.