# Update app by calling CLI from application

**URL:** <https://mangoh.discourse.group/t/update-app-by-calling-cli-from-application/2917>\
**Category:** Uncategorized\
**Created:** [September 18, 2019, 6:59am UTC](https://mangoh.discourse.group/t/update-app-by-calling-cli-from-application/2917 "2019-09-18T06:59:05Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gokulnath](https://avatars.discourse-cdn.com/v4/letter/g/ecc23a/32.png) [@Gokulnath](https://mangoh.discourse.group/u/Gokulnath)\
**Post date:** [September 18, 2019, 6:59am UTC](https://mangoh.discourse.group/t/update-app-by-calling-cli-from-application/2917/1 "2019-09-18T06:59:05Z")

</div>

How to call update Filename from Legato application to install another app. For instance, system(update --filename)?

---

<div class="post-metadata">

**Author:** ![dfrey](https://sea2.discourse-cdn.com/flex016/user_avatar/mangoh.discourse.group/dfrey/32/303_2.png) [@dfrey](https://mangoh.discourse.group/u/dfrey)\
**Post date:** [September 18, 2019, 4:54pm UTC](https://mangoh.discourse.group/t/update-app-by-calling-cli-from-application/2917/2 "2019-09-18T16:54:05Z")

</div>

If I understand correctly, you want one app to install or update another app.

`system()` is always the wrong solution. A better solution is to use the `le_update.api` as described in the [Legato documentation of the `le_update` API](https://docs.legato.io/latest/c_update.html).

The sample code shows an update via stdin, but you could just as easily use a file descriptor obtained using `open()`.
