% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/pkgDep.R
\name{cacheClearPackages}
\alias{cacheClearPackages}
\alias{clearRequirePackageCache}
\title{Clear cached package tarballs}
\usage{
cacheClearPackages(
  packages,
  ask = interactive(),
  Rversion = versionMajorMinor(),
  clearCranCache = FALSE,
  verbose = getOption("Require.verbose")
)

clearRequirePackageCache(
  packages,
  ask = interactive(),
  Rversion = versionMajorMinor(),
  clearCranCache = FALSE,
  verbose = getOption("Require.verbose")
)
}
\arguments{
\item{packages}{Either missing or a character vector of package names
(currently cannot specify version number) to remove from the cache.}

\item{ask}{Logical. If \code{TRUE}, asks the user to confirm before deleting.}

\item{Rversion}{An R version (major.minor, e.g., \code{"4.2"}). Defaults to
the current R version. \strong{Ignored under \code{usePak = TRUE}} -- see
"Migration note".}

\item{clearCranCache}{Logical. If \code{TRUE}, also clears the local
\code{crancache} cache, which is only relevant if
\code{options(Require.useCranCache = TRUE)}.}

\item{verbose}{Numeric or logical indicating how verbose should the function
be. If -1 or -2, then as little verbosity as possible. If 0 or FALSE,
then minimal outputs; if \code{1} or TRUE, more outputs; \code{2} even more. NOTE: in
\code{Require} function, when \code{verbose >= 2}, also returns details as if
\code{returnDetails = TRUE} (for backwards compatibility).}
}
\description{
Removes downloaded package archives from the cache that \code{\link[=cachePkgDir]{cachePkgDir()}}
returns. With \code{usePak = TRUE} (the default) this delegates to
\code{pak::cache_clean()} (no \code{packages} arg) or
\code{pak::cache_delete(package = ...)} (selective). With \code{usePak = FALSE}
it walks Require's legacy bookkeeping dir and unlinks tarballs there.
}
\details{
Require's own bookkeeping (SHA DB, mirrors.csv, available.packages
snapshots) is preserved by this function; use \code{\link[=cachePurge]{cachePurge()}} to clear
those as well.

\code{clearRequirePackageCache()} is a deprecated alias.
}
\section{Migration note}{


The \code{Rversion} parameter is honoured only on the legacy path -- pak's
cache is not partitioned by R version the way Require's cache was, so
\code{pak::cache_clean()}/\code{pak::cache_delete()} operate on the whole cache
regardless of \code{Rversion}. The function emits a verbose note when
\code{Rversion != versionMajorMinor()} under \code{usePak = TRUE}.
}

