Thursday, May 9, 2024
 Popular · Latest · Hot · Upcoming
1
rated 0 times [  1] [ 0]  / answers: 1 / hits: 754  / 2 Years ago, thu, february 17, 2022, 8:16:00

I have my own ISO based on Ubuntu 22.04 that I generated myself. Here is my Autoinstall -


#cloud-config
autoinstall:
version: 1
identity:
hostname: foo-ubuntu
password: "ToReplace"
username: abcabc
source:
id: ubuntu-server-minimal
early-commands:
- cat /cdrom/casper/install-sources.yaml | awk 'NR>1 && /^-/{exit};1' > /run/my-sources.yaml
- mount -o ro,bind /run/my-sources.yaml /cdrom/casper/install-sources.yaml
late-commands:
- cp -r /cdrom/copy_to_iso/ /target/opt/
user-data:
runcmd:
- |
mkdir -vp /opt/INIT/
mv -v /opt/copy_to_iso/upgrade_or_install_packages/ /opt/
mv -v /opt/copy_to_iso/foo_installation/* /opt/INIT/
mv -v /opt/copy_to_iso/abc_scripts /opt/abc_scripts
rm -rvf /opt/copy_to_iso
bash -x /opt/abc_scripts/copy_system_files.sh
bash -x /opt/abc_scripts/setup_system_config.sh install_mode

During early-commands and late-commands, I have a local repository with all the needed packages under /cdrom/copy_to_iso/packages. During the user-data section, the location is /opt/packages.


When I install the ISO on a server without an internet connection, the installation ends perfectly well, and all the necessary packages are installed. On the other hand, when I install the ISO on a server with internet connection, I see in the logs that it found a more up-to-date package externally in the internet, and it makes the section of installing the packages from /opt/packages fail.


I saw some related questions on the internet, but I wish to make all the sections in autoinstall work only with my local repository. Here is something that I tried -


how to disable unattended-upgrades during autoinstall (user-data, cloud-config)


Please look on "alternate option to use your local mirror". My problem is that I don't work with http in my local repository, but with "file".


I tried -


#cloud-config
autoinstall:
apt:
disable_components: [restricted,multiverse]
disable_suites: [backports,security]
primary:
- arches:
- default
uri: file:///cdrom/copy_to_iso/packages/

and also file:/cdrom/copy_to_iso/packages/ - nothing works, and it still installs packages from external repositories.


How should I write it in my case?


More From » apt

 Answers
3

I managed to disable auto updates by disabling network as a part of the autoinstall:


network:
ethernets: {}
version: 2

In late-commands I add the following content to /etc/netplan/50-cloud-init.yaml -


network:
ethernets:
ens160:
dhcp4: true
dhcp6: false

then I run netplan apply and my machine has network.


[#69] Friday, February 18, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
puccop

Total Points: 66
Total Questions: 99
Total Answers: 93

Location: Aruba
Member since Sun, Nov 27, 2022
1 Year ago
puccop questions
Fri, Jan 13, 23, 18:55, 1 Year ago
Fri, Jan 21, 22, 07:21, 2 Years ago
Thu, Jul 28, 22, 06:32, 2 Years ago
Sat, Jun 4, 22, 03:40, 2 Years ago
;