Updating Pacman on the Raspberry Pi

So… You got Arch Linux installed on your Raspberry Pi. And, you want to update all of the packages so that you can start installing stuff. Well, not so fast. Arch Linux has this little “feature”, where you can’t really install packages without generating a key.

Generate Pacman Key

To generate a key, folks will tell you that it is as easy as running:

pacman-key --init

And those folks are total liars. When running that command, you will get the output, “Generating pacman keychain master key…”, and it will just sit there doing nothing. Forever. In actuality, you are supposed to open another virtual console (Alt + F3 or Alt + F4), and do a bunch of random shit that causes drive reads and writes.

Perhaps, to do those writes, you would run a command such as:

ls -R /

But, that isn’t nearly enough stuff on the tiny Raspberry Pi Arch image to generate enough IO. Still others will tell you to run:

updatedb

But, of course, that command does not exist on a newly installed system. To get that command available and then run it, you need to actually run:

pacman -S mlocate
updatedb

Once you’ve done that and made a lot of hard drive writes, you can switch back to the key init app by hitting Alt+F1. But, you’ll notice that it STILL isn’t done. At this point, get angry, go back to your terminals, and mash your keyboard with the recursive ls and the updatedb commands, and run the top command in another terminal. After several minutes of frustration and anger, your pacman-key –init command will finally be done.

Update Pacman

Now, you need to update the package manager itself. Run the command:

pacman -S pacman

And you should have the latest version.

Update ALL THE THINGS

Now, try running

pacman -Syyuf

Replace libusb with core/libusbx? Y
… procps? Y
… udev? Y
Proceed? Y

By the time it is done (about 15 minutes of installing), you’ll have all sorts of new packages on your system. Most importantly, you’ll have the latest firmware.

The udev, libusb, procps stuff is kinda goofy because Arch recently made a big change to their system, and since it’s a rolling release, those three packages seem to complain a little about being replaced.

7 Responses to “Updating Pacman on the Raspberry Pi”

  1. Thanks for your informative post! As I was sitting there waiting for pacman-key to finish, I was thinking to myself “don’t they require some keyboard/mouse activity or something to randomize stuff? (which I believe Truecrypt uses).

    After reading your post I opted for:
    $ find / -name '*' -exec cat {} >/dev/null \;

    Waited a while for that and decided to open another console to install mlocate. It finished shortly after.

    Reply
    • Awesome, I’m glad to hear this helped you. It is beyond me why they wouldn’t tell the user what to do during the key generation.

      Reply
  2. Here’s a response I received via email, figured it would be good to put here:

    Hello.

    your Raspberry Pi Tutorial is really good !

    take a look to:
    https://wiki.archlinux.org/index.php/Pacman-key

    with haveged you get this Key in seconds :-)

    bye

    Ingo

    Reply
  3. darkblackcorner

    Nice tip! I was going to suggest haveged too, but I like you method better, especially when I didn’t have the foresight to install haveged during setup.

    I normally run pacman-key --populate archlinux too. I guessing if you don’t it would just ask every time it finds a new key.

    Didn’t know about virtual consoles before – really useful!

    Reply
  4. for me, all I had to do was “pacman -Syu”.

    Reply
  5. I used “sudo find . / | xargs file > /dev/null” from another terminal and the init went fairly quickly, however my luck wasn’t so good on the full update, as it somehow destroyed the file system on my SD card, and it no longer boots on either of my Raspis.

    Reply
  6. Another quick and easy way to accomplish this: use the “haveged” utility. It creates entropy on-the-fly:

    pacman -S haveged
    haveged -w 1024
    pacman-key –init
    pkill haveged

    Reply

Comment

  • (will not be published)

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>