\begin{exe} {Basic APT Commands}


   \begin{enumerate}
      \item
      Check to see if there are any available updates for
      your system.
      \item
      List all installed kernel-related packages, and list
      all installed or available ones.
      \item
      Install the \textbf{apache2-dev} package, or anything
      else you might not have installed yet.  Doing a simple:
      \begin{cmd}
$ apt-cache pkgnames
      \end{cmd}

      will let you see a complete list; you may want to give a wildcard
      argument to narrow the list.
   \end{enumerate}

   \begin{sol}

      \begin{enumerate}
         \item
         First synchronize the package index files with
         remote repositories:
         \begin{cmd}
$ sudo apt-get update
         \end{cmd}
         To actually upgrade:
         \begin{cmd}
$ sudo apt-get upgrade
$ sudo apt-get -u upgrade
         \end{cmd}
         (You can also use \verb?dist-upgrade? as
         discussed earlier.)  Only the first form will
         try to do the installations.
         \item
         \begin{cmd}
$ apt-cache search "kernel"
$ apt-cache search -n "kernel"
$ apt-cache pkgnames "kernel"
         \end{cmd}
         The second and third forms only find packages
         that have \verb?kernel?  in their name.
         \begin{cmd}
$ dpkg --get-selections "*kernel*"
         \end{cmd}
         to get only installed packages.  Note that on
         \textbf{Debian}-based systems you probably
         should use \verb?linux? not \verb?kernel? for
         kernel-related packages as they don't usually
         have \verb?kernel? in their name.
         \item
         \begin{cmd}
$ sudo apt-get install apache2-dev
         \end{cmd}
      \end{enumerate}

   \end{sol}

\end{exe}

