Ubuntu 20.04应用商店图标消失且无法加载,apt更新报错求助
Hey there, let's work through this problem together! The core issue here is that your APT source list has a broken entry, which is causing both the apt update failure and the Ubuntu Software (app store) to get stuck loading—since the app store relies on APT sources to pull software info.
Step 1: Fix the broken APT source file
The error points to /etc/apt/sources.list.d/graphics:darktable.list having an invalid "gpg" entry on line 1. Let's fix that:
- First, make a backup of the broken file just in case:
sudo cp /etc/apt/sources.list.d/graphics:darktable.list /etc/apt/sources.list.d/graphics:darktable.list.bak - Open the file with a text editor to correct the issue. We'll use nano here since it's straightforward:
sudo nano /etc/apt/sources.list.d/graphics:darktable.list - Look at the first line—you'll see something starting with
gpgwhich isn't a valid APT source type (valid ones aredebordeb-src). You have two options here:- If you know the correct source line for Darktable, replace the invalid line with the proper one.
- If you're unsure, just comment out the problematic line by adding a
#at the start, or delete the line entirely.
- Save and exit nano: Press
Ctrl+O, hit Enter to confirm, thenCtrl+X.
Step 2: Refresh APT sources
Now run the update command again to make sure the error is gone:
sudo apt update
This should complete without the "Type 'gpg' is unknown" error now.
Step 3: Fix the Ubuntu Software (app store) issue
With the APT sources fixed, let's get the app store working again:
- First, try logging out and back into your system—sometimes this is enough to restore the icon and fix loading issues.
- If that doesn't work, reinstall the app store to reset it:
sudo apt install --reinstall gnome-software - You can also clear the app store's cached data to eliminate any stuck files:
rm -rf ~/.cache/gnome-software/ - Now launch Ubuntu Software again—it should load normally, and the icon should be back in your app launcher.
That should resolve both problems! Let me know if you run into any snags along the way.
备注:内容来源于stack exchange,提问作者John Doe Junior

