The quickest way to check if a package is installed is to search for it with kpsewhich {package-name}.sty. So, to check for etoolbox, use
$ kpsewhich etoolbox.sty
/usr/local/texlive/2014/texmf-dist/tex/latex/etoolbox/etoolbox.sty
If it finds the package, it will output the path (just like normal which). If it doesn't find the package, it will output nothing and have a non-zero exit code.
Perhaps the most direct way to answer the question though would be to try and use the package:
\documentclass{article}
\usepackage{etoolbox}
\begin{document}
\end{document}
The above will fail if etoolbox cannot be found.
kpsewhich etoolbox.styand check the exit code. But don't useifthen– it's exceptionally out-of-date. Depending on your needs, there are a variety of better tools out there. What exactly are you trying to do? – Sean Allred Jun 03 '15 at 02:31tlmgr info etoolboxortlmgr info --list etoolbox. – Arash Esbati Jun 03 '15 at 06:22ifthen"exceptionally out-of-date"? – murray Feb 22 '22 at 18:12ifthenwas out-of-date 7(!) years ago -- it's very out-of-date now. That doesn't mean it won't work -- it just means it's probably not actively maintained/improved (unless something's changed in the years since I wrote that comment). – Sean Allred Feb 23 '22 at 16:10