Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I want to install sudo. So I type in pacman -S sudo. But then I get the following errors:

warning: database file for 'extra' does not exist
warning: database file for 'community' does not exist
error: failed to prepare transaction (could not find database)

How do I install the database files for 'extra' and 'community'? I am in Arch Linux.

share|improve this question

1 Answer 1

up vote 14 down vote accepted

Firstly, try running pacman -Syy, then try to install sudo again.

Check that the repositories are uncommented in /etc/pacman.conf.

Or your mirrorlist might be outdated: Generate a current list of mirrors and copy it to /etc/pacman.d/mirrorlist

Quoting from this relevant forum thread:

You can:

  • pick another mirror
  • try using an http mirror, not an ftp one (pick http mirror from the mirrorlist).
  • Alternatively you can manually download the databases with:

    wget ftp://mirror.csclub.uwaterloo.ca/archlinux/community/os/x86_64/community.db
    wget ftp://mirror.csclub.uwaterloo.ca/archlinux/extra/os/x86_64/extra.db
    

    move them to /var/lib/pacman/sync/ and run 'pacman -Syu' again. If you find any *.part files in /var/lib/pacman/sync/ e.g. /var/lib/pacman/sync/core.db.part - remove them.

To prevent having problems like these it is critical to understand pacman. To learn more about using pacman, see the ArchWiki pacman article, and consult man pacman.

share|improve this answer
1  
pacman -Syy worked great. +1 & accepted answer. =D –  gadgetmo Mar 20 '12 at 18:40

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.