February 1, 2016

Arch and the outdated package-query

Seems that the first story arrives sooner than expected, nevertheless my story is that I running my daily things on multiple PCs with different distros.
My first in command laptop when I'm not in my office is running Arch. If you are running Arch you know already that life is actually pretty smooth with it, but when things go wrong.. they can go very wrong.

The Problem

I tried to update today my system and ran into a strange problem. The update this time includes pacman 5.0.0, but when I try to do a system wide update one package namely package-query was causing a bit of a conflict requiring earlier version of pacman than 4.3. As it shows:

nuke@AuroraArch ~                                                 [13:37:15]
> $ sudo pacman -Syu                                                          
:: Synchronizing package databases...
 core is up to date
 extra is up to date
 community                  3.3 MiB   127K/s 00:27 [######################] 100%
 multilib is up to date
 archlinuxfr is up to date
:: Starting full system upgrade...
resolving dependencies...
looking for conflicting packages...
error: failed to prepare transaction (could not satisfy dependencies)
:: package-query: requires pacman<4 .3="" br="">

The Solution

At the moment - as the dependencies part of the package is not yet updated although pacman 5.0.0. is now in core - is to grab the PKGBUILD of package-query, remove <4 .3="" and="" depends="" from="" install="" it.="" it="" line="" p="" recompile="" the="">

PKGBUILD files are generally speaking make files for creating packages for Arch Linux and I could start writing million lines of it, but the Arch guys are did that for us already and it is available here. Pretty handy little things, but how this will work?

First grab the PKGBUILD:
git clone https://aur.archlinux.org/package-query.git

Edit the PKGBUILD file
vim PKGBUILD

Look for the "depends" line and remove '<4 .3="" span="">from it and save it.

You are ready to compile it. While standing in the same folder with the PKGBUILD file:
makepkg

Should be fairly fast, but once it is done you just need to install it. As it is a local install you need the -U flag:
pacman -U  package-query-1.7-1-x86_64.pkg.tar.xz

After this you can go wild and update the system pacman -Syu.
Package-query is compatible with pacman 5.0.0., but till the dependencies of it is not update this will do.

Conclusion
Frankly this wasn't my first encounter with PKGBUILD on Arch or pacman issues for that matter, but it always amaze me the great way of taking care of packaging business, the ease of use and distribution of the package as well. Hopefully this guide - besides offering a quick solution for the problem - can give to many a short and quick introduction to PKGBUILD.
Arch is a fantastic rolling release distro and honestly once you get it running and you maintain it properly you can end up with an awesome, fresh and stable OS on your box. 



No comments:

Post a Comment