Snott

Category: Arch Linux

Rolling release distribution focused on simplicity and code elegance

  • Pacman 4 arrives with package signing!

    Pacman 4 arrives with package signing!

    Pacman 4 has just been pushed into core after being in the testing repo for a while, this new version of pacman comes with a lot of new features and improvements over the older version, mainly:

    • well-integrated and powerful signed packages and databases support in pacman, the library, and scripts (FS#5331)
    • many code cleanup commits across library/binaries/scripts
    • add new -S --recursive operation to upgrade a full dep chain
    • allow -U operation even without sync databases (FS#26899)
    • handle PGP signatures with a .sign extension

    Among many others, these improvements can prove to be a deciding factor in some users switching to Arch from other Linux distros, specially those who are paranoid about security.

    Please note that if you are upgrading from the older pacman versions you would need to use a new tool called pacman-key to set up your keyring, like so:

    pacman-key –init

    Dont forget to either login as root or use sudo so you can execute this command. In my case, I had to do and extra step to get the package signing to work, as the Arch Linux news update suggested, package signing was in fact NOT disabled for me, so after I upgraded and did a pacman -Syu the output came out like this:

    Import PGP key 4FA415FA, "Jan Alexander Steffens (heftig) ", created 2011-08-25? [Y/n] y
    (31/31) checking package integrity error: coreutils: key "F99FFE0FEAE999BD" is unknown
    Import PGP key EAE999BD, "Allan McRae ", created 2011-06-03? [Y/n] y
    error: fontforge: signature from "Gaetan Bisson " is unknown trust error:
    libreoffice-draw: signature from "Andreas Radke "
    failed to commit transaction (invalid or corrupted package (PGP signature))
    Errors occurred, no packages were upgraded.


    So I was unable to update the system because pacman didn't trust any developers, so I turned to Allan McRae blog and found out a way to trust the developers by using the provided Master Keys:

    for key in FFF979E7 CDFD6BB0 4C7EA887 6AC6A4C2 824B18E8; do
        pacman-key --recv-keys $key
        pacman-key --lsign-key $key
        printf 'trust\n3\nquit\n' | gpg --homedir /etc/pacman.d/gnupg/ \
            --no-permission-warning --command-fd 0 --edit-key $key
    done

    That will effectively add those keys to the keyring and validate the downloaded packages succesfully, please note that this keys are being given "marginal" trust by default, as the PGP web of trust is set up such that if a key is signed by three keys of marginal trust, then that key will be trusted. In case you want to do this procedure manually and add every developer and Trusted user instead of just the Master Keys, you will need to use the pacman-key tool, get the PGP keys from the devs and trusted users and add them to the keyring, if you want more details, you can go to the pacman-key wiki page, linked on this same paragraph.

    What do you think of the new pacman? do you like it? hate it? please leave a comment with your opinion!

  • Thinkparch – Archlinux on a Thinkpad

    Thinkparch – Archlinux on a Thinkpad

    If you are reading this before purchasing the laptop, get it with one of the intel wireless options and not with the “ThinkPad b/g/n” one. Intel wireless drivers has been merged into the mainline kernel since 2.6.24, so you should have no headaches at all with getting it to work.

    Some Interesting stuff I noted during the process I am about to describe:

    Regarding boot times:

    Windows 7 boot time to login prompt: ~32 seconds

    Arch boot time (with gnome 3 and fully configured system): ~12 seconds

    Regarding Installation size:

    Windows 7 installation with factory default settings size: ~30 GB and 1.17 GB for a separate boot partition

    Arch installation size after all configurations and programs installed: 6.87GB

     Stuff like this makes me wonder why people still use windows as their primary OS….

    Today I received my new laptop (a ThinkPad t420s, i5 processor, 128gb SSD, 4GB RAM), and whats the first thing to do?

    Open it, turn it on, make recovery disks and format Win7 to make way to the almighty Archlinux.

    I’m going to post here the entire process to make this system a Linux beast, Lenovo is popular for Linux systems for a reason.

    1) Like said above, make recovery media for the original Win7 for when you want to sell the laptop to a Windows user in the future, after you go trough the setup process the system will ask you to create the media. Do it and move on.

    2) Burn a cd of the most recent archlinux installation media.

    3) Insert the cd, select the option “boot archlinux” and then type /arch/setup to begin the installation process. At this point I would recommend having a copy of the Archlinux beginners guide opened in another tab of your browser.

    4) When you get to partition the hard drive, the easiest and most automated way is to use auto-prepare (option 1), if you want more control on the partitioning process, choose option 2.

    WARNING: choosing option 1 will erase your entire hard drive, if you want to keep your Windows 7 installation and configure dual boot later, DONT SELECT THIS.

    5) Regarding filesystem types, lost of people just tend to choose ext4 for home and root partitions because they don’t know the other types, please make an informed decision about this by reading this short explanation on filesystems. I was going to choose XFS for my home and root partitions, but taking into account XFS partitions cannot be shrunk (read online resizing section) and this is a small SSD hard drive in which I may have to resize partitions, I choose ext4 on both.

    6) When you get to select the packages you want to install, along with the default ones I selected ca-certificates, dnsutils, iptables, libsub, linux-docs, linux-firmware, linux-headers, lzo2, mkinitcpio, ncurses, openssh, openssl, openvpn, pacman-mirrorlist, sudo and tzdata. Don’t deselect packages at this stage unless you know what you are doing.

    7) Wait for the package installation to finish, and then verify the configuration files presented on the next page, here I usually just change my hostname and set my eth0interface to dhcp on rc.conf, uncomment additional locales on locale.gen, uncomment some mirrors from pacman mirrorlist and change root password.

    8) Now reboot into your new Archlinux system and login as root!

    9) The first thing you need to do now is to update the pacman package database and upgrade the currently installed files to their latest versions, do that with:

    #pacman -Syyu

    If you get a message that pacman has to be updated first, do it and then just issue the same command again.

    10) One pretty good trick you can do to speed up pacman is to use a little nifty script called reflector. I like to install and use this after the system has been completely updated to avoid problems. Reflector can get the latest mirrorlist from the MirrorStatus page, filter the most up-to-date mirrors, sort them by speed and overwrite the file /etc/pacman.d/mirrorlist.

    This will give you a system with very good mirrors and fast downloads.

    To install:

    #pacman -S reflector

    First it is recommended to backup your mirrorlist (DO IT):

    # mv /etc/pacman.d/mirrorlist /etc/pacman.d/mirrorlist.backup

    The following command will filter the first 5 mirrors, sort them by speed and overwrite the file /etc/pacman.d/mirrorlist

    # reflector -l 5 --sort rate --save /etc/pacman.d/mirrorlist

    For all available commands run

    # reflector --help

    Warning: Make sure the mirrorlist doesn’t contain strange entries before syncing or updating with pacman.

    11) For the sound part, I had to use alsaconf to make the system set the intel sound card as default, to do this just type:

    alsaconf

    12) Next I installed everything else, I choose Gnome3 as my Desktop environment, and then I followed by installing all the apps I use (Libreoffice, gimp, clementine, etc.). As a rule of thumb, I have the archwiki open and check big and important package installation instructions to avoid future headaches, for example, I check the archwiki libreoffice page before installing libreoffice to get all the features I want.

    13) Get some default directory structure.

    Many Linux distributions such as Ubuntu or Linux Mint set up your default user directories such as your downloads directory, music directory, documents directory, and so on. This also gives these directories special identifying icons. To set XDG user directories up, run this command:

    # pacman -S xdg-user-dirs
    and then
    $ xdg-user-dirs-update
    Install codecs (mp3, ogg, etc):
    # pacman -S gstreamer0.10-plugins
    To access samba and windows shares trough nautilus, install this:
    # pacman -S gvfs-smb gnome-vfs

    General TIPS:

    – You need at least 1 telepathy protocol for empathy to work:

    pacman -S telepathy-butterfly telepathy-gabble

    • telepathy-gabble: Jabber/XMPP
    • telepathy-butterfly: MSN/windows live messenger

    – Some nice cursors:

    # pacman -S xcursor-vanilla-dmz xcursor-polar xcursor-pinux

    – Don’t forget network manager for your networking needs:

    # pacman -S networkmanager network-manager-applet

    check the archwiki page for network manager for details on installing and configuring the application.

    – If at any point, you want to edit which applications start at bootup type:

    # gnome-session-properties
    Regarding hardware:
    • fn + key combinations work as expected (ie. fn + f2 locks pc, fn + f4 suspends, etc)
    • brightness buttons work correctly
    • keyboard light works (fn + pgup key)
    • volume keys work
    • mute key works
    • microphone mute key works
    • Player control buttons work (fn + up, down, left, right)
    • Multi-monitor setup works without additional tweaking
    Here is a screenshot of the desktop
    Thinkparch Desktop
    And 2 for the laptop itself with a neat Arch Skin so people ask "whats that logo?" :D
    Thinkpad with ArchlinuxThinkpad with Archlinux