# Install Cross-Platform Client

You can install the Adaptiva Client on Linux and MacOS by installing the appropriate package and running the `adaptivactl` setup command. The setup command will install the OneSite client, configure firewall rules, and run post-installation checks to ensure functionality. The setup progress will print to the terminal and exit with a `0` exit-code if successful. If the client setup fails for any reason, it will exit with a non-zero exit-code.

The adaptivactl setup command checks for port availability before client setup. If a firewall is detected, setup will create firewall rules using the appropriate application: *ufw* with the DEB package, *firewalld* with the RPM package, and *socketfilterfw* with the MacOS package.

The client will now run post-setup checks to confirm connectivity with the server and other services. The setup will wait for these checks to be completed. You can skip these checks using the `--skip-connection-checks` flag.

There are several different installation packages provided for cross-platform device installations. Be sure to use the correct one for your operating system. Locate the installers\cross-platform folder in the downloaded .zip file.

{% hint style="info" %}
When installing the cross-platform client for the Adaptiva Cloud tenant, see [SaaS Client Installation](https://docs.adaptiva.com/platform-install/client-install-and-uninstall/client-install/client-install-saas) for more information.
{% endhint %}

## Linux Installation

### Adaptiva RPM signing key

With the inclusion of openSUSE and SUSE Linux support in version 10.1.972, you will need to import the Adaptiva RPM signing key on each SUSE-based Linux machine during prior to installation. This will allow these distributions to verify the signature of the RPM package.

The following distributions apply:

* Required
  * SUSE-based (openSUSE, SUSE Linux Enterprise)
* Optional - (Good practice to install the RPM signing key, but not necessary.)
  * Other RPM-based Linux distributions (Rocky Linux, Fedora, RHEL, etc.)
* Does not apply
  * DEB-based (Debian and Ubuntu)

1. Open a terminal window and run the following command to import the Adaptiva RPM signing key:

   ```bash
   sudo rpm --import https://adaptiva-releases.adaptivacdn.cloud/client/RPM-GPG-KEY-Adaptiva
   ```

{% hint style="info" %}
If you do not install the RPM signing key you will see the following message when trying to install the RPM:

*Signature verification failed \[4-Signatures public key is not available]*
{% endhint %}

### Install the package

* Run the following command to execute the package (replace `<version>` with the appropriate version of the Adaptiva client your are trying to install and `<arch>` with the specific architecture):
  * DNF package manager

    ```bash
    sudo dnf install ./adaptiva-client-<version>-1.<arch>.rpm
    ```
  * APT package manager

    ```bash
    sudo apt install ./adaptiva-client-<version>-1.<arch>.deb
    ```
  * Zypper package manager

    ```bash
    sudo zypper install adaptiva-client-<version>-1.suse.<arch>.rpm
    ```

{% hint style="info" %}
When running the apt install interactively, the following message may be returned: `N: Download is performed unsandboxed as root as file ‘/<path-to-install-package>’ couldn’t be accessed by user ‘_apt’. – pkgAcquire::Run (13: Permission denied) 109` You may ignore this error.
{% endhint %}

### Configure the client

1. Run the following `adaptivactl` command in setup mode to configure the client:

   ```bash
   sudo /opt/adaptiva/adaptivaclient/bin/adaptivactl setup <flags>
   ```

   Only the `--server` flag is required. See the table below for the available parameters.

   **Example:**

   ```bash
   sudo /opt/adaptiva/adaptivaclient/bin/adaptivactl setup --server adaptivaserver.corp.example
   ```
2. Once the client installation is completed, the client will perform a series of connection checks.

   ```bash
   [info] Running connection checks…
   [info] The connection check ‘HTTP Connection’ has started
   [info] The connection check ‘HTTP Connection’ has passed
   …
   ```

   * If installing a SUSE-based distribution, these checks will not be run.
3. When the connection checks are completed, the Patch Client is fully online and ready to be managed.

### Linux logs

Run the following command to view the client service log:

```bash
  sudo journalctl -u adaptivaclientd.service > .\AdaptivaClientdService.log
```

* Client logs: **/opt/adaptiva/adaptivaclient/logs**

## MacOS Installation

1. Open a Command terminal window, then run the following command to execute the package:

```zsh
sudo installer -tgt / -pkg ./adaptiva-client-<version>-macOS.pkg
```

1. Run the following `adaptivactl` command in setup mode to configure the client:

```zsh
sudo /opt/adaptiva/adaptivaclient/bin/adaptivactl setup <flags>
```

Only the `--server` flag is required. See the table below for the available parameters.

1. Once the client installation is completed, the client will perform a series of connection checks.

```bash
[info] Running connection checks…
[info] The connection check ‘HTTP Connection’ has started
[info] The connection check ‘HTTP Connection’ has passed
…
```

## Mac adaptiva log

* Client installation log: **/opt/adaptivaclient/logs/adaptiva.log**
* Client logs: **/opt/adaptiva/adaptivaclient/logs**

### adaptivactl command line parameters

A list of the command line parameters for the adaptivactl, both required and optional. Known flags can also be printed by running:

```bash
/opt/adaptiva/adaptivaclient/bin/adaptivactl setup --help
```

| Flag                                                | Value                                                                                                                                    |
| --------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- |
| **Required**                                        |                                                                                                                                          |
| --server `<hostname>` / `<ip address>` / `url:port` | IP Address, hostname, or URL of the Patch Server to which the client reports to.                                                         |
| **Optional**                                        |                                                                                                                                          |
| --auth-secret `<secret>`                            | The client authentication secret to use to authenticate with the server. If absent, no authentication will be performed with the server. |
| --proxy `<scheme>://<host>:<port>`                  | The HTTP proxy to use. Has the format `<scheme>://<host>:<port>`. If absent, the system-wide proxy will be used if configured.           |
| --server-guid `<guid>`                              | The Server GUID for your Adaptiva Server. You can find this in the Admin Portal under Settings, Server Activation.                       |
| --tenant-guid `<guid>`                              | The Tenant GUID used in multi-tenant environments.                                                                                       |
| --cloud-tenant-id `<tenant id>`                     | The ID of the cloud tenant in cloud-hosted environments.                                                                                 |
| --system-config `<property>=<value>`                | A system config value to set during setup, and has the following format: `<property>=<value>` This flag may be repeated multiple times.  |
| --skip-firewall-rules                               | Skip the creation of firewall rules.                                                                                                     |
| --skip-connection-checks                            | Skip the post-setup connection checks.                                                                                                   |

**Examples**:

Direct server using an IP address, an HTTP proxy, and a custom system config:

```bash
sudo /opt/adaptiva/adaptivaclient/bin/adaptivactl setup --server 198.50.100.241 --server-guid 1cb07a9e-a88c-4db2-8fe3-2eb7748545d6 --proxy http://198.50.100.3:8080 --system-config onesite.server_message_retry_interval=60
```

Server using cloud relay, hostname, client authentication:

```bash
sudo /opt/adaptiva/adaptivaclient/bin/adaptivactl setup --server adaptivaserver.corp.example --server-guid 1cb07a9e-a88c-4db2-8fe3-2eb7748545d6 --auth-secret 'P@ssw0rd123!'
```

### Restart the Adaptiva client

Use the following command to restart the Adaptiva Client Daemon.

Linux:

```bash
sudo systemctl restart adaptivaclientd
```

macOS:

```zsh
sudo launchctl kickstart -k system/com.adaptiva.clientd
```

### Modify system configuration

The adaptivactl command can also be used to read and write system config values using the config operation.

The following command reads the value of a system config property:

```bash
sudo /opt/adaptiva/adaptivaclient/bin/adaptivactl config get <property>
```

The following command sets the value of a system config property:

```bash
sudo /opt/adaptiva/adaptivaclient/bin/adaptivactl config set <property> <value>
```

## Client upgrade

If you need to upgrade existing cross-platform clients to a newer version manually, perform package upgrades using the commands below. For more information on the supported operating systems, see [Supported Systems](https://docs.adaptiva.com/platform-install/overview/supported-systems). (Replace `<version>` with the appropriate version of the Adaptiva client your are trying to install and `<arch>` with the specific architecture)

{% tabs %}
{% tab title="10.1.972" %}
Debian / Ubuntu:

```bash
sudo apt install ./adaptiva-client-<version>-<arch>.deb
```

AlmaLinux, Amazon Linux, CentOS Stream, Fedora Linux, Oracle Linux, Red Hat Enterprise Linux, Rocky Linux

```bash
sudo dnf upgrade ./adaptiva-client-<version>-1.<arch>.rpm
```

SUSE-Based

```bash
sudo zypper install ./adaptiva-client-<version>-1.suse.<arch>.rpm
```

macOS:

```zsh
sudo installer -tgt / -pkg ./adaptiva-client-<version>-macOS.pkg
```

* Use the following command in macOS to restart the Adaptiva Client Daemon:

  ```zsh
  sudo launchctl kickstart -k system/com.adaptiva.clientd
  ```

{% endtab %}

{% tab title="10.1.971 and below" %}
Debian / Ubuntu:

```bash
sudo apt install ./adaptiva-client-<version>-1.<arch>.deb
```

AlmaLinux, CentOS Stream, Oracle, RHEL, Rocky

```bash
sudo dnf upgrade ./adaptiva-client-<version>-1.el<#>.<arch>.rpm
```

macOS:

```zsh
sudo installer -tgt / -pkg ./adaptiva-client-<version>-macOS.pkg
```

* Use the following command in macOS to restart the Adaptiva Client Daemon:

  ```zsh
  sudo launchctl kickstart -k system/com.adaptiva.clientd
  ```

{% hint style="info" %}
Due to an issue in the 9.2.967 RPM packages, upgrading from 9.2.967 to 9.3.968 or later requires the following commands: `sudo dnf upgrade ./adaptiva-client-9.3.968.19-1.el9.x86_64.rpm` `sudo systemctl enable --now adaptivaclientd.service`
{% endhint %}
{% endtab %}
{% endtabs %}
