This is an automated email from the ASF dual-hosted git repository.
dongjoon-hyun pushed a commit to branch branch-4.x
in repository https://gitbox.apache.org/repos/asf/spark.git
The following commit(s) were added to refs/heads/branch-4.x by this push:
new 9b7abb6bf3a9 [SPARK-57755][INFRA] Replace deprecated `apt-key` with
`/etc/apt/trusted.gpg.d` keyring file
9b7abb6bf3a9 is described below
commit 9b7abb6bf3a900792355f4db78eda9dca0e02ead
Author: Dongjoon Hyun <[email protected]>
AuthorDate: Mon Jun 29 14:39:49 2026 -0700
[SPARK-57755][INFRA] Replace deprecated `apt-key` with
`/etc/apt/trusted.gpg.d` keyring file
### What changes were proposed in this pull request?
This PR replaces the deprecated `apt-key add` with a keyring file under
`/etc/apt/trusted.gpg.d/` in three dev Dockerfiles
(`dev/create-release/spark-rm/Dockerfile.base`, `dev/infra/Dockerfile`,
`dev/spark-test-image/sparkr/Dockerfile`):
```diff
-RUN gpg -a --export E084DAB9 | apt-key add -
+RUN gpg -a --export E084DAB9 > /etc/apt/trusted.gpg.d/cran.asc
```
### Why are the changes needed?
`apt-key` is deprecated at `Ubuntu 20.10` over 5 years ago and removed at
`Ubuntu 26.04` already. The official manpage recommends shipping keyring files
in `/etc/apt/trusted.gpg.d/` directly instead.
- https://manpages.debian.org/testing/apt/apt-key.8.en.html
- https://manpages.ubuntu.com/manpages/jammy/en/man8/apt-key.8.html
### Does this PR introduce _any_ user-facing change?
No.
### How was this patch tested?
Pass the CIs.
### Was this patch authored or co-authored using generative AI tooling?
Generated-by: Claude Opus 4.8
Closes #56868 from dongjoon-hyun/SPARK-57755.
Authored-by: Dongjoon Hyun <[email protected]>
Signed-off-by: Dongjoon Hyun <[email protected]>
(cherry picked from commit 4b3ec116950534c9fb05fac5654e4c4968ac0829)
Signed-off-by: Dongjoon Hyun <[email protected]>
---
dev/create-release/spark-rm/Dockerfile.base | 2 +-
dev/infra/Dockerfile | 2 +-
dev/spark-test-image/sparkr/Dockerfile | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/dev/create-release/spark-rm/Dockerfile.base
b/dev/create-release/spark-rm/Dockerfile.base
index 82f2381ee993..b7a2da7729bd 100644
--- a/dev/create-release/spark-rm/Dockerfile.base
+++ b/dev/create-release/spark-rm/Dockerfile.base
@@ -87,7 +87,7 @@ RUN apt-get update && apt-get install -y \
# Set up R CRAN repository for latest R packages
RUN echo 'deb https://cloud.r-project.org/bin/linux/ubuntu jammy-cran40/' >>
/etc/apt/sources.list && \
gpg --keyserver hkps://keyserver.ubuntu.com --recv-key
E298A3A825C0D65DFD57CBB651716619E084DAB9 && \
- gpg -a --export E084DAB9 | apt-key add - && \
+ gpg -a --export E084DAB9 > /etc/apt/trusted.gpg.d/cran.asc && \
add-apt-repository 'deb https://cloud.r-project.org/bin/linux/ubuntu
jammy-cran40/'
# Install R packages (same versions across all branches)
diff --git a/dev/infra/Dockerfile b/dev/infra/Dockerfile
index 57cde202dde8..a54e270de567 100644
--- a/dev/infra/Dockerfile
+++ b/dev/infra/Dockerfile
@@ -76,7 +76,7 @@ RUN apt-get update && apt-get install -y \
RUN echo 'deb https://cloud.r-project.org/bin/linux/ubuntu jammy-cran40/' >>
/etc/apt/sources.list
RUN gpg --keyserver hkps://keyserver.ubuntu.com --recv-key
E298A3A825C0D65DFD57CBB651716619E084DAB9
-RUN gpg -a --export E084DAB9 | apt-key add -
+RUN gpg -a --export E084DAB9 > /etc/apt/trusted.gpg.d/cran.asc
RUN add-apt-repository 'deb https://cloud.r-project.org/bin/linux/ubuntu
jammy-cran40/'
# See more in SPARK-39959, roxygen2 < 7.2.1
diff --git a/dev/spark-test-image/sparkr/Dockerfile
b/dev/spark-test-image/sparkr/Dockerfile
index 8a03095aef7e..929ef214f6df 100644
--- a/dev/spark-test-image/sparkr/Dockerfile
+++ b/dev/spark-test-image/sparkr/Dockerfile
@@ -67,7 +67,7 @@ RUN apt-get update && apt-get install -y \
RUN echo 'deb https://cloud.r-project.org/bin/linux/ubuntu jammy-cran40/' >>
/etc/apt/sources.list
RUN gpg --keyserver hkps://keyserver.ubuntu.com --recv-key
E298A3A825C0D65DFD57CBB651716619E084DAB9
-RUN gpg -a --export E084DAB9 | apt-key add -
+RUN gpg -a --export E084DAB9 > /etc/apt/trusted.gpg.d/cran.asc
RUN add-apt-repository 'deb https://cloud.r-project.org/bin/linux/ubuntu
jammy-cran40/'
# See more in SPARK-39959, roxygen2 < 7.2.1
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]