From the LyX Wiki, Trouble Configuring LyX (missing classes) with MikTeX:
MiKTeX can cause problems with the configure script in LyX if the "Install missing packages on-the-fly" option is checked. If you find that only a few classes are available in LyX under Windows, try disabling this option in the MiKTeX general options (mo.exe) and re-configuring LyX.
So start MiKTeX options (start menu or mo.exe) and choose No (rather not not "Ask me first") for the option "Install missing packages on-the-fly", as recommended in the MiKTeX 2.9 issues (actually for TeXnicCenter compatibility), valid also for MiKTeX 2.8. If necessary, install manually using the MiKTeX package manager, and reconfigure LyX.
Here's a screenshot of the options window:

I was struggling with this myself, until I came across this article. I had to make a few adaptations for my setup as follows (for the purposes of this post, the unavailable document class I wanted to install was called clv2
, for which I had a clv2.cls
file):
Step 0:
This was not mentioned in the article, nor do I know if it's absolutely necessary, but I quit LyX before I started this process.
Step 1:
Copy the clv2.cls file in your latex directory. To find where it is go to LyX > Tools > TeX Information > LaTeX Classes > Show path. For me it was /Users/sylvie/Library/texmf/tex/latex/lyx/.
When I did LyX > Tools > TeX Information > LaTeX Classes > Show path
, I saw /usr/local/texlive/2011/texmf-dist/tex/latex
There was no lyx
directory there, so I had to create one for myself. Then I copied clv2.cls
into /usr/local/texlive/2011/texmf-dist/tex/latex
Step 2:
Make a .layout file with the same name (clv2.layout)
This was very straightforward. I wanted an article
(not a manuscript
) though, so my layout file looked like this:
#% Do not delete the line below; configure depends on this
# \DeclareLaTeXClass[clv2]{article (clv2)}
# Input general definitions
Input stdclass.inc
Step 3:
Copy the clv2.layout file into your package content. For me it was Applications > LyX > Contents > Resources > layouts > clv2.layout
My package content was located at /Users/ashwin/Library/Application Support/LyX-2.0/layouts
, so that's where I copied clv.layout
to
Step 4:
Open a terminal and on the command prompt write sudo texhash (LaTeX will be reconfigured)
This was very straightforward. I was asked for my password, which is normal.
Step 5:
Open LyX, and then go to LyX > Reconfigure, and Restart Lyx
Again, this was very straightforward. No hitches here.
Step 6:
Go to Document > Settings > Document Class > manuscript (clv2)
Since I wanted an article
and therefore changed clv2.layout
, I found an article (clv2)
in my list of document classes.
Hope this helps
Best Answer
I had the same problem. I tried various things and the following helped although I didn't know if any steps were unneeded.
Did these steps from https://wiki.lyx.org/Layouts/Layouts#toc1
Started MiKTex Package Manager (Admin) At one point it complained about an invalid repository so change repository source
Started the MiKTeX Package Manager and installed some packages of the thousands available.
In DOS window, ran “texhash”
In Lyx, do Tools -> Reconfigure
Repeat steps 3., 4., and 5. as needed.
Hope that helps.