Archive for the ‘ Arch Linux ’ Category

Switched from Arch to Fedora

A few months back my old Dell Inspiron laptop died.  It was a warhorse, surviving drops onto concrete floors, being stepped on by a big dog.  The cap to the zero key popped off, and the tab key would stick from time to time but it kept on trucking.  Most of the bezel around the monitor had broken / fallen off, I think this was the downfall.  Finally the monitor quit working.  I couldn’t work with it docked up to an external monitor so I replaced it with an ASUS K55N.

If I were a Windows only user it would be a great laptop for the price, but due to work and personal preference I’m booted into Linux 99% of the time.  This suited me well on the Dell, its 2GB of RAM and aging processor made Windows molasses slow, meanwhile the Linux side hummed right along as long as I didn’t have too many browser tabs full of Flash videos open at once.  However, on the ASUS I kept running into issue after issue.

First of all getting Arch onto the ASUS was a chore.  Part of the problem was this was my first attempt at installing an OS onto a UEFI machine.  Eventually after figuring out how to turn off the secure boot feature I was able to boot to the Arch LiveCD installer.  The installation went fine until I tried to reboot and GRUB2 did not take over.  For some reason the efimanager did not install or run correctly during the installation process.  Eventually I switched to ReFind and figured out how to manually add an entry for it in the laptop’s boot order.

Once Arch was installed I had a few more problems to work through.  Suspend wouldn’t work, I gave up on solving that issue and switched to using Hibernate instead.  Another issue was with the sound system, I could not get audio to work for more than one program at a time, and once a program “claimed” the sound no other program could output to the speakers until the first program was closed.  Going through pages of Google results pointed to PulseAudio as the culprit, but I could not remedy the situation.  Both of these were minor annoyances, the final straw moving me from Arch to Fedora was QGIS stopped working.

The first two problems were most likely hardware related.  QGIS however was an Arch only issue.  The problem came about as a result of the Achilles heel of rolling release distributions, a key library was updated to a version incompatible with QGIS.  I was unable to launch QGIS and compiling a new version would fail.  Facing a deadline I decided to wipe Arch and move on to Fedora.

Installing Fedora was much easier than installing Arch.  Partly due to the fact I was now more familiar with the ins and outs of UEFI, but also Fedora’s installer is a user friendly GUI and Arch’s installer is a wiki page on their website.

Fedora has generally run better on the ASUS.  The audio system now works perfectly, but I can no longer hibernate.  The laptop will hibernate, but on recovery the screen goes black.  The computer is running, switching to a different TTY allows me to log in and run commands from the command line, but I can’t get the screen to come back on.  I think this is due to the ATI video card and its radeon driver.   Hopefully I can find a solution soon.

I was able to get my GIS stack installed, all of the programs I use are in Fedora’s repository.  I did have to make a change to GDAL, I use several non-open GIS data formats (ESRI File Geodatabases, MrSID rasters, and ERDAS ecw rasters).  Under Arch it was just a matter of downloading the appropriate API or SDK, altering the default PKGBUILD file to point to the appropriate libraries and recompiling.  Under Fedora you have to edit the SPEC file, and SPEC files are much more complicated that Arch’s PKGBUILD files.  In addition Fedora’s package management system expects any libraries that a packaged program is complied against to be accounted for in a package.  Eventually I got it all sorted out and I got back to work.

I’m still too new to Fedora to do a comparison between it and Arch.  Certainly installing Fedora is much easier than installing Arch.  For day to day use they are about the same, in fact since I kept my /home on a separate partition they are nearly identical experiences.  Both use systemd to manage services, and both give you up to date software.  That was one worry about moving to Fedora, Arch’s rolling release always gave me easy access to the latest versions of the software I used on a daily basis.  Although Fedora isn’t rolling release all of the software I use is the latest and greatest.  QGIS, PostGIS, Postgres, LibreOffice, etc are all up to date.  As I said earlier the rub comes when I need to tweak software from the Fedora default.  Perhaps it will get easier for me as time goes on, or perhaps I’ll flush my root directory and reinstall Arch.

PKGBUILD for QGIS 2.0.1

Edit:

Of course as soon as I post this AUR gets updated.  The maintainer pretty much used saultdon’s PKGBUILD.

https://aur.archlinux.org/packages/qgis/

 

Here’s a link to a PKGBUILD that will install QGIS 2.0.1 for you on Arch Linux:

https://db.tt/aPFyj9kc

Thanks to AUR user saultdon for putting it together.

Spotify 0.9 for Linux

I used to have to write about this all the time, Spotify but maintainers of the Spotify AUR PKGBUILD have been doing such a great job there aren’t any issues getting Spotify to install and run on Arch.  Hooray!

Accessing ESRI File Geodatabases on Arch Linux

First up, download the File Geodatabase API from here.  You’ll need create an ESRI Global account and agree to the API’s EULA.  Once the API’s tarball is downloaded, extract it and keep track of where you put it.  Next up, download GDAL’s PKGBUILD, a patch, and changelog from here.  All three files need to be in the same directory.  Next, edit the PKGBUILD to look for the API.  Personally I put the API in /opt so I added:

--with-fgdb=/opt/FileGDB_API

and then ran mkgpkg.  Once GDAL finished compiling pacman -U upgraded gdal.  Now I can go into QGIS, click Add Vector, click the Directory radio button, and select File GDB in the file type drop down.  Easy peasy.

Rotating a QuickTime movie

I was handed a QuickTime movie that was recorded with an iPad that was held upside down.  Luckily ffmpeg makes this easy.

ffmpeg -i <input_file> -strict -2 \
-vf "transpose=1, transpose=1" <output_file>

The -strict -2 allows ffmpeg to use the experimental aac codec, and -vf “transpose=1, transpose=1” rotates the video by 90 degrees twice.

Installing Postgis 2.1.0SVN on Arch

I wanted to try the new Tiger geocoder extension that’s coming with PostGIS 2.1.0.  I set up a PKGBUILD to upgrade the 2.0.2 that’s in Arch’s repository.

Since this is a major version upgrade a hard upgrade is required.  The upgrade went smoothly except the spatial_ref_sys table wasn’t populated.  Running the spatial_ref_sys.sql script found at /usr/share/postgresql/contrib/postgis-2.1 solved that problem.

Changes to building QGIS 1.9 on Arch

Recently Arch added QT5 to their repositories and renamed the old QT package to QT4.  This causes a little confusion for the qgis-git PKGBUILD since it lists the old qt package as a dependency.  It’s an easy fix, just change qt to qt4 and add

-DQMAKE_EXECUTABLE=/usr/bin/qmake-qt4

to the ./configure options.

Once 1.9 is compiled and built you can see how far along this beta version has come.  The new loader built into the DB Manager plugin works flawlessly.  This is my favorite new feature in 1.9 / 2.0.  It makes it so if you can add a dataset to a QGIS map, it only takes a few clicks to import that data into a new PostGIS layer.  It really comes in handy with layers created by ad-hoc queries.

Plugin developers have been hard at work adjusting their plugins to work with the new API.  OpenLayers has been updated, just upgrade through the Fetch Python Plugins menu and you can once again display your Google, Bing, etc maps in QGIS.

 

Installing PGRouting on Arch Linux

PGrouting adds routing functionality to a PostGIS database.  For Arch users you can install it from AUR.  If you want PGRouting’s Travelling Sales Person (TSP) functionality installed you’ll need to install Gaul (available from AUR from gaul-devel) and if you want Driving Distance (from AUR as cgal).  After you install PGRouting run

sudo ldconfig

so you’re system knows where to find the new PGRouting libraries.

Next up is to add PGRouting to your PostGIS database.  PGRouting doesn’t have an extension yet so you’ll have to run some sql files.  I like to install PGRouting into its own schema so I start psql and use:

CREATE SCHEMA pgrouting;
SET search_path pgrouting, postgis;
\i /usr/share/postlbs/routing_core.sql
\i /usr/share/postlbs/routing_core_wrappers.sql
\i /usr/share/postlbs/routing_tsp.sql
\i /usr/share/postlbs/routing_tsp_wrappers.sql
\i /usr/share/postlbs/routing_dd.sql
\i /usr/share/postlbs/routing_dd_wrappers.sql

You may get some errors like

ERROR:  language "C" does not exist

If you do, just open the file you tried to run and find the line referenced.  Change the “C” to “c” and then re-run the .sql file.

Now all that is left to do is add the pgrouting schema to your search path.  Personally I use an ALTER DATABASE statement, but other people may prefer to make the change on a per user basis.

Postgis 2.0.2 hits Arch repository

Arch has posted the PostGIS 2.0.2 release that came out December 3rd to the Community repository. After Pacman updates the package Postgres needs to be made aware of the upgrade.  Use:

ALTER EXTENSION postgis UPDATE TO "2.0.2"; 
ALTER EXTENSION postgis_topology TO "2.0.2";

Early impressions of QGIS 1.9

I had a raster and I needed to make the no data value transparent, but QGIS 1.8 has a bug that prevented me from doing so.  Since I’m not working in a production environment I decided to go ahead and pull 1.9 from QGIS’s Git repository and give it a shot.  Someone has set up a PKGBUILD that handles all the hard work of pulling the latest and greatest off of github for you.

Once 1.9 was downloaded and compiled I really liked what I saw.  Not only is the no data transparency bug fixed, but the raster menu is completely overhauled.  I will miss the old single band pseudo-color and freak out settings, I guess I can figure out what their color ramps were and rebuild them by hand.  I’ll take that over the old way rasters were handled which left you staring at a grey box until you set the min/max values and stretched the display to their values.  Now when you load a raster you get a usable display right off the bat.

Also new in 1.9 is the updated label tab and engine.  I haven’t played with it much but there are a million options to play with, once you dig into it labels are going to rival what you get from ArcMap’s Maplex label engine.

I also downloaded a new plugin, Statist.  It is available from the official plugin repository, and it works on QGIS 1.8 or greater.  This plugin is similar to ArcMap’s Statistics menu, as you can see in the screenshot below it gives you a frequency chart and a break down on some basic statistical data from fields in your vector layers.  Simple, easy to use, and gives you valuable information, it’s a great plugin.  Before you can use it you’ll need to install a python 2 library, python2-matplotlib.  For Arch users this library is available from the community repository.

statist plugin screenshot

Proof that I don’t pedal fast enough