0

I have my preseed almost working like I would like but for some reason, I can't have those two repositories added to the source.list file. It's always commented out that it can't verify them.

I know I could put them in a late_command script, but I would really like having them in the cfg file.

d-i mirror/country string manual
d-i mirror/http/hostname string http.us.debian.org
d-i mirror/http/directory string /debian
d-i mirror/http/proxy string http://xxx.xxx.xxx.xxx:xxxxx

## Setup GITLAB-MULTI-CI-RUNNER
d-i apt-setup/local0/repository string deb https://packages.gitlab.com/runner/gitlab-ci-multi-runner/debian/ stretch main
d-i apt-setup/local0/source boolean true
d-i apt-setup/local0/key string https://packages.gitlab.com/runner/gitlab-runner/gpgkey

## Setup DOCKER
d-i apt-setup/local1/repository string deb [arch=amd64] https://download.docker.com/linux/debian stretch stable
d-i apt-setup/local1/source boolean false
d-i apt-setup/local1/key string https://download.docker.com/linux/debian/gpg

d-i debian-installer/allow_unauthenticated boolean true

Is there some d-i line that I'm missing or it's just plain impossible that way?

2
  • did you ever resolve this? Commented Aug 20, 2020 at 13:44
  • @cgmckeever 4 years later and its still depressing that Debian simply don't care about the fact https is everywhere in the 21st century. It can be done but you have to do it in a very messy hacky way in preseed/late_command Commented Aug 4, 2021 at 20:30

2 Answers 2

0

I seem to have run into the exact same issue, at least with the docker repository. I think it has something to do with the fact that it uses https instead of http as transport. The preseed installer fails to verify the repository because either apt-transport-https or ca-certificates (or both) are not installed by default, and thus it comments out those lines in /etc/apt/sources.list.

In my case I managed to solve the issue by installing the necessary packages and then using a late_command to enable the repo post-install.

d-i pkgsel/include string ca-certificates apt-transport-https

and

d-i preseed/late_command string in-target sed -i 's/^#deb https:/deb https:/g' /etc/apt/sources.list

I do agree with you that this is something of a hack, but it's the best I could come up with.

1
  • If you are uncommenting the docker repository with the late command, do you then have to do some magic to install docker? Or are you just manually doing post install now that its available via apt? Commented Aug 20, 2020 at 12:57
0

Installing Docker CE Engine Official via Preseed.cfg

Note: If you already have other repos configured update the 'local0' to the next sequential number eg. 'local1' up till 'local9'

Configuration Keyring & Repo

Debian 13

d-i apt-setup/local0/repository string \
   https://download.docker.com/linux/debian trixie stable
d-i apt-setup/local0/comment string Docker CE Repository
d-i apt-setup/local0/source boolean false
d-i apt-setup/local0/key string https://download.docker.com/linux/debian/gpg

Debian 12

d-i apt-setup/local0/repository string \
   https://download.docker.com/linux/debian bookworm stable
d-i apt-setup/local0/comment string Docker CE Repository
d-i apt-setup/local0/source boolean false
d-i apt-setup/local0/key string https://download.docker.com/linux/debian/gpg

Debian 11

d-i apt-setup/local0/repository string \
   https://download.docker.com/linux/debian bullseye stable
d-i apt-setup/local0/comment string Docker CE Repository
d-i apt-setup/local0/source boolean false
d-i apt-setup/local0/key string https://download.docker.com/linux/debian/gpg

Debian 10

d-i apt-setup/local0/repository string \
   https://download.docker.com/linux/debian buster stable
d-i apt-setup/local0/comment string Docker CE Repository
d-i apt-setup/local0/source boolean false
d-i apt-setup/local0/key string https://download.docker.com/linux/debian/gpg

Debian 9

d-i apt-setup/local0/repository string \
   https://download.docker.com/linux/debian stretch stable
d-i apt-setup/local0/comment string Docker CE Repository
d-i apt-setup/local0/source boolean false
d-i apt-setup/local0/key string https://download.docker.com/linux/debian/gpg

Package Installation

This allows you to install docker via the package select

d0-i pkgsel/include string \
  sudo \
  vim \
  curl \
  wget \
  ca-certificates \
  gnupg \
  lsb-release \
  apt-transport-https \
  docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
New contributor
FRaccie is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.