Let foo-1.1 be a pakage that installs (via 'make install') following files:
/usr/bin/foo /usr/lib/foo/some-data.bin /usr/lib/foo.so -> foo.so.1 /usr/lib/foo.so.1 /usr/man/man1/foo.1 /usr/share/magic-numbers
(I assume it was configured with --prefix=/usr) Removing this from the system is not easy if you have no such list. Say, you can't tell that magic-numbers in /usr/share belongs to foo-1.1 unless you really know that package well. For most packages in system that isn't so.
Let's change it in following way:
/usr/pkg/foo-1.1/bin/foo /usr/pkg/foo-1.1/lib/foo/some-data.bin /usr/pkg/foo-1.1/lib/foo.so -> foo.so.1 /usr/pkg/foo-1.1/lib/foo.so.1 /usr/pkg/foo-1.1/man/man1/foo.1 /usr/pkg/foo-1.1/share/magic-numbers /usr/bin/foo -> ../pkg/foo-1.1/bin/foo /usr/lib/foo -> ../pkg/foo-1.1/lib/foo /usr/lib/foo.so -> ../pkg/foo-1.1/lib/foo.so /usr/lib/foo.so.1 -> ../pkg/foo-1.1/lib/foo.so.1 /usr/man/man1/foo.1 -> ../pkg/foo-1.1/man/man1/foo.1 /usr/share/magic-numbers -> ../pkg/foo-1.1/share/magic-numbersIt's now easy to remove foo-1.1 from the system: just rm -fr /usr/pkg/foo-1.1, and only some dead symlinks will remain. Removing them isn't a hard task also.
Now one can tell what is pkg. It's just a set of utilites (usually bundled in a single executable) to maintain such structure.