Skip to content

Instantly share code, notes, and snippets.

@mckees
Last active September 25, 2023 20:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mckees/647fe21d04764edbf1b62f50a8496fdc to your computer and use it in GitHub Desktop.
Save mckees/647fe21d04764edbf1b62f50a8496fdc to your computer and use it in GitHub Desktop.
Tell Packer to use your URL for /etc/apt/sources.list

Give Packer custom URL for sources.list

Packer seems to overwrite /etc/apt/sources.list.

Add the following to packer-maas/ubuntu/user-data-<whatever>:

apt:
  primary:
    - arches: [default]
      uri: <URL for sources.list>

Then change the file around with sed if you need to change things:

  - sed -i '/lunar-updates/d' etc/apt/sources.list
  - sed -i '/lunar-backports/d' etc/apt/sources.list
  - sed -i '/lunar-security/d' etc/apt/sources.list
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment