This is for the following scenario, but should work for the official package repository too:
Create /usr/local/sbin/localonlypackages with:
Substitute %n with %o to get a list of port origins instead of package names.
Make it executable:
To list all of those packages run
- You have setup your own package repository with ports-mgmt/poudriere and use that for installing packages.
- You have installed (tried out) ports that are not in that repository.
Create /usr/local/sbin/localonlypackages with:
Code:
#!/bin/sh
cat <<EOF | sort | uniq -u
`pkg query %n | xargs pkg rquery %n`
`pkg query %n`
EOF
Make it executable:
chmod +x /usr/local/sbin/localonlypackages
.To list all of those packages run
localonlypackages
and to remove them localonlypackages | xargs pkg remove -y
.