Score:0

Cloud-init installing packages on Debian with contrib sources

mn flag

I need to install some zfs packages on Debian instances using cloud-init. One of the packages needs the contrib sources. I can get it to update the sources list, but the packages fail to install. If I remove the contrib source lists, some packages install, just not the ones that need contrib. Kind of a catch 22. Has anyone had success installing zfs and all prerequisites using cloud-init?

Here is what I am using, when I add package_update or preserve_sources_list: true it fails to update the sources.list file. I can't win. lol Thanks!

#cloud-config
locale: en_US.UTF-8
timezone: America/New_York
apt:
  sources_list: | # needed for spl package
    deb $MIRROR $RELEASE bullseye main contrib
    deb-src $MIRROR $RELEASE bullseye main contrib
    deb $MIRROR $RELEASE bullseye-updates main contrib
    deb-src $MIRROR $RELEASE bullseye-updates main contrib
    deb $MIRROR $RELEASE bullseye-security main contrib
    deb-src $MIRROR $RELEASE bullseye-security main contrib
packages:
  - linux-headers-5.10.0-21-amd64
  - linux-image-amd64
  - spl
  - kmod
  - snapd
  - nfs-common
  - htop
  - nano
  - build-essential
  - zfsutils-linux
  - zfs-dkms
  - zfs-zed
runcmd:
  - mkdir /mnt/v-nas
  - mkdir /mnt/home
Score:0
br flag

Your source lines look wrong. On debian bullsye, $RELEASE will be replaced with bullseye.

Therefore this:

deb $MIRROR $RELEASE bullseye main contrib

Should get rendered into your apt list config as:

deb http://some.site.com/ bullseye bullseye main contrib

Is that really supposed to have two bullseye entries?

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.