linkapps: deal only with kegs, not formulae

Fixes #19873.