4nd3r / mkosi-intune

Intune for Linux feat. systemd-nspawn
https://learn.microsoft.com/en-us/mem/intune/user-help/enroll-device-linux
18 stars 4 forks source link

Problems with building mkosi-intune #13

Closed sayanchowdhury closed 10 months ago

sayanchowdhury commented 10 months ago

I'm having issues with building mkosi-intune.

_UID="1000" _USER="sayan" _GID="1000" _GROUP="sayan" _HOME="/home/sayan" mkosi --profile x --image-id corphost -f
‣ Removing output files…
‣ Building corphost image
‣  Copying in package manager file trees…
‣  Copying in skeleton file trees…
‣  Installing Ubuntu
Hit:1 https://packages.microsoft.com/repos/edge stable InRelease                                   
Get:2 http://security.ubuntu.com/ubuntu jammy-security InRelease [110 kB]                          
Hit:3 https://packages.microsoft.com/ubuntu/22.04/prod jammy InRelease       
Get:4 http://archive.ubuntu.com/ubuntu jammy InRelease [270 kB]              
Err:2 http://security.ubuntu.com/ubuntu jammy-security InRelease   
  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 871920D1991BC93C
Err:4 http://archive.ubuntu.com/ubuntu jammy InRelease
  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 871920D1991BC93C
Get:5 http://archive.ubuntu.com/ubuntu jammy-updates InRelease [119 kB]
Err:5 http://archive.ubuntu.com/ubuntu jammy-updates InRelease
  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 871920D1991BC93C
Reading package lists... Done
W: GPG error: http://security.ubuntu.com/ubuntu jammy-security InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 871920D1991BC93C
E: The repository 'http://security.ubuntu.com/ubuntu jammy-security InRelease' is not signed.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
W: GPG error: http://archive.ubuntu.com/ubuntu jammy InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 871920D1991BC93C
E: The repository 'http://archive.ubuntu.com/ubuntu jammy InRelease' is not signed.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
W: GPG error: http://archive.ubuntu.com/ubuntu jammy-updates InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 871920D1991BC93C
E: The repository 'http://archive.ubuntu.com/ubuntu jammy-updates InRelease' is not signed.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
‣ "env APT_CONFIG=/home/sayan/.cache/mkosi-workspacebv7dp0ju/apt.conf DEBIAN_FRONTEND=noninteractive DEBCONF_INTERACTIVE_SEEN=true INITRD=No apt-get -o APT::Architecture=amd64 -o APT::Architectures=amd64 -o APT::Install-Recommends=false -o APT::Immediate-Configure=off -o APT::Get::Assume-Yes=true -o APT::Get::AutomaticRemove=true -o APT::Get::Allow-Change-Held-Packages=true -o APT::Get::Allow-Remove-Essential=true -o APT::Sandbox::User=root -o Dir::Cache=/home/sayan/2-areas/code/work/mkosi-intune/mkosi.cache/cache/apt -o Dir::State=/home/sayan/2-areas/code/work/mkosi-intune/mkosi.cache/lib/apt -o Dir::State::Status=/home/sayan/.cache/mkosi-workspacebv7dp0ju/root/var/lib/dpkg/status -o Dir::Log=/home/sayan/.cache/mkosi-workspacebv7dp0ju -o Dir::Bin::DPkg=/usr/bin/dpkg -o Debug::NoLocking=true -o DPkg::Options::=--root=/home/sayan/.cache/mkosi-workspacebv7dp0ju/root -o DPkg::Options::=--force-unsafe-io -o DPkg::Options::=--force-architecture -o DPkg::Options::=--force-depends -o DPkg::Options::=--no-debsig -o DPkg::Use-Pty=false -o DPkg::Install::Recursive::Minimum=1000 -o pkgCacheGen::ForceEssential=, update" returned non-zero exit code 100.

To fix this I had to import the Ubuntu keys into the mkosi.skeleton. I'm wondering if I missed something during installation or this is a known issue.

gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 871920D1991BC93C
mkdir -p mkosi.skeleton/usr/share/keyrings
gpg --export 871920D1991BC93C > mkosi.skeleton/usr/share/keyrings/ubuntu-archive-keyring.gpg
sayanchowdhury commented 10 months ago

Closing this issue. Seems like the issue was with the ubu-keyring.