# Error could not read configuration file /var/lib/elastic-agent/elastic-agent.yml

**URL:** <https://discuss.elastic.co/t/error-could-not-read-configuration-file-var-lib-elastic-agent-elastic-agent-yml/307612>\
**Category:** Elasticsearch\
**Tags:** fleet\
**Created:** [June 20, 2022, 7:06am UTC](https://discuss.elastic.co/t/error-could-not-read-configuration-file-var-lib-elastic-agent-elastic-agent-yml/307612 "2022-06-20T07:06:28Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![alipujaistopo](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/alipujaistopo/32/50791_2.png) [@alipujaistopo](https://discuss.elastic.co/u/alipujaistopo)\
**Post date:** [June 20, 2022, 7:06am UTC](https://discuss.elastic.co/t/error-could-not-read-configuration-file-var-lib-elastic-agent-elastic-agent-yml/307612/1 "2022-06-20T07:06:28Z")

</div>

how to install elastic-agent properly in centos? i just installed using rpm in my host is fine. and when i want to enroll in other agent has an error `could not read configuration file /var/lib/elastic-agent/elastic-agent.yml`

and what's the difference elastic-agent.yml in **/var/lib/elastic-agent/** and **/etc/elastic-agent** /?

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 18, 2022, 7:06am UTC](https://discuss.elastic.co/t/error-could-not-read-configuration-file-var-lib-elastic-agent-elastic-agent-yml/307612/2 "2022-07-18T07:06:57Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
