Long time ago the community packages was moved to the extra repo and the community was informed.
→ forum announcements for “The community repository has been merged into extra”
2023-05-21T15:55:00Z
→ gitlab - pacman.conf - generating pacman.conf.pacnew
The community repo was kept but with an empty database - thus you may have forgotten all about it. But now the community repo has been removed from the mirror pool.
→ Arch Linux - News: Cleaning up old repositories
If you did not update pacman.conf back then, when the community repo was merged into extra, you will see a message like this
$ sudo pacman -Syu
:: Synchronizing package databases...
core 140,0 KiB 875 KiB/s 00:00 [------------] 100%
extra 8,3 MiB 12,7 MiB/s 00:01 [------------] 100%
community.db failed to download
multilib 141,0 KiB 940 KiB/s 00:00 [------------] 100%
error: failed retrieving file 'community.db' from <mirror url> : The requested URL returned error: 404
error: failed to synchronize all databases (failed to retrieve some files)
Using a text editor
You can use your preferred text editor, but - as this is a protected system file - make sure it can save using elevated privileges.
Remove the following lines - describing the repo (very old installations have an extra line) as described
- old configuration
[community] Include = /etc/pacman.d/mirrorlist
- older configuration
[community] SigLevel = PackageRequired Include = /etc/pacman.d/mirrorlist
using nano to edit
The nano editor is default available, so we use nano in the example
-
Open a terminal and execute
sudo nano /etc/pacman.conf
-
Navigate to the line [Community] using PgDn and ↓↑
Screenshot
-
Press Ctrlk to delete the line
-
Press Ctrlk again (very old pacman.conf has three (3) lines)
-
Press Ctrlo to write out the changes
Screenshot
-
Press Enter to confirm write
-
Press Ctrlx to close the editor.
You are done - no restarts required - you can now sync your system.
Alternative method
Using sed requires listing /etc/pacman.conf beforehand to verify how many lines the community entry covers.
When you know the format of your pacman.conf you can invoke the corresponding command
cat /etc/pacman.conf
Or you can use awk to show only the interesting part
awk '/\[community\]/{p=3} p > 0 {print $0; p--}' /etc/pacman.conf
IF two (2) lines
[community]
Include = /etc/pacman.d/mirrorlist
sed -i '/\[community\]/,+2d' "/etc/pacman.conf"
IF three (3) lines
[community]
SigLevel = PackageRequired
Include = /etc/pacman.d/mirrorlist
sed -i '/\[community\]/,+3' "/etc/pacman.conf"