\section{zypper}

\begin{frame}
   {zypper}

   \begin{itemize}
      \item Command-line tool for installing and managing
      packages in \textbf{SUSE Linux} and \textbf{openSUSE}
      \item Retrieves packages from a repository
      \item Resolves dependencies
      \item Works with \textbf{RPM} packages
      \item Is similar to \textbf{dnf} in commands and functionality
   \end{itemize}

\end{frame}

\cprotect\note{


   For use on \textbf{SUSE}-based systems, the
   \textbf{zypper} program provides a higher level of
   intelligent services for using the underlying
   \textbf{rpm} program, and plays the same role as
   \textbf{dnf/yum} on \textbf{Red Hat}-based systems.  It can
   automatically resolve dependencies when installing,
   updating and removing packages.  It accesses external
   software \textbf{repositories}, synchronizing with them
   and retrieving and installing software as needed.

   \textbf{zypper} is the command line tool for installing
   and managing packages in \textbf{SUSE Linux} and
   \textbf{openSUSE}. It is very similar to \textbf{dnf}
   in its functionality and even in its basic command
   syntax, and also works with \textbf{rpm } packages.

}
\section{Queries}
\begin{frame}
   {Queries}

   \begin{itemize}
      \item Commands
      \begin{cmd}
$ zypper list-updates
$ zypper repos
$ zypper search
$ zypper info
$ zypper search --provides /usr/bin/firefox
      \end{cmd}
   \end{itemize}

\end{frame}

\cprotect\note{

   \begin{cmd}
$ zypper list-updates
   \end{cmd}
   shows a list of available updates.

   \begin{cmd}
$ zypper repos
   \end{cmd}
   lists available repositories.

   \begin{cmd}
$ zypper search <string>
   \end{cmd}
   searches repositories for string.

   \begin{cmd}
$ zypper info firefox
   \end{cmd}
   lists info about a package.

   \begin{cmd}
$ zypper search --provides /usr/bin/firefox
   \end{cmd}
   searches repositories to show what packages
   provide a file.

}


\section{Installing/Removing/Upgrading Packages}
\begin{frame}
   {Installing/Removing/Upgrading Packages}

   \begin{itemize}
      \item \texttt{zypper install}
      \begin{cmd}
$ sudo zypper install firefox
      \end{cmd}
      \item \texttt{zypper update}
      \begin{cmd}
$ sudo zypper --non-interactive update
$ sudo zypper update firefox
      \end{cmd}
      \item \texttt{zypper remove}
      \begin{cmd}
$ sudo zypper remove firefox
      \end{cmd}
      \item \verb?--non-interactive? (or \verb?-n?) does not
      ask for confirmation

   \end{itemize}

\end{frame}

\cprotect\note{

   \begin{cmd}
$ sudo zypper install firefox
   \end{cmd}
   installs or updates package on the system.

   \begin{cmd}
$ sudo zypper --non-interactive install firefox
   \end{cmd}
   does not ask for confirmation of install or upgrade.
   This is useful for scripts.

   \begin{cmd}
$ sudo zypper update
   \end{cmd}
   updates all packages on system from a repository.

   \begin{cmd}
$ sudo zypper --non-interactive update
   \end{cmd}
   updates all packages on system from a repository, but
   does not ask for confirmation.  This is useful for
   scripts.

   \begin{cmd}
$ sudo zypper remove firefox
   \end{cmd}
   removes a package from the system.

   Like with \textbf{dnf}, one has to be careful with the
   removal command as any package that needs the package
   being removed would be removed as well.

}

\section{Additional zypper Commands}
\begin{frame}
   {Additional zypper Commands}

   \begin{itemize}
      \item
      Enter a \textbf{zypper} command line shell interface:
      \begin{cmd}
$ sudo zypper shell
      \end{cmd}
      \item Add a new repository:
      \begin{cmd}
$ sudo zypper addrepo
      \end{cmd}
      \item Remove a repository:
      \begin{cmd}
$ sudo zypper removerepo
      \end{cmd}
      \item
      Clean up and save space in \filelink{/var/cache/zypp}:
      \begin{cmd}
$ sudo zypper clean [--all]
      \end{cmd}
   \end{itemize}

\end{frame}

\cprotect\note{

   Sometimes a number of \textbf{zypper} commands must be
   run in a sequence. To avoid re-reading all the
   databases for each command, you can run \textbf{zypper}
   in \textbf{shell mode} as in:
   \begin{cmd}
$ sudo zypper shell
> install bash
...
> exit
   \end{cmd}
   Because \textbf{zypper} supports the \textbf{readline}
   library, you can use all the same command line editing
   functions in the \textbf{zypper} shell available in the
   \textbf{bash} shell.

   To add a new  repository:
   \begin{cmd}
$ sudo zypper addrepo URI alias
   \end{cmd}
   which is located at the supplied \texttt{URI} and will
   use the supplied \texttt{alias}.

   To remove a repository from the list:
   \begin{cmd}
$ sudo zypper removerepo alias
   \end{cmd}
   using the \texttt{alias} of the repo you want to delete.

}



