---
title: Update the infrastructure agent
source: https://docs.newrelic.com/docs/infrastructure/infrastructure-agent/update-or-uninstall/update-infrastructure-agent
---

If you need to install the infrastructure agent for the first time, see the installation docs for [Linux](https://docs.newrelic.com/docs/infrastructure-install-amazon-linux-centos-debian-rhel-or-ubuntu), [Windows](https://docs.newrelic.com/docs/infrastructure-install-windows-server), or [configuration management tools](https://docs.newrelic.com/docs/infrastructure/new-relic-infrastructure/config-management-tools).

If you need to uninstall the infrastructure agent, see [Uninstall the infrastructure agent](https://docs.newrelic.com/docs/agents/manage-apm-agents/installation/uninstall-agent).

## Identify the infrastructure agent version [#version]

The infrastructure agent doesn't update itself automatically. To see if you have the latest agent version, see the [infrastructure agent release notes](https://docs.newrelic.com/docs/release-notes/infrastructure-release-notes/infrastructure-agent-release-notes).

To view the current infrastructure agent version for a host in the New Relic UI, use any of these options:

-   Single hosts: See the `agentVersion` tag on any [host entity](https://docs.newrelic.com/docs/new-relic-solutions/new-relic-one/core-concepts/what-entity-new-relic/#find), or look for its `Agent version` in the **Infrastructure** UI.
-   Multiple hosts: Go to **Infrastructure > Navigator** and group reporting entities by `agentVersion` to see a list of active hosts per version.
-   Query: Use the `agentVersion` attribute on any standard agent metric to generate a report. For example, the following NRQL query shows number of unique active hosts group by agent version:
    ```sql
    FROM SystemSample SELECT uniqueCount(hostname) 
    FACET agentVersion 
    LIMIT MAX
    ```

To manually check the version on the host, you can log onto a server and run `newrelic-infra --version`, or the applicable command for your package manager. The directory where you'd run this differs between operating systems, but here are the default paths:

-   Linux: `/usr/bin/newrelic-infra`
-   Windows: `C:\Program Files\New Relic\newrelic-infra\`
-   macOS: `/usr/local/bin/newrelic-infra`

## Identify outdated agent versions from the UI [#check-version]

You'll first need to determine the latest version available from the agent [release notes](https://docs.newrelic.com/docs/release-notes/infrastructure-release-notes/infrastructure-agent-release-notes), we recommend running versions that are no older than three months when possible.

To identify active hosts that are running a version that's older than a given `major.minor` (for example, `1.45.0`), you can run this NRQL query:

```sql
FROM SystemSample 
SELECT uniques(hostname) 
WHERE numeric(capture(agentVersion, '(?P<major>.[0-9]*).([0-9]*).([0-9]*)')) <= 1 
AND numeric(capture(agentVersion, '([0-9]*).(?P<minor>.[0-9]*).([0-9]*)')) <= 45
LIMIT MAX
```

## Update the agent for installs using the package manager [#update]

If you used the default installation process, use your package manager to update the program and its dependencies to the latest version. Here are examples for some common systems:

**Update using apt (Debian, Ubuntu)**

To manually update the infrastructure agent with `apt-get`:

````shell
sudo apt-get update && sudo apt-get install --only-upgrade newrelic-infra -y
```

````

**Update using yum (Amazon Linux, CentOS, RHEL)**

To manually update the infrastructure agent with yum:

````shell
sudo yum update newrelic-infra -y
```

After updating you may need to [start the agent](/docs/infrastructure/new-relic-infrastructure/configuration/start-stop-restart-check-infrastructure-agent-status#linux).

````

**Update using Zypper (SLES)**

To manually update the infrastructure agent with Zypper:

````shell
sudo zypper -n update newrelic-infra
```

After updating you may need to [start the agent](/docs/infrastructure/new-relic-infrastructure/configuration/start-stop-restart-check-infrastructure-agent-status#linux).

````

**Update on Windows Server (64 bits)**

To manually update the infrastructure agent on Windows Server:

1.  Download the latest .MSI installer image from [download.newrelic.com/infrastructure_agent/windows/newrelic-infra.msi](https://download.newrelic.com/infrastructure_agent/windows/newrelic-infra.msi)
2.  Run the install script. To install from the Windows command prompt, run:

    ```shell
    msiexec.exe /qn /i PATH\TO\newrelic-infra.msi
    ```

    After updating you may need to [start the agent](https://docs.newrelic.com/docs/infrastructure/new-relic-infrastructure/configuration/start-stop-restart-check-infrastructure-agent-status#windows).

**Update on macOS**

To manually update the infrastructure agent on macOS, open the terminal and run the following commands:

1.  Stop the service (if already running):
    ```shell
    brew services stop newrelic-infra-agent
    ```

2.  Update the agent:
    ```shell
    brew upgrade newrelic-infra-agent
    ```

**Update with config management tools**

To update the infrastructure agent using your configuration management tool, see the documentation for your tool:

-   [![Ansible](https://docs.newrelic.com/images/os_icon_ansible-red.webp "Ansible")Configure with Ansible](https://docs.newrelic.com/docs/infrastructure/new-relic-infrastructure/config-management-tools/configure-new-relic-infrastructure-using-ansible)
-   [![Chef](https://docs.newrelic.com/images/os_icon_chef.webp "Chef")Configure with Chef](https://docs.newrelic.com/docs/infrastructure/new-relic-infrastructure/config-management-tools/configure-new-relic-infrastructure-using-chef)
-   ![EBS](https://docs.newrelic.com/images/os_icon_ebs.webp "EBS")[Configure with AWS Elastic Beanstalk](https://docs.newrelic.com/docs/infrastructure/install-infrastructure-agent/config-management-tools/install-infrastructure-agent-aws-elastic-beanstalk)
-   [![Puppet](https://docs.newrelic.com/images/os_icon_puppet.webp "Puppet")Configure with Puppet](https://docs.newrelic.com/docs/infrastructure/new-relic-infrastructure/config-management-tools/configure-new-relic-infrastructure-puppet)

## Update the agent for assisted and manual tarball installs [#tarball]

> #### ⚠️ IMPORTANT
>
> Since there are are no automated scripts, old files may remain when you update. Be sure to manually remove outdated files.

To update the agent, download the file again and follow the installation procedure for Linux ([assisted](https://docs.newrelic.com/docs/infrastructure/install-configure-infrastructure/linux-installation/assisted-install-infrastructure-linux) or [manual](https://docs.newrelic.com/docs/infrastructure/install-configure-infrastructure/linux-installation/manual-install-infrastructure-linux)) or Windows ([assisted](https://docs.newrelic.com/docs/infrastructure/install-configure-infrastructure/windows-installation/assisted-install-infrastructure-windows) or [manual](https://docs.newrelic.com/docs/infrastructure/install-configure-infrastructure/windows-installation/manual-install-infrastructure-windows)). This will overwrite your old installation.

## Update the containerized version of the agent [#docker]

Use the `latest` label to ensure that [our Docker image](https://docs.newrelic.com/docs/infrastructure/install-infrastructure-agent/linux-installation/docker-container-infrastructure-monitoring) is automatically updated.
