# beamer: Package hyperref Error: Wrong DVI mode driver option ps2pdf', (hyperref) because pdfTeX or LuaTeX is running in PDF mode

There are many questions with a similar title, but none of the answers seems to solve my problem. I get this error while preparing slides with beamer. It shows up only when using an up-to-date texlive distribution. When using packages from Ubuntu, it does not. By deleting lines, I saw that it looks like it is beamer that turns the error message on. The following code:

\documentclass{beamer}
%\usepackage[T1]{fontenc}
\mode<presentation>
{
}
%\usepackage[driverfallback=dvipdfm]{hyperref}
\usepackage[utf8]{inputenc}
\begin{document}
\begin{frame}
\titlepage
\end{frame}
\end{document}


provokes the message:

(/usr/local/texlive/2016/texmf-dist/doc/latex/listings-ext/hyperref.cfg

! Package hyperref Error: Wrong DVI mode driver option ps2pdf',
(hyperref)                because pdfTeX or LuaTeX is running in PDF mode.

See the hyperref package documentation for explanation.
Type  H <return>  for immediate help.
...

l.24 }

?


How can I get rid of that error? Using the driverfallback option as commented out or putting it as an option hyperref={driverfallback=dvipdfm} to class beamer does not help, nor does putting pdftex as an option to just about anything. I have absolutely no need to use listings-ext that contains hyperref.cfg file that sets that ugly ps2pdf option; it seems that beamer in the current texlive distribution loads it all by itself.

• How are you compiling? I tried with pdflatex from texlive2016 and it works fine. – user36296 Feb 20 '17 at 16:14
• Why does your texsystem load a hyperref.cfg from the doc-folder? That's certainly wrong. Did you change something in the configuration? – Ulrike Fischer Feb 20 '17 at 16:18
• I installed texlive using install-tl-unx.tar.gz and running the installer. To compile the file, I just give the command pdflatex mowa, where mowa.tex is the name of the file to compile. My relevant shell variables are PATH="/usr/local/texlive/2016/bin/x86_64-linux:/home/jandac/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin" and TEXINPUTS="/usr/local/texlive/2016/texmf-dist//:/home/jandac/texmf//:.". I changed nothing in the configuration. – jandac Feb 21 '17 at 8:37

I have changed TEXINPUTS so that the initial part is no longer /usr/local/texlive/2016/texmf-dist// but it became /usr/local/texlive/2016/texmf-dist/tex//, and the example compiles, as well as the slides.