# Deb packages

**URL:** <https://hub.mender.io/t/deb-packages/326>\
**Category:** Update Modules\
**Created:** [March 12, 2019, 8:59am UTC](https://hub.mender.io/t/deb-packages/326 "2019-03-12T08:59:23Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![lluiscampos](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/lluiscampos/32/112_2.png) [@lluiscampos](https://hub.mender.io/u/lluiscampos)\
**Post date:** [March 12, 2019, 8:59am UTC](https://hub.mender.io/t/deb-packages/326/1 "2019-03-12T08:59:23Z")

</div>

### Description

The Deb Update Module updates software on the device using the native local package manager.

A Mender Artifact containing one or more software packages is sent to the device, where the Update Module will call the package manager to install them in alphabetical order.

### Specification

| | |
| --- | --- |
| Module name | deb |
| Supports rollback | no |
| Requires restart | no |
| Artifact generation script | no |
| Full operating system updater | no |
| Source code | [Update Module](https://github.com/mendersoftware/mender-update-modules/tree/master/deb/module/deb) |
| Maintainer | Community |

## Prepare the device

This section describes how to setup your target device, i.e. the device to be updated. This will also be referred to as the device environment.

All commands outlined in this section should be run in the device environment.

### Prerequisites

This update module has the following prerequisites for the device environment:

- [Install the Mender client](https://docs.mender.io/client-installation/install-with-debian-package), version 2.0 or later

### Install the Update Module

Download the latest version of this Update Module by running:

```bash
mkdir -p /usr/share/mender/modules/v3 && wget -P /usr/share/mender/modules/v3 https://raw.githubusercontent.com/mendersoftware/mender-update-modules/master/deb/module/deb

```

## Prepare the development environment on your workstation

This section describes how to set up your development environment on your workstation.

All commands outlined in this section should be run in the development environment.

### Prerequisites

This Update Modules has the following prerequisites for the development environment:

- [Install mender-artifact](https://docs.mender.io/downloads), version 3.1.0 or later

### Create Mender Artifacts

The Artifact can be generated using the `mender-artifact` tool.

Now generate a Mender Artifact using the following command:

```bash
ARTIFACT_NAME="my-update-1.0"
DEVICE_TYPE="my-device-type"
OUTPUT_PATH="my-update-1.0.mender"
PACKAGES="my-package-1.deb my-package-2.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')

```

- `ARTIFACT_NAME` - The name of the Mender Artifact
- `DEVICE_TYPE` - The compatible device type of this Mender Artifact
- `OUTPUT_PATH` - The path where to place the output Mender Artifact. This should always have a `.mender` suffix
- `PACKAGES` - List of all .deb packages to be contained in the Artifact.

You can either deploy this Artifact in managed mode with the Mender server (upload it under Releases in the server UI) or by using the Mender client only in [Standalone deployments](https://docs.mender.io/artifact-creation/standalone-deployment).

### Artifact technical details

The Mender Artifact used by this Update Module has a payload with as many files as software packages we are contained in the Artifact.

The Mender Artifact contents will look like:

```bash
Updates:
  - Type: deb
    Provides:
      rootfs-image.deb.version: my-update-1.0
    Depends: {}
    Clears Provides: [rootfs-image.deb.*]
    Metadata: {}
    Files:
      - checksum: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
        modified: 2024-11-07 12:00:03 +0100 CET
        name: my-package-1.deb
        size: 0
      - checksum: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
        modified: 2024-11-07 12:00:03 +0100 CET
        name: my-package-2.deb
        size: 0

```

---

<div class="post-metadata">

**Author:** ![mladen.miljic](https://avatars.discourse-cdn.com/v4/letter/m/f04885/32.png) [@mladen.miljic](https://hub.mender.io/u/mladen.miljic)\
**Post date:** [February 10, 2020, 8:41am UTC](https://hub.mender.io/t/deb-packages/326/2 "2020-02-10T08:41:59Z")

</div>

Thanks for that.

What is the best way to run sudo apt —fix-broken-install on the remote client?

---

<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:** [February 10, 2020, 5:47pm UTC](https://hub.mender.io/t/deb-packages/326/3 "2020-02-10T17:47:50Z")

</div>

Hi @mladen.miljic, you can always ssh into the device and run the command manually. Alternatively you can setup a [state script](https://docs.mender.io/artifacts/state-scripts) to run that. Depending on your needs a preinstall or a postinstall script might be the best choice.  
Drew

---

<div class="post-metadata">

**Author:** ![ikkysleepy](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/ikkysleepy/32/156_2.png) [@ikkysleepy](https://hub.mender.io/u/ikkysleepy)\
**Post date:** [February 18, 2020, 8:15pm UTC](https://hub.mender.io/t/deb-packages/326/4 "2020-02-18T20:15:51Z")

</div>

So this will install all the packages in the artifact as oppose to using the mender script to install the artifact in the new partition and switch over? So kind of like an apt-get update for your embedded os? I am assuming this takes care of kernel and system level files and patches?

---

<div class="post-metadata">

**Author:** ![mirzak](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/mirzak/32/2056_2.png) [@mirzak](https://hub.mender.io/u/mirzak)\
**Post date:** [March 3, 2020, 1:21pm UTC](https://hub.mender.io/t/deb-packages/326/5 "2020-03-03T13:21:17Z")

</div>

2 posts were split to a new topic: [Are state scripts available for mender standalone artifact updates?](https://hub.mender.io/t/are-state-scripts-available-for-mender-standalone-artifact-updates/1597)

---

<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:** [February 19, 2020, 3:10pm UTC](https://hub.mender.io/t/deb-packages/326/7 "2020-02-19T15:10:24Z")

</div>

Yes, this particular implementation simply installs into the active root filesystem. You have to be careful with kernel updates this way to make sure the files are put in the same location as is expected by the Mender bootloader logic but otherwise it should work. You will need an explicit reboot in that case.

---

<div class="post-metadata">

**Author:** ![ikkysleepy](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/ikkysleepy/32/156_2.png) [@ikkysleepy](https://hub.mender.io/u/ikkysleepy)\
**Post date:** [February 20, 2020, 6:40pm UTC](https://hub.mender.io/t/deb-packages/326/8 "2020-02-20T18:40:03Z")

</div>

> [@Are state scripts available for mender standalone artifact updates?](https://hub.mender.io/t/are-state-scripts-available-for-mender-standalone-artifact-updates/1597/1):
>
> > [@Are state scripts available for mender standalone artifact updates?](https://hub.mender.io/t/are-state-scripts-available-for-mender-standalone-artifact-updates/1597/1):
> >
> > Are state scripts available for mender standalone artifact updates?
> 
> Since Mender 2.0.0, some [state scripts](https://docs.mender.io/2.3/artifacts/state-scripts#standalone-mode) (not all) can run in standalone mode.

Thanks. I noticed the Download Leave was not available but I was able to use the ArtifactInstall\_Enter to run the script to save the SSH Keys. I am not sure why the output show as ERR when there wasn’t any errors, but the scripts seems to work.

---

<div class="post-metadata">

**Author:** ![mladen.miljic](https://avatars.discourse-cdn.com/v4/letter/m/f04885/32.png) [@mladen.miljic](https://hub.mender.io/u/mladen.miljic)\
**Post date:** [March 11, 2020, 3:43pm UTC](https://hub.mender.io/t/deb-packages/326/9 "2020-03-11T15:43:18Z")

</div>

Hi @drewmoseley,  
thanks a lot fore the reply.

I understand, the update module will call: dpkg -i [package…deb]

For me, that ends for in manual handling to resolve dependencies.  
What is the reason you decided to go with `dpkg -i ./name.deb` instead of `apt install ./name.deb`  
(the apt install does actually do `dpkg -i ./name.deb` and then `apt-get install -f` which resolves the dependencies.

---

<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 11, 2020, 7:15pm UTC](https://hub.mender.io/t/deb-packages/326/10 "2020-03-11T19:15:33Z")

</div>

This is really intended as a reference implementation and not necessarily as the best way to do this for any use case. We don’t really want to rely on external package repositories with this reference implementation since that basically cedes control of the software contents to the provider of the external repo.

You could certainly implement an apt based update module and I think it would be a good reference implementation here on Mender hub.

Drew

---

<div class="post-metadata">

**Author:** ![TheYoctoJester](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/theyoctojester/32/1444_2.png) [@TheYoctoJester](https://hub.mender.io/u/TheYoctoJester)\
**Post date:** [September 2, 2025, 7:00am UTC](https://hub.mender.io/t/deb-packages/326/11 "2025-09-02T07:00:16Z")

</div>

A post was split to a new topic: [Updating OpenSSL via Debian package](https://hub.mender.io/t/updating-openssl-via-debian-package/7982)
