How to use fixltx2e only when necessary

You can distinguish pre-2015 kernels from the fact that \IncludeInRelease is not defined:

\begingroup\expandafter\expandafter\expandafter\endgroup
\expandafter\ifx\csname IncludeInRelease\endcsname\relax
  \usepackage{fixltx2e}
\fi

See What does \begingroup\expandafter…\endgroup do? for an explanation of the code.


If you are using TeXLive you can use the solution below to obtain which version you are running.

References:

  • Automatically Determine which TeXLive Version is being used

Code:

\documentclass{article}

\makeatletter%
\def\getversion{\expandafter\get@version\pdftexbanner\@nil}%
\def\get@version#1201#2)#3\@nil{\def\TeXLiveVersion{201#2}}%
\makeatother%
\getversion%

\ifnum\TeXLiveVersion<2015\relax%
    \usepackage{fixltx2e}%
    \typeout{*** Included fixltx2e}
\elese
    \typeout{*** DId NOT Included fixltx2e}
\fi%


\begin{document}
xxx
\end{document}