> For the complete documentation index, see [llms.txt](https://platform9.com/kb/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://platform9.com/kb/generic/solution/hostagent-installation-failed-during-node-onboarding.md).

# Hostagent Installation Failed, 'Unable to lock directory /var/cache/apt/archives'

## Problem

* Hostagent installation failed with the below error.

{% tabs %}
{% tab title="None" %}

```none
Could not get lock /var/cache/apt/archives/lock - open (11: Resource temporarily unavailable)<br>E: Unable to lock directory /var/cache/apt/archives/<br>"}
```

{% endtab %}
{% endtabs %}

* pf9ctl logs show below messages

{% tabs %}
{% tab title="None" %}

```none
{"level":"debug","ts":"2021-04-24T22:48:42.3694Z","caller":"pmk/node.go:216","msg":"Hostagent download completed successfully"}..{"level":"debug","ts":"2021-04-24T22:48:45.8739Z","caller":"pmk/node.go:247","msg":"Ran command sudo[bash -c /tmp/installer.sh --no-proxy --skip-os-check --ntpd --no-project --controller=1618992570-18611.platform9.io --username=smeredith@capturealpha.com --password=Crytime1234!!]"}.{"level":"debug","ts":"2021-04-24T22:48:45.8739Z","caller":"pmk/node.go:247","msg":"stdout:<br>Extracting Platform9 installer<br>No TTY available. Skipping all prompts...<br>No TTY available. Skipping all prompts...<br>Skipping operating system compatibility questions<br>Reading package lists...<br>Building dependency tree...<br>Reading state information...<br>tp is already the newest version (1:4.2.8p10+dfsg-5ubuntu7.3).<br>Error: Could not install the ntp package<br>stderr:E: Could not get lock /var/cache/apt/archives/lock - open (11: Resource temporarily unavailable)<br>E: Unable to lock directory /var/cache/apt/archives/<br>"}.{"level":"debug","ts":"2021-04-24T22:48:45.874Z","caller":"pmk/node.go:48","msg":"Sending Segment Event: Prep-node : ERROR"}
```

{% endtab %}
{% endtabs %}

## Environment

* Platform9 Managed Kubernetes - v4.0 and Higher

## Cause

Not able to get lock on /var/cache/apt/archive directory.

## Resolution

Make sure there are no apt processes running on the node that is being onboarded and then retry the *pf9ctl prep node* command.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://platform9.com/kb/generic/solution/hostagent-installation-failed-during-node-onboarding.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
