Arch Linux: could not open file /var/lib/pacman/sync

With a fresh install of the Arch’s package manager pacman the user might not be able to open its databases located in /var/lib/pacman/sync .

error: could not open file /var/lib/pacman/sync/testing.db: Failed to open '/var/lib/pacman/sync/testing.db'
error: could not open file /var/lib/pacman/sync/core.db: Failed to open '/var/lib/pacman/sync/core.db'
error: could not open file /var/lib/pacman/sync/extra.db: Failed to open '/var/lib/pacman/sync/extra.db'
error: could not open file /var/lib/pacman/sync/community-testing.db: Failed to open '/var/lib/pacman/sync/community-testing.db'
error: could not open file /var/lib/pacman/sync/community.db: Failed to open '/var/lib/pacman/sync/community.db'
error: could not open file /var/lib/pacman/sync/multilib.db: Failed to open '/var/lib/pacman/sync/multilib.db'

In a bug report someone filed this description:

Pacman 3.5.0 sets the db files according to the umask, which can make them not world readable and hence users might need root privileges to search the db. This is a change since <3.5, since then everything needed to search for packages was set world readable.

After executing pacman -Syy the databases were accessible.

DeliciousDiggTechnorati FavoritesRedditLinkedInFacebookSpurlTwitterWebnewsYiGGMySpaceYahoo BookmarksFriendFeedGoogle BookmarksLiveJournalShare

Arch Linux: hostname moved

There was some confusion about the hostname tool which moved from net-tools to coreutils in June and finally it’s somewhere else since August 19th.

If you were wondering why hostname disappeared on your system and everything relying on it like my oh-my-zsh completion script throwing an error like this since then:

~/.oh-my-zsh/lib/completion.zsh:37: command not found: hostname

you should get the inetutils package with

sudo pacman -S inetutils

Update (25.8.2011):

I’m on testing. If you’re not you should find hostname in the net-tools package.

Update (6.10.2011):

hostname is definitely owned by inetutils.

DeliciousDiggTechnorati FavoritesRedditLinkedInFacebookSpurlTwitterWebnewsYiGGMySpaceYahoo BookmarksFriendFeedGoogle BookmarksLiveJournalShare

Unmute the sound card using the ALSA utils

On Arch Linux all the channels are mute by default. To unmute your sound card you can do it manually in the ncurses-gui-based alsamixer of the alsa-utils package which looks like shown on the following picture.

MM means that the channel is muted wheras OO marks it to be unmuted. The vertical bars visualize the volume which can be turned up and down with the up and down cursor keys. The Master and PCM channels need to get unmuted to hear some sound from your computer.

The same job can be done with amixer with the sound card number, the channel and the volume controls as arguments.

amixer set -c 0 Master 25 unmute
amixer set -c 0 PCM 25 unmute

Each sound card is enumerated, the first is 0, the second is 1 and so forth. To find out the appropriate number of a card the declaration can be found out by executing aplay -l.

➜  ~  aplay -l                                                              [0]
**** List of PLAYBACK Hardware Devices ****
card 0: I82801CAICH3 [Intel 82801CA-ICH3], device 0: Intel ICH [Intel 82801CA-ICH3]
  Subdevices: 0/1
  Subdevice #0: subdevice #0

The settings are stored in /var/lib/alsa/asound.state, to reload them after a reboot, the alsa daemon can be added in your /etc/rc.conf (on distributions not following the bsd style the system configuration file might differ).

...
DAEMONS=(... @alsa ...)
...

The @ symbol means that the daemon is started in the background which speeds up the boot time.

Other useful commands can be found here:
http://slopjong.de/2009/01/25/useful-mac-commands

DeliciousDiggTechnorati FavoritesRedditLinkedInFacebookSpurlTwitterWebnewsYiGGMySpaceYahoo BookmarksFriendFeedGoogle BookmarksLiveJournalShare

Download files recursively with wget

With wget you can download files directly in a shell. If you want to download a whole site, known as downloading recursively, you can set the r option.

wget -r http://inkscape.gristle.org

By default wget respects the robots file and thus only downloads the non-private files. The protocol of the robots exclusion standard is pure advisory, this means that the robots.txt contains rules that a search engine or other robots are not allowed to access certain files but they might ignore them.

Wget can be adviced to ignore that rules and thus it downloads the private files anyway. Set the e option as shown next.

wget -e robots=off -r http://inkscape.gristle.org

Other useful commands can be found here:
http://slopjong.de/2009/01/25/useful-mac-commands

DeliciousDiggTechnorati FavoritesRedditLinkedInFacebookSpurlTwitterWebnewsYiGGMySpaceYahoo BookmarksFriendFeedGoogle BookmarksLiveJournalShare

Invalid MIT-MAGIC-COOKIE-1 key

Recently I couldn’t start the x server and I got a mysterious Invalid MIT-MAGIC-COOKIE-1 key error. I deleted the .Xauthority files in my home directory which fixed my problem.

rm ~/.Xauthority*
DeliciousDiggTechnorati FavoritesRedditLinkedInFacebookSpurlTwitterWebnewsYiGGMySpaceYahoo BookmarksFriendFeedGoogle BookmarksLiveJournalShare