I tested installing a package for which I had to use
yum localinstall <pkgfile>.rpm. Worked fine, but I cannot figure out how to remove it. How can I achieve that?
I have just been through this process. The filename for the rpm package I installed was not the same as the package name.
It is possible to find packages that have been installed using
yum localinstall by using
yum list | grep commandline.
The package name will be on the left of the output of that command (there may of course be multiple packages if you've installed multiple rpms from files so you may have to find the one you want), and you can feed that to
yum erase as indicated in patbarron's answer (i.e.
yum erase <package_name>).