Hello again - I’m trying to get flox installed in my vms using a cloud-init script (on Ubuntu, if that matters). If I add the apt source for flox (I get it by installing using the flox documentation then looking for the apt source), and try to install flox with apt install flox, I get an error that flox is an unknown package. Thanks for any pointers - I’m testing a brute force approach using runcmd in my cloud-init, but I was hoping for a kinder, gentler approach
Hej
On macos, so only verified in a docker container.
This should get you going:
# optional if you don't have wget,curl,or something similar yet
apt update
apt install wget
# get the public key for apt source verification
# and store it in /usr/share/keyrings
wget -P /usr/share/keyrings https://downloads.flox.dev/by-env/stable/deb/flox-archive-keyring.gpg
# add the debian source
echo 'deb [signed-by=/usr/share/keyrings/flox-archive-keyring.gpg] https://downloads.flox.dev/by-env/stable/deb stable/' > /etc/apt/sources.list.d/flox.list
# update apt
apt update
# install flox
apt install flox
According to @bryanhonof for cloud knit you’re looking for something like this:
# optional if you don't have wget,curl,or something similar yet
sudo apt-get --yes update
sudo apt-get --yes install wget
# get the public key for apt source verification
# and store it in /usr/share/keyrings
sudo wget -P /etc/apt/trusted.gpg.d/ https://downloads.flox.dev/by-env/stable/deb/flox-archive-keyring.gpg
# add the debian source
sudo sh -c "echo 'deb [signed-by=/etc/apt/trusted.gpg.d/flox-archive-keyring.gpg] https://downloads.flox.dev/by-env/stable/deb stable/' > /etc/apt/sources.list.d/flox.list"
# update apt
sudo apt-get --yes update
# install flox
sudo apt-get --yes install flox
Hej ysndr - let me give that a try. I essentially did the same thing. I bet the “apt update” step is what i neglected. If this works, then I can figure out the cloud-init setting to get the debian source set up declaratively, then it’s just a matter of adding “flox” to the list of packages.
I played around with it a little. This seems to work on an AWS EC2 Ubuntu node.
#cloud-config
packages:
- flox
apt:
sources:
flox:
source: deb https://downloads.flox.dev/by-env/stable/deb stable/
key: |
-----BEGIN PGP PUBLIC KEY BLOCK-----
mQINBGYe0uIBEADOgCsu4c/lyI5lzQuA40Wxx9sAXISowndMaqTRA8RglCqzDfzF
sEIk6o+Bb7o2Wtzs3CISMA4cpyNjtKaPIRiB1o96sS1L5kIEujqj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9Jdz98xjQHF6
4sAR806ncQyS0l8i9TAbP4kAJbbV5qsgDoVej5n7ABEBAAGJAjwEGAEIACYWIQTY
nufWihuiH0v5qPUXxK55e4Gb9AUCZh7S4gIbDAUJA8JnAAAKCRAXxK55e4Gb9CtP
EADDRrjTg+v/Xtckxs3AxKLOPMWMmlbiqzkrAwBKHn0a/IaSPKeEbddVfzVNPLwq
RcHgi910xJ/O2EMgdYnFDi/RHU2AbLN8XAO0q5a6Pb3iso8HnDa52bSYnz4yQboB
MMbF6dkX9rbUMYkS/C0CYjrW7swSDW2Z5glwQwYxWCKhEJdWs1gB6iom8/LprUU6
68iD2KJ9PcjzkmPhFwfdkm9Pz2wJwYyUkOUCdSyPLH6fTYs7OYNyt07MYrzwdFQK
d27VelZmMXGg9YTSxx77Wa72uq4qzexyIW8KwBgEYDwfzrWjvNL3GFT7nz2OuAib
mIIP/gpB1uujf8SJVuRH2JwRxaXDRatr5W9K3W/VwJou02Sp4yzh38YosTUrDzPJ
FPWJjM1+oAPVzo7IT7gUrioE4F208etFMeRGgOWtgvzahW0bn2XLxS73bzbKxs/f
HU+sTfoIH5ozk8HIIU5xELsDe2oRGJcT5iJ66m9A6NQQutPl/1q55LNGhk4CK8bH
32j92l07ROSZj4ogYMOs/wynb41fkx5ZhMWi7unkja7YYkexTqT6Y4/8aqRwY4kJ
nqr4vYUltKLOYkGpZMVzO8IOAP098LQi+A1+k6S8aLM18qrgfhqRJeKw2aWTRRUK
plSnjv2x08dDTJMTVNPQ/DPL6NjtzGUhZz7uygcTIxoJyA==
=b566
-----END PGP PUBLIC KEY BLOCK-----
Bryan - bingo!
I think my issue with the manual testing was that I didn’t run the apt update after setting up the repo. This works fantastically
In case it’s useful to anyone, here’s where I ended up on my config. It’s a full set of dotfiles & etc. https://github.com/johnstegeman/dotfiles. The function that creates a Linux vm using clout-init is at https://github.com/johnstegeman/dotfiles/blob/main/dot_zsh_custom/config-file/functions/mcreate.tmpl
update: I also did a quick update of the readme and other docs in my repo, so it’s a little clearer which things I manage with homebrew/zinit/flox. My basic philosophy is to use zinit where possible, then flox if not possible, then homebrew/apt/scripts for the remainder. I did bump some things out of flox because when installing, it took up more disk space than I was willing to give up (an issue on my Linux vms where disk space is pretty small)