Skip to content

Commit

Permalink
Replace obsolete apt-key/add-apt-repository cmds
Browse files Browse the repository at this point in the history
This uses the more modern and more secure way of storing GPG keys and
associating them with specific repositories added to APT lists.
  • Loading branch information
lunkwill42 committed Dec 17, 2024
1 parent 642d7d5 commit c6d521d
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions scripts/nav.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,13 @@ For more information about NAV, please see https://nav.uninett.no/
EOF

apt-get install -y apt-transport-https makepasswd lsb-release software-properties-common
curl -fsSL https://nav.uninett.no/debian/gpg | apt-key add - # UNINETT NAV APT repository
mkdir -p --mode=0755 /etc/apt/keyrings
curl -fsSL https://nav.uninett.no/debian/gpg | gpg --dearmor -o /etc/apt/keyrings/nav.gpg

CODENAME=$(lsb_release -s -c)
add-apt-repository "deb https://nav.uninett.no/debian/ ${CODENAME} nav"
echo "deb [signed-by=/etc/apt/keyrings/nav.gpg] https://nav.uninett.no/debian/ ${CODENAME} nav" > /etc/apt/sources.list.d/nav.list
if [ "$CODENAME" = "bullseye" ]; then
add-apt-repository "deb http://deb.debian.org/debian bullseye-backports main"
echo "deb http://deb.debian.org/debian bullseye-backports main" > /etc/apt/sources.list.d/backports.list
fi

export DEBIAN_FRONTEND=noninteractive
Expand Down

0 comments on commit c6d521d

Please sign in to comment.