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. If pkg includes any packages that are dependencies for an installed package, then those packages are not removed and their InstalledAsDependency property is set to true. Uninstalled packages are removed from the MATLAB path but package files are not removed from disk. 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, or matlab.mpm.PackageSpecifier object array.

    Example: “packageSource”

    Example: “packageSpecifier”

    Example: “packageSpecifier@1.0.0”

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

    Name-Value Arguments

    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"

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

    Example: RemoveUnusedDependencies=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

    Version History

    Introduced in R2024b