# Application Update(.deb)

**URL:** <https://hub.mender.io/t/application-update-deb/3284>\
**Category:** Update Modules\
**Tags:** raspberry-pi-3\
**Created:** [March 2, 2021, 6:46am UTC](https://hub.mender.io/t/application-update-deb/3284 "2021-03-02T06:46:27Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sreelatha](https://avatars.discourse-cdn.com/v4/letter/s/3ab097/32.png) [@Sreelatha](https://hub.mender.io/u/Sreelatha)\
**Post date:** [March 2, 2021, 6:46am UTC](https://hub.mender.io/t/application-update-deb/3284/1 "2021-03-02T06:46:28Z")

</div>

Hello,

I am trying to update \*.deb package with a Raspberry Pi3(application update) using mender client. I followed steps mentioned in “[How to update .deb package with a Raspberry Pi 3](https://hub.mender.io/t/how-to-update-deb-package-with-a-raspberry-pi-3/1105/1)” but unfortunately it’s not behaving as expected and it throws an error – “No such file or directory” as mentioned below in highlighted text.

* * *

2021-02-18 11:00:41 +0000 UTC info: Running Mender client version: 2.5.0

2021-02-18 11:00:42 +0000 UTC info: State transition: update-fetch [Download\_Enter] → update-store [Download\_Enter]

2021-02-18 11:00:42 +0000 UTC info: No public key was provided for authenticating the artifact

2021-02-18 11:00:43 +0000 UTC info: State transition: update-store [Download\_Enter] → update-after-store [Download\_Leave]

2021-02-18 11:00:43 +0000 UTC info: State transition: update-after-store [Download\_Leave] → update-install [ArtifactInstall]

2021-02-18 11:00:43 +0000 UTC info: Update module output: dpkg: error: unable to access the dpkg database directory /var/lib/dpkg: No such file or directory

2021-02-18 11:00:43 +0000 UTC error: Update module terminated abnormally: exit status 2

2021-02-18 11:00:43 +0000 UTC error: transient error: Update module terminated abnormally: exit status 2

2021-02-18 11:00:43 +0000 UTC info: State transition: update-install [ArtifactInstall] → update-error [ArtifactFailure]

2021-02-18 11:00:43 +0000 UTC info: State transition: update-error [ArtifactFailure] → cleanup [Error]

2021-02-18 11:00:43 +0000 UTC info: State transition: cleanup [Error] → update-status-report [none]

* * *

\*_application .deb update_

**------------------------------------**

ARTIFACT\_NAME=“my-rasp-update-1.0”

DEVICE\_TYPE=“raspberrypi3”

OUTPUT\_PATH=“my-rasp-update-1.0.mender”

PACKAGES=“weavedconnectd\_1.3-07m\_armhf.deb”

mender-artifact write module-image -T deb -n {ARTIFACT\_NAME} -t {DEVICE\_TYPE} -o {OUTPUT\_PATH} -f (echo “$PACKAGES” | sed -e ‘s/ / -f /g’)

**Changes in local.conf in my build folder**

* * *

PACKAGE\_CLASSES = “package\_deb”

IMAGE\_INSTALL\_append += " apt dpkg "

* * *

With the **local.conf** changes in my build, **/usr/bin** had the dpkg installed, but never generated **/var/lib/dpkg** folder.

To overcome this error “2021-02-18 11:00:43 +0000 UTC info: Update module output: dpkg: error: unable to access the dpkg database directory /var/lib/dpkg: No such file or directory”, I copied the **/var/lib/dpkg** manually to my flashed mender binary. After this change when I try to do an update, previous issue is gone but I encountered different set of issues as highlighted below.

* * *

2021-02-18 17:39:33 +0000 UTC info: Running Mender client version: 2.5.0

2021-02-18 17:39:34 +0000 UTC info: State transition: update-fetch [Download\_Enter] → update-store [Download\_Enter]

2021-02-18 17:39:34 +0000 UTC info: No public key was provided for authenticating the artifact

2021-02-18 17:39:35 +0000 UTC info: State transition: update-store [Download\_Enter] → update-after-store [Download\_Leave]

2021-02-18 17:39:35 +0000 UTC info: State transition: update-after-store [Download\_Leave] → update-install [ArtifactInstall]

2021-02-18 17:39:35 +0000 UTC info: Update module output: Selecting previously unselected package weavedconnectd.

2021-02-18 17:39:36 +0000 UTC info: Update module output: (Reading database … 4865 files and directories currently installed.)

2021-02-18 17:39:36 +0000 UTC info: Update module output: Preparing to unpack …/weavedconnectd\_1.3-07m\_armhf.deb …

2021-02-18 17:39:36 +0000 UTC info: Update module output: Unpacking weavedconnectd (1.3-07m) …

2021-02-18 17:39:36 +0000 UTC info: Update module output: dpkg: error processing archive /var/lib/mender/modules/v3/payloads/0000/tree/files/weavedconnectd\_1.3-07m\_armhf.deb (–install):

2021-02-18 17:39:36 +0000 UTC info: Update module output: unable to clean up mess surrounding ‘./usr/bin/weavedconnectd.pi’ before installing another version: Read-only file systemcd .

2021-02-18 17:39:36 +0000 UTC info: Update module output: dpkg-deb: error: paste subprocess was killed by signal (Broken pipe)

2021-02-18 17:39:36 +0000 UTC info: Update module output: Errors were encountered while processing:

2021-02-18 17:39:36 +0000 UTC info: Update module output: /var/lib/mender/modules/v3/payloads/0000/tree/files/weavedconnectd\_1.3-07m\_armhf.deb

2021-02-18 17:39:36 +0000 UTC error: Update module terminated abnormally: exit status 1

2021-02-18 17:39:36 +0000 UTC error: transient error: Update module terminated abnormally: exit status 1

2021-02-18 17:39:36 +0000 UTC info: State transition: update-install [ArtifactInstall] → update-error [ArtifactFailure]

2021-02-18 17:39:36 +0000 UTC info: State transition: update-error [ArtifactFailure] → cleanup [Error]

2021-02-18 17:39:36 +0000 UTC info: State transition: cleanup [Error] → update-status-report [none]

* * *

Just to ensure if the way of execution is correct, I tried executing the below command(dpkg -i /mnt/mender-client\_2.5.0-1\_armhf.deb) as seen in the attached image “deb\_error.png”. I am just wondering whether I missed any steps that are required for Application update with mender client. It would be great if you could help us in resolving this issue.

 ![deb_error](https://canada1.discourse-cdn.com/flex036/uploads/mender/original/2X/1/1445a715dc5f98eed50252d8731dc0f22485a519.png)

---

<div class="post-metadata">

**Author:** ![drewmoseley](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/drewmoseley/32/47_2.png) [@drewmoseley](https://hub.mender.io/u/drewmoseley)\
**Post date:** [March 2, 2021, 2:42pm UTC](https://hub.mender.io/t/application-update-deb/3284/2 "2021-03-02T14:42:14Z")

</div>

For Yocto builds to include the package management database and utilities actually in your image, you need to add the following to local.conf:

`EXTRA_IMAGE_FEATURES_append = " package-management "`

Without that, you are using deb packages as part of the build process but are unable to manipulate them on the target.

Drew

---

<div class="post-metadata">

**Author:** ![Sreelatha](https://avatars.discourse-cdn.com/v4/letter/s/3ab097/32.png) [@Sreelatha](https://hub.mender.io/u/Sreelatha)\
**Post date:** [March 3, 2021, 5:58pm UTC](https://hub.mender.io/t/application-update-deb/3284/3 "2021-03-03T17:58:42Z")

</div>

Hello Drew ,  
Greetings!  
Thank you for your response.  
After adding `EXTRA\_IMAGE\_FEATURES\_append = " package-management " i was able to see the /var/lib/dpkg folder in my build. The /var/lib/deb problem got resolved, but i still cannot install my dpkg package.  
When i try to deploy the .deb file from the mender hub it failed to execute. Please find the logs below.

2021-03-03 09:11:41 +0000 UTC info: Running Mender client version: 2.5.0  
2021-03-03 09:11:42 +0000 UTC info: State transition: update-fetch [Download\_Enter] → update-store [Download\_Enter]  
2021-03-03 09:11:42 +0000 UTC info: No public key was provided for authenticating the artifact  
2021-03-03 09:11:43 +0000 UTC info: State transition: update-store [Download\_Enter] → update-after-store [Download\_Leave]  
2021-03-03 09:11:43 +0000 UTC info: State transition: update-after-store [Download\_Leave] → update-install [ArtifactInstall]  
2021-03-03 09:11:44 +0000 UTC info: Update module output: Selecting previously unselected package weavedconnectd.  
2021-03-03 09:11:45 +0000 UTC info: Update module output: (Reading database … 5125 files and directories currently installed.)  
2021-03-03 09:11:45 +0000 UTC info: Update module output: Preparing to unpack …/weavedconnectd\_1.3-07m\_armhf.deb …  
2021-03-03 09:11:45 +0000 UTC info: Update module output: Unpacking weavedconnectd (1.3-07m) …  
2021-03-03 09:11:45 +0000 UTC info: Update module output: dpkg: error processing archive /var/lib/mender/modules/v3/payloads/0000/tree/files/weavedconnectd\_1.3-07m\_armhf.deb (–install):  
2021-03-03 09:11:45 +0000 UTC info: Update module output: unable to clean up mess surrounding ‘./usr/bin/weavedconnectd.pi’ before installing another version: Read-only file system  
2021-03-03 09:11:45 +0000 UTC info: Update module output: dpkg-deb: error: paste subprocess was killed by signal (Broken pipe)  
2021-03-03 09:11:46 +0000 UTC info: Update module output: Errors were encountered while processing:  
2021-03-03 09:11:46 +0000 UTC info: Update module output: /var/lib/mender/modules/v3/payloads/0000/tree/files/weavedconnectd\_1.3-07m\_armhf.deb  
2021-03-03 09:11:46 +0000 UTC error: Update module terminated abnormally: exit status 1  
2021-03-03 09:11:46 +0000 UTC error: transient error: Update module terminated abnormally: exit status 1  
2021-03-03 09:11:46 +0000 UTC info: State transition: update-install [ArtifactInstall] → update-error [ArtifactFailure]  
2021-03-03 09:11:46 +0000 UTC info: State transition: update-error [ArtifactFailure] → cleanup [Error]  
2021-03-03 09:11:46 +0000 UTC info: State transition: cleanup [Error] → update-status-report [none]

File used for deployment : **my-rasp-update-1.0.mender** and “weavedconnectd\_1.3-07m\_armhf.deb” was part of the “my-rasp-update-1.0.mender”

Please help me resolving this issue.

Best Regards  
Sreelatha

---

<div class="post-metadata">

**Author:** ![drewmoseley](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/drewmoseley/32/47_2.png) [@drewmoseley](https://hub.mender.io/u/drewmoseley)\
**Post date:** [March 3, 2021, 6:14pm UTC](https://hub.mender.io/t/application-update-deb/3284/4 "2021-03-03T18:14:26Z")

</div>

It seems that your root filesystem is mounted in read-only mode:

> 2021-03-03 09:11:45 +0000 UTC info: Update module output: unable to clean up mess surrounding ‘./usr/bin/weavedconnectd.pi’ before installing another version: Read-only file system

You can also manually copy the deb file and try to install with `dpkg --install` to see if there is any additional output from that.

---

<div class="post-metadata">

**Author:** ![Sreelatha](https://avatars.discourse-cdn.com/v4/letter/s/3ab097/32.png) [@Sreelatha](https://hub.mender.io/u/Sreelatha)\
**Post date:** [March 4, 2021, 12:26pm UTC](https://hub.mender.io/t/application-update-deb/3284/5 "2021-03-04T12:26:17Z")

</div>

Hello Drew,  
I manually copied the “weavedconnectd\_1.3-07m\_armhf.deb” to the /data folder. I see the same behavior. As i understand based on the settings while creating the \*.deb the installation will happen in those respective folders and if those folders are part of readonly filesystem then the same error would occur. One way as i understand is to mount these respective folders to the writable partition. Is my understanding correct or you have any better suggestion.

Best Regards  
Sreelatha

---

<div class="post-metadata">

**Author:** ![drewmoseley](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/drewmoseley/32/47_2.png) [@drewmoseley](https://hub.mender.io/u/drewmoseley)\
**Post date:** [March 4, 2021, 2:17pm UTC](https://hub.mender.io/t/application-update-deb/3284/6 "2021-03-04T14:17:49Z")

</div>

Yes, if you try to install and the package has files that would go into a read-only filesystem it will fail.

You can remount the root filesystem as read/write:

> sudo mount -o remount,rw /

but note that if you have it set to read-only to be able to use binary-delta updates, this workflow will break that.

---

<div class="post-metadata">

**Author:** ![Sreelatha](https://avatars.discourse-cdn.com/v4/letter/s/3ab097/32.png) [@Sreelatha](https://hub.mender.io/u/Sreelatha)\
**Post date:** [March 4, 2021, 4:36pm UTC](https://hub.mender.io/t/application-update-deb/3284/7 "2021-03-04T16:36:16Z")

</div>

Thank you for clarifying.

Best Regards  
Sreelatha

---

<div class="post-metadata">

**Author:** ![Sreelatha](https://avatars.discourse-cdn.com/v4/letter/s/3ab097/32.png) [@Sreelatha](https://hub.mender.io/u/Sreelatha)\
**Post date:** [March 5, 2021, 2:00pm UTC](https://hub.mender.io/t/application-update-deb/3284/8 "2021-03-05T14:00:28Z")

</div>

Hello Drew,  
As per your above comment does mender support all the update strategies (delta updates, application updates(.deb), single file updates and A/B updates) in one binary or are each targeted for different binaries?

Best Regards  
Sreelatha

---

<div class="post-metadata">

**Author:** ![drewmoseley](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/drewmoseley/32/47_2.png) [@drewmoseley](https://hub.mender.io/u/drewmoseley)\
**Post date:** [March 5, 2021, 2:55pm UTC](https://hub.mender.io/t/application-update-deb/3284/9 "2021-03-05T14:55:10Z")

</div>

@Sreelatha each Mender artifact contains a specific payload type. That could be a delta update blob, a full partition image or a debian package.

---

<div class="post-metadata">

**Author:** ![Sreelatha](https://avatars.discourse-cdn.com/v4/letter/s/3ab097/32.png) [@Sreelatha](https://hub.mender.io/u/Sreelatha)\
**Post date:** [March 12, 2021, 11:51am UTC](https://hub.mender.io/t/application-update-deb/3284/10 "2021-03-12T11:51:34Z")

</div>

Hello Drew,  
Can mender client handle all the strategies( delta, application update(.deb), single file and A/B updates) at a time in one single binary?

Best Regards  
Sreelatha

---

<div class="post-metadata">

**Author:** ![drewmoseley](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/drewmoseley/32/47_2.png) [@drewmoseley](https://hub.mender.io/u/drewmoseley)\
**Post date:** [March 16, 2021, 3:14pm UTC](https://hub.mender.io/t/application-update-deb/3284/11 "2021-03-16T15:14:52Z")

</div>

No. The artifact has an embedded type associated with it and each artifact binary contains a single type.

---

<div class="post-metadata">

**Author:** ![hemalbavishi](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/hemalbavishi/32/938_2.png) [@hemalbavishi](https://hub.mender.io/u/hemalbavishi)\
**Post date:** [March 17, 2021, 7:14am UTC](https://hub.mender.io/t/application-update-deb/3284/12 "2021-03-17T07:14:43Z")

</div>

Hello Drew,

Thank you for your quick response. Let me slightly rephrase the question.

We understand that mendor supports all different strategies i.e. memory A/B, Delta Update, Application Application (\*.dpkg) and file update. However, at a given point of time only one strategy can be applied as each artefacts can be mapped to embedded type associate with it. Does it mean that I can use all the strategies but one after another?

We also observed that Memory A/B and Partial Update makes rootfs to be “readonly” but how about Application Update and File Update? In case of an Application Update, new package will be installed in the current active partition so how “readonly” properties of rootfs is handled in case of Application Update and File Update.

Best Regards,  
Hemal Bavishi

---

<div class="post-metadata">

**Author:** ![drewmoseley](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/drewmoseley/32/47_2.png) [@drewmoseley](https://hub.mender.io/u/drewmoseley)\
**Post date:** [March 17, 2021, 5:52pm UTC](https://hub.mender.io/t/application-update-deb/3284/13 "2021-03-17T17:52:05Z")

</div>

If your root filesystem is readonly then you will indeed be unable to do application or file updates.

I’m not sure what you mean that ‘Memory A/B and Partial Update makes rootfs to be “readonly”’. That should not be the case. Doing an A/B update should not change your rootfs to be readonly.

Now, if you are referring to [robust binary delta updates](https://hub.mender.io/t/robust-delta-update-rootfs/1144/10), then indeed it is required that the root filesystem be readonly. This is to ensure that the contents of the filesystem have not changed. If it _has_ changed, then you will not be able to apply the binary delta. This does imply that you cannot use application or file updates in a system that _also_ uses binary delta updates.

Drew
