> ## Documentation Index
> Fetch the complete documentation index at: https://devdocs.xbox.com/llms.txt
> Use this file to discover all available pages before exploring further.

# XPackageUninstallPackage

> XPackageUninstallPackage

# XPackageUninstallPackage

Uninstalls a given package.

## Syntax

```cpp theme={null}

bool XPackageUninstallPackage(
    const char* packageIdentifier) 
noexcept;
```

### Parameters

*packageIdentifier*   \_In\_z\_\
Type: char\*

A string that uniquely identifies the installed package on the disk. For more information about package identifiers, see [Manage and license downloadable content (DLC)](/publishing/xstore-commerce/xstore-dlc).

### Return value

Type: bool

Bool tells whether package was uninstalled successfully or not.

## Remarks

<Note>This function isn't safe to call on a time-sensitive thread. For more information, see [Time-sensitive threads](https://learn.microsoft.com/gaming/gdk/docs/gdk-dev/console-dev/overviews/threads/time-sensitive-threads).</Note>

**XPackageUninstallPackage** uninstalls the given package.  The package identifier provided will have been returned from **XPackageEnumeratePackages** or another API that returns a package identifier. **XPackageUninstallPackage** returns true if the package was uninstalled or false if the package could not be uninstalled.

Reasons for a package failing to uninstall include:

* The package is in use. For example, it is a DLC package the game currently has mounted.
* The game is running on an xCloud server.  Package installation and removal is the responsibility of the server environment.

In the following example, **XPackageUninstallPackage** is used to uninstall a package to free up space on disk for user.

```cpp theme={null}
bool UninstallDlcToReclaimDiskSpace(const char_t* packageIdentifier) 
{
return XPackageUninstallPackage(packageIdentifier);
} 
```

## Requirements

**Header:** XPackage.h

**Library:** xgameruntime.lib

**Supported platforms:** Windows, XBOX One family consoles and XBOX Series consoles

## Conceptual documentation

* [Manage and license downloadable content (DLC)](/publishing/xstore-commerce/xstore-dlc)

## See also

[XPackage](/reference/system/xpackage/xpackage_members)\
[Streaming Installation and Intelligent Delivery](/build/core-features/common/packaging/overviews/streaming_install-intelligent_delivery)


## Related topics

- [Manage and license downloadable content (DLC)](/publishing/xstore-commerce/xstore-dlc.md)
- [XPackage](/reference/system/xpackage/xpackage_members.md)
- [XPackageUninstallChunks](/reference/system/xpackage/functions/xpackageuninstallchunks.md)
- [XPackageUninstallUWPInstance](/reference/system/xpackage/functions/xpackageuninstalluwpinstance.md)
- [FAQ for PC developers](/build/gdk-and-engines/guides/pc-faq.md)
