# Managing optimization packs

Whether out-of-the-box or custom, before being used optimization packs need to be installed on an Akamas installation before being used.

Since optimization packs are global resources that are shared across all the workspaces on the same Akamas installation, an account with administrative privileges is required to manage them.

Optimization packs that are not yet installed are displayed as grayed out in the Akamas UI (this is the case for the AWS and Docker packs in the following figure).

<figure><img src="https://2155114708-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FgkHh2U5Lv6WWsTGWV3RA%2Fuploads%2Fgit-blob-86cb167501967dff4a09b7870d429ab05c208896%2FScreenshot%202023-01-18%20at%2010.47.40.png?alt=media" alt=""><figcaption><p>Optimization packs that are already installed or need to be installed</p></figcaption></figure>

An Akamas installation comes with the latest optimization packs already loaded in the store and is able to check the central repository for updates.

### Installing

There are two ways of installing an optimization pack:

* **online installation** - this is the general case when the optimization pack is already in the store
* **offline installation** - this may apply to custom optimization packs available as a JSON file (refer to the [Creating custom optimization pack](https://docs.akamas.io/akamas-docs/3.3.1/using-akamas/preparing-optimization-studies/modeling-components/creating-custom-optimization-packs) page)

Only in the first case, an optimization pack can be installed from the UI. See here below the command line commands to get an optimization pack installed.

**Online installation**

Execute the following command by specifying the name of the optimization pack that is already available in the store:

```bash
akamas install optimization-pack OPTIMIZATION_PACK_NAME
```

#### Offline installation <a href="#managingoptimizationpacks-2-offlineinstallation-installanoptimizationpackfromthejsondescriptor" id="managingoptimizationpacks-2-offlineinstallation-installanoptimizationpackfromthejsondescriptor"></a>

The following command describes how to download the file descriptor [https://akamas.s3.us-east-2.amazonaws.com/optimization-packs/Linux/1.3.0/Linux\_1-3-0.json](https://akamas.s3.us-east-2.amazonaws.com/optimization-packs/Linux/1.1.2/Linux_1-1-2.json) related to the version 1.3.0 of the Linux optimization pack:

```bash
curl -O https://akamas.s3.us-east-2.amazonaws.com/optimization-packs/Linux/1.3.0/Linux_1-3-0.json akamas install optimization-pack Linux_1-3-0.json
```

Execute the following command to install an optimization pack by specifying the name of the optimization pack and the full path to the JSON descriptor file:

```bash
akamas install optimization-pack PATH_TO_JSON_DESCRIPTOR
```

### Forcing installation <a href="#managingoptimizationpacks-conflicts" id="managingoptimizationpacks-conflicts"></a>

When installing an optimization pack, the following checks are executed to identify potential clashes with already existing resources:

* name of the optimization pack
* metrics
* parameters
* component types
* telemetry providers

In case one of those checks is positive (i.e. a clash exists), the installation failed and a message notifies that a "force" option needs to be used to get the optimization pack installed anyway

```bash
akamas install -f optimization-pack OPTIMIZATION_PACK_NAME
```

Please be aware that when forcing the installation of an optimization pack, Akamas replaces (or merges) all the conflicting resources, except that if there is at least one custom resource, the installation is stopped. In this case, the custom resource needs to be manually removed first in order to proceed.

### Uninstalling

The following command uninstalls an optimization pack

```bash
akamas uninstall --force OPTIMIZATION_PACK_NAME
```

Notice that this also deletes all the components built using that optimization pack.

### Updating

In case a new optimization pack needs to be installed from a descriptor, the procedure is the following:

* uninstall the optimization pack
* remove the old version of the optimization pack descriptor file from the *store container*;
* install the new optimization pack with the new JSON descriptor


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.akamas.io/akamas-docs/3.3.1/using-akamas/preparing-optimization-studies/modeling-components/installing-optimization-packs.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
