# Beamer and tikz globally and locally installed [duplicate]

I am using lyx and want to crate a Beamer presentation with flowcharts.

But I want to make the aspect ratio to be 19:6. The last version of the Beamer package supports this, but older ones, not.

In my system, the older one is installed. So, I have installed locally the newer one (along with all required packages, including pgf, that in turn includes tikz).

This works fine and I can produce beamer presentations with 19:6 aspect ratio.

But now, I want to add some flowcharts. For this purpose, I load the package tikz. But when I attempt to compile I get the following errors:

LaTeX Error: Command \pgfdeclareimage already defined.

LaTeX Error: Command \pgfdeclaremask already defined.

LaTeX Error: Command \pgfimage already defined.

And I think that Latex loads twice the pgf package. So, how could I prevent latex from loading the older (globally installed) packages without to delete them (I do not have root permissions).

But it seems to work well when only the beamer package is loaded, which is also installed globally and locally).

The latex code follows. I have generated it from lyx with Export->LaTeX(pdflatex), and get the same errors as within lyx when I run the file with pdflatex:

%% LyX 2.1.4 created this file.  For more info, see http://www.lyx.org/.
%% Do not edit unless you really know what you are doing.
\documentclass[english,aspectratio=169]{beamer}
\usepackage[T1]{fontenc}
\usepackage[latin9]{inputenc}
\setcounter{secnumdepth}{3}
\setcounter{tocdepth}{3}

\makeatletter
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Textclass specific LaTeX commands.
% this default might be overridden by plain title style
\newcommand\makebeamertitle{\frame{\maketitle}}%
% (ERT) argument for the TOC
\AtBeginDocument{%
\let\origtableofcontents=\tableofcontents
\def\tableofcontents{\@ifnextchar[{\origtableofcontents}{\gobbletableofcontents}}
\def\gobbletableofcontents#1{\origtableofcontents}
}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% User specified LaTeX commands.
\usepackage{tikz}

\makeatother

\usepackage{babel}
\begin{document}
This is a test
\end{document}