DEV Community

Sam Erickson
Sam Erickson

Posted on

Installing diesel_cli on OpenSUSE Tumbleweed

I recently ran into some issues installing diesel_cli on openSUSE. I wanted to use the package with postgres only so I tried entering the following command from their getting started page:

# The package that is required according to the docs
zypper install libpq5
cargo install diesel_cli --no-default-features --features postgres
Enter fullscreen mode Exit fullscreen mode

Then I get met with this fun error message:
Image of errors in a terminal.
The last few lines are of interest:

= note: /usr/lib64/gcc/x86_64-suse-linux/13/../../../../x86_64-suse-linux/bin/ld: cannot find -lpq: No such file or directory
          collect2: error: ld returned 1 exit status
Enter fullscreen mode Exit fullscreen mode

I started just installing all packages that I could find using zypper search that related to postgres and tried the installation process of diesel_cli after each one. Eventually, after much trial and error I found the missing package:

sudo zypper install ghc-postgresql-libpq-devel
Enter fullscreen mode Exit fullscreen mode

After installing this I was able to build diesel.

Top comments (0)