Fix “error: file owned by …” issue on Arch Linux

I tried to install caffe on my Arch Linux, but it prompted following errors:

$ yaourt -S caffe
error: file owned by 'ntl' and 'ntl-threading': 'usr/include/NTL/BasicThreadPool.h'
error: file owned by 'ntl' and 'ntl-threading': 'usr/include/NTL/FFT.h'
error: file owned by 'ntl' and 'ntl-threading': 'usr/include/NTL/FacVec.h'
error: file owned by 'ntl' and 'ntl-threading': 'usr/include/NTL/GF2.h'
error: file owned by 'ntl' and 'ntl-threading': 'usr/include/NTL/GF2E.h'
error: file owned by 'ntl' and 'ntl-threading': 'usr/include/NTL/GF2EX.h'
error: file owned by 'ntl' and 'ntl-threading': 'usr/include/NTL/GF2EXFactoring.h'
error: file owned by 'ntl' and 'ntl-threading': 'usr/include/NTL/GF2X.h'\

The reason is I installed NTL through pacman before. So the solution is uninstalling NTL first:

$ sudo pacman -R ntl

Then installing caffe successfully:

$ yaourt -S caffe
:: Running post-transaction hooks...
(1/1) Arming ConditionNeedsUpdate...
No database errors have been found!

pacman a file owned by two packages.

Arch Linux: a developer-friendly Operating System

I have been using Arch Linux as the working environment for nearly 2 years. Generally speaking, the experience is very good, and I want to recommend it for more people, especially software engineers.

Because I am a developer, one SSH client is mostly enough, and fascinating desktop doesn’t appeal to me. Since Arch Linux is “rolling release” mode, it means I can always get the newest kernel and software packages (one “pacman -Syu” command will refresh the whole system), and my favorite thing is to make use of the newest functions provided by compiler and kernel . On the contrary, one pain point of distributions whose mode are “point release” is sometimes you need to compile the vanilla kernel yourself if you want to try some up-to-date features (E.g., use eBPF on RHEL 7) .

The package management system is another killer feature. For instance, I used to try to develop OpenMP program using clang. Not similar as gcc, clangrequires additional package:

# pacman -S clang
Optional dependencies for clang
    openmp: OpenMP support in clang with -fopenmp
    python2: for scan-view and git-clang-format

The prompt not only shows me that I need to install openmp package, but also requires “-fopenmp” option to compile OpenMP program. This is very humanized. I tried to enable OpenMP feature of clang on some other OSs, and the process is not as smooth as Arch Linux.

Last but not least, Arch Linux community is friendly, I can always get help from other enthusiastic guys.

For me as a programmer, what I need is just a stable Operating System which can always provide latest software toolchains to meet my requirements, and I don’t want to spend much time to tweak it. Arch Linux seems fulfill these demands perfectly. If you have simple requirement as me, why not give it a shot?

First taste of building cilk program on Arch Linux

I bump into cilk that is much like OpenMP this week, and give it a try on Arch Linux:

(1) Follow the Quick start to build Tapir-Meta:

$ git clone --recursive
$ cd Tapir-Meta/
$ ./ release
$ source ./

Please note gcc is the default compiler on Arch Linux, and there is a compile error of using gcc. So I switch to clang:

$ CC=clang CXX=claang++ ./ release

The is simple, just make Tapir/LLVM compilers as the default ones:

$ which clang
$ which clang++

(2) Build libcilkrts (please refer this issue: “/usr/bin/ld: cannot find -lcilkrts” error).

(3) Write a simple program:

$ cat test.c
#include <unistd.h>
#include <cilk/cilk.h>

int main(void)
        cilk_spawn sleep(100);
        cilk_spawn sleep(100);
        cilk_spawn sleep(100);

        return 0;

Build it:

$ clang -L/home/xiaonan/cilkrts/build/install/lib -fcilkplus test.c
$ ldd a.out (0x00007ffdccd32000) => /home/xiaonan/cilkrts/build/install/lib/ (0x00007f1fe4d60000) => /usr/lib/ (0x00007f1fe4b48000) => /usr/lib/ (0x00007f1fe478c000) => /usr/lib/ (0x00007f1fe4588000) => /usr/lib/ (0x00007f1fe436a000) => /usr/lib/ (0x00007f1fe3fe1000) => /usr/lib/ (0x00007f1fe3c4c000)
    /lib64/ => /usr/lib64/ (0x00007f1fe4f7e000)

From ldd output, we can see it links the ibcilkrts library. Execute the program:

$ ./a.out &
[1] 25530
[[email protected] ~]$ ps -T 25530 | wc -l

We can see a.out spawns many threads.

Fix “==> ERROR: options array contains unknown option ‘!upx'” on ArchLinux

You may bump into following error when installing packages from AUR:

$ makepkg -si
==> ERROR: options array contains unknown option '!upx'

One workaround is open the PKGBUILD file, and spot the line which contains options:

options=('staticlibs' 'libtool' '!upx')

Remove the !upx, then you can build it now.

dropbox: unrecognized !upx in the options array.


Fix “error while loading shared libraries:” on ArchLinux

Today, when I tried to use yaourt to install some software, the following error happened:

package-query: error while loading shared libraries: cannot open shared object file: No such file or directory

The root cause is the libalpm in system is already

$ ls -lt /usr/lib/*
lrwxrwxrwx 1 root root     17 Jun  1 00:32 /usr/lib/ ->
lrwxrwxrwx 1 root root     17 Jun  1 00:32 /usr/lib/ ->
-rwxr-xr-x 1 root root 223616 Jun  1 00:32 /usr/lib/

But the package-query is still searching

$ ldd /usr/bin/package-query (0x00007fffb1d8d000) => /usr/lib/ (0x00007f4baee32000) => /usr/lib/ (0x00007f4baec28000) => not found => /usr/lib/ (0x00007f4bae86c000) => /usr/lib/ (0x00007f4bae647000)

The solution is removing yaourt and package-query, and re-intall them:

$ sudo pacman -Rn yaourt package-query
$ sudo pacman -S fakeroot
$ git clone
$ cd package-query
$ makepkg -si
$ git clone
$ cd yaourt
$ makepkg -si

That’s it!