conan remove

$ conan remove [-h] [-b [BUILDS [BUILDS ...]]] [-f] [-l] [-o]
               [-p [PACKAGES [PACKAGES ...]]] [-q QUERY] [-r REMOTE] [-s]
               [-t]
               [pattern_or_reference]

Removes packages or binaries matching pattern from local cache or remote.

It can also be used to remove the temporary source or build folders in the local conan cache. If no remote is specified, the removal will be done by default in the local conan cache.

positional arguments:
  pattern_or_reference  Pattern or package recipe reference, e.g., 'boost/*',
                        'MyPackage/1.2@user/channel'

optional arguments:
  -h, --help            show this help message and exit
  -b [BUILDS [BUILDS ...]], --builds [BUILDS [BUILDS ...]]
                        By default, remove all the build folders or select
                        one, specifying the package ID
  -f, --force           Remove without requesting a confirmation
  -l, --locks           Remove locks
  -o, --outdated        Remove only outdated from recipe packages. This flag
                        can only be used with a pattern or a reference
  -p [PACKAGES [PACKAGES ...]], --packages [PACKAGES [PACKAGES ...]]
                        Remove all packages of the specified reference if no
                        specific package ID is provided
  -q QUERY, --query QUERY
                        Packages query: 'os=Windows AND (arch=x86 OR
                        compiler=gcc)'. The 'pattern_or_reference' parameter
                        has to be a reference: MyPackage/1.2@user/channel
  -r REMOTE, --remote REMOTE
                        Will remove from the specified remote
  -s, --src             Remove source folders
  -t, --system-reqs     Remove system_reqs folders

The -q parameter can’t be used along with -p nor -b parameters.

Examples:

  • Remove from the local cache the binary packages (the package recipes will not be removed) from all the recipes matching openssl/* pattern:

    $ conan remove openssl/* --packages
    
  • Remove the temporary build folders from all the recipes matching openssl/* pattern without requesting confirmation:

    $ conan remove openssl/* --builds --force
    
  • Remove the recipe and the binary packages from a specific remote:

    $ conan remove openssl/1.0.u@ -r myremote
    
  • Remove only Windows openssl packages from local cache:

    $ conan remove openssl/1.0.u@ -q "os=Windows"
    
  • Remove system requirements installation registry for the package name referred globally for all package ids:

    $ conan remove --system-reqs package/version@user/channel
    

    This command does not remove the system installed packages, but only the Conan lock to indicate they were installed.

  • Remove system requirements installation registry for all packages named package via a wildcard

    $ conan remove --system-reqs 'package/*'
    
  • Remove system requirements installation registry for all packages via a wildcard

    $ conan remove --system-reqs '*'
    
  • Remove all remote packages only related to a specific recipe revision

    $ conan remove -r myremote package/version@user/channel#RREV --packages
    
  • Remove only a single remote package related to a specific recipe revision and its package ID

    $ conan remove -r myremote package/version@user/channel#RREV -p package_id
    
    OR
    
    $ conan remove -r myremote package/version@user/channel#RREV:PACKAGE_ID