At the moment I have 13 Arch Linux ARM SOC devices. Today I learned pacman, as of version 6, supports parallel downloads for updates. By default this option is disabled. Since I uses Open Salt to manage configurations among other things, I decided to write a pair of Salt state files to enable the parallel download feature and to disable it if the need arises. Having the state files will also allow adjustment of how many parallel downloads will be allowed.

If you don’t use Salt to manage Arch linux devices there is probably nothing of interest for you in this post. If you do use Salt, you probably can probably write better state files on your own. The below is simply what I came up with and meet my current threshold for good enough.

Enable Parallel Downloads

{# State to enable parallel downloads for pacman #}
{# Created 2021-6-5 #}

{% if (grains['os'] == 'Arch ARM') %}

{# number of simultaneous downloads, default 5 #}
{% set para_downloads = '5' %}

setParallelDownloads:
  file.replace:
    - name: /etc/pacman.conf
      - pattern: '^#ParallelDownloads = {{para_downloads}}'
      - repl: 'ParallelDownloads = {{para_downloads}}'
      - backup: .bak
      - ignore_if_missing: True

{% endif %}

Disable Parallel Downloads

{# State to disable parallel downloads for pacman #}
{# Created 2021-6-5 #}

{% if (grains['os'] == 'Arch ARM') %}

{# number of simultaneous downloads, default 5 #}
{% set para_downloads = '5' %}

setParallelDownloads:
  file.replace:
    - name: /etc/pacman.conf
      - pattern: '^ParallelDownloads = {{para_downloads}}'
      - repl: '#ParallelDownloads = {{para_downloads}}'
      - backup: .bak
      - ignore_if_missing: True

{% endif %}

References