If you're running Ubuntu 22.04 on a Laravel Forge-managed server, you may have recently started seeing this error during apt update:
Err:7 https://ppa.launchpadcontent.net/ondrej/nginx/ubuntu jammy InRelease
403 Forbidden
E: The repository 'https://ppa.launchpadcontent.net/ondrej/nginx/ubuntu jammy InRelease' is no longer signed.
What's happening?
Forge historically added the ondrej/nginx PPA to its servers to get newer versions of nginx. Ondrej SurΓ½ (the maintainer) has since moved this PPA to a paid subscription model, so unauthenticated access now returns a 403. Your server still has the old PPA entry, but it can no longer reach it.
You'll notice the ondrej/php PPA still works fine β that one remains freely available.
The fix
Step 1: Find the file that references the broken PPA:
grep -r "ondrej/nginx" /etc/apt/sources.list.d/
Step 2: Remove it (the filename will match what grep returned above):
sudo rm /etc/apt/sources.list.d/ondrej-ubuntu-nginx-jammy.list
sudo rm -f /etc/apt/sources.list.d/ondrej-ubuntu-nginx-jammy.list.distUpgrade
Note:
add-apt-repository --remove ppa:ondrej/nginxwon't work here β Launchpad returns a 403 before it can resolve the PPA name.
Step 3: Run apt update again. If you need a newer version of nginx than Ubuntu's default (1.18.x), add the official nginx.org repository instead:
curl -fsSL https://nginx.org/keys/nginx_signing.key | sudo gpg --dearmor -o /usr/share/keyrings/nginx-archive-keyring.gpg
echo "deb [signed-by=/usr/share/keyrings/nginx-archive-keyring.gpg] http://nginx.org/packages/ubuntu jammy nginx" \
| sudo tee /etc/apt/sources.list.d/nginx.list
sudo apt update
sudo apt install nginx
Do you need a newer nginx?
For most Laravel applications, Ubuntu's default nginx is perfectly adequate. Unless you have a specific reason to run a cutting-edge nginx version, removing the PPA and sticking with the default is the simplest and most stable path.
If this post was enjoyable or useful for you, please share it! If you have comments, questions, or feedback, you can email my personal email. To get new posts, subscribe use the RSS feed.