Main Content

mpmuninstall

Uninstall package

Since R2024b

    Description

    mpmuninstall(pkg) uninstalls the specified package and all of its unused dependencies. A dependency is unused if it was not installed directly and no other packages depend on it. Uninstalled packages are removed from the MATLAB path but package files are not removed from disk by default. Packages that are not successfully uninstalled are not removed from the path.

    example

    mpmuninstall(pkg,Name=Value) specifies options using one or more name-value arguments. For example, you can specify whether to uninstall unused package dependencies.

    example

    Examples

    collapse all

    Uninstall the package MyPackage. When prompted, confirm the removal.

    mpmuninstall("MyPackage")
    The following packages will be uninstalled:
        MyPackage@1.0.0
    
    Do you want to continue? [YES/no]:
    
    Uninstallation complete.

    Uninstall the package MyPackage and specify detailed display information. When prompted, confirm the removal.

    mpmuninstall("MyPackage",Verbosity="detailed")
    The following packages will be uninstalled:
        MyPackage@1.0.0
    
    Do you want to continue? [YES/no]:
    
    Successfully removed the following packages from the path:
        MyPackage
    
    Uninstallation complete.

    Input Arguments

    collapse all

    MATLAB package, specified as a string array where each element contains a package specifier, matlab.mpm.Package object array, matlab.mpm.PackageSpecifier object array, or matlab.mpm.PackageIdentifierobject array. If packageSpecifier is a string scalar or character vector, then it must contain a package specifier in the format "Name", "Name@VersionRange", or "Name@VersionRange@ID". This option limits the output to only packages whose package specifier fits the specified value.

    Example: “packageSource”

    Example: “packageSpecifier”

    Example: “packageSpecifier@1.0.0”

    Example: "Pkg@1.0.1@17487be8-15e8-447b-9319-83516fc31f08"

    Name-Value Arguments

    collapse all

    Specify optional pairs of arguments as Name1=Value1,...,NameN=ValueN, where Name is the argument name and Value is the corresponding value. Name-value arguments must appear after other arguments, but the order of the pairs does not matter.

    Example: mpmuninstall(pkg,Prompt=true)

    Display uninstallation prompts, specified as a numeric or logical 1 (true) or 0 (false). If you specify Prompt as false, then uninstallation prompts are not displayed and the function automatically confirms that packages should be uninstalled when prompted.

    Example: Prompt=false

    Verbosity level for displayed information, specified as one of these values:

    • "normal" (default) — Display informational messages during uninstallation.

    • "quiet" — Do not display informational messages.

    • "detailed" — Display additional informational messages.

    Example: Verbosity="quiet"

    Keep unused dependencies, specified as a numeric or logical 0 (false) or 1 (true). If you specify KeepUnusedDependencies as true, then the function does not uninstall unused dependencies.

    Example: KeepUnusedDependencies=false

    Force uninstall, specified as a numeric or logical 0 (false) or 1 (true). If you specify Force as true, then the function uninstalls packages even if another package depends on it.

    Example: Force=true

    Since R2026a

    Delete package files from disk, specified as a numeric or logical 0 (false) or 1 (true). If you specify Delete as true, then the function uninstalls packages and then deletes the package files and folders from disk. If KeepUnusedDependencies is false, dependencies of removed packages are uninstalled and deleted from disk as well. Regardless of the value of Delete, packages that are installed in-place are uninstalled but are not deleted from disk.

    Example: Delete=true

    Version History

    Introduced in R2024b

    expand all