osm2pgsql Protobuf not Found: Centos - linux

The Problem:
I have a program I am installing from source. When I run ./configure, it stops saying "no protobuf development libraries found", however, protobuf is installed on my system.
How do I specify the path to those libraries when I run ./configure?
The program I am trying to install is osm2pgsql on CentOS 6.6.

Update:
I fixed the problem fortunately.
What Happened?:
osm2pgsql uses pkg-config to point to dependent libraries. On CentOS 7 pkg-config uses this directory /usr/share/pkgconfig/. Within this directory there are .pc files for different programs. These files are used by pkg-config to show where libraries of certain programs are located. When you install protobuf from package manager or source the installation doesn't automatically let pkg-config know where the libraries are at via a .pc file.
The Fix:
Install protobuf from source from their git page. After you've ran make install there will be several .pc files within the cloned directory. You need to place these in /usr/share/pkgconfig. To do this run the following in the cloned directory:
sudo cp protobuf.pc* /usr/share/pkgconfig/
sudo cp protobuf-lite.pc* /usr/share/pkgconfig/
Conclusion:
Ta Da! Now go back to your osm2pgsql install folder and rerun ./configure.

Related

Install dotnet core on ec2 linux AMI 2 (c6g)

I am trying to install dotnet-sdk-3.0 on linux AMI 2 ec2 instance (c6g). I am new to linux so tried couple of commands but nothing seems working for me. I tried below.
sudo rpm -Uvh https://packages.microsoft.com/config/centos/7/packages-microsoft-prod.rpm
sudo yum install dotnet-sdk-3.1
sudo yum install dotnet-sdk-3.0
When tried above i am getting below error.
[ec2-user#ip-0-0-0-0 console]$ sudo yum install dotnet-sdk-3.0
Loaded plugins: extras_suggestions, langpacks, priorities, update-motd
amzn2-core | 3.7 kB 00:00
amzn2extra-docker | 3.0 kB 00:00
amzn2extra-nginx1.12 | 1.3 kB 00:00
packages-microsoft-com-prod | 3.0 kB 00:00
packages-microsoft-com-prod/primary_db | 288 kB 00:00
No package dotnet-sdk-3.0 available.
Error: Nothing to do
Then i tried
mkdir -p "$HOME/dotnet" && tar zxf dotnet-sdk-3.0.100-linux-x64.tar.gz -C "$HOME/dotnet"
export DOTNET_ROOT=$HOME/dotnet
export PATH=$PATH:$HOME/dotnet
After this tried the dotnet command but got the error. dotnet: command not found
Finally tried below:
mkdir -p $HOME/dotnet && tar zxf dotnet-sdk-3.1.302-linux-arm64.tar.gz -C $HOME/dotnet
export DOTNET_ROOT=$HOME/dotnet
export PATH=$PATH:$HOME/dotnet
dotnet
dotnet --list-sdk
when i run this, i got below error
[ec2-user#ip-0-0-0-0 home]$ dotnet --list-sdk
Process terminated. Couldn't find a valid ICU package installed on the system. Set the configuration flag System.Globalization.Invariant to true if you want to run with no globalization support.
at System.Environment.FailFast(System.String)
at System.Globalization.GlobalizationMode.GetGlobalizationInvariantMode()
at System.Globalization.GlobalizationMode..cctor()
at System.Globalization.CultureData.CreateCultureWithInvariantData()
at System.Globalization.CultureData.get_Invariant()
at System.Globalization.CultureInfo..cctor()
at System.String.ToLowerInvariant()
at Microsoft.DotNet.PlatformAbstractions.RuntimeEnvironment.GetArch()
at Microsoft.DotNet.PlatformAbstractions.RuntimeEnvironment..cctor()
at Microsoft.DotNet.PlatformAbstractions.RuntimeEnvironment.GetRuntimeIdentifier()
at Microsoft.DotNet.Cli.MulticoreJitProfilePathCalculator.CalculateProfileRootPath()
at Microsoft.DotNet.Cli.MulticoreJitActivator.StartCliProfileOptimization()
at Microsoft.DotNet.Cli.MulticoreJitActivator.TryActivateMulticoreJit()
at Microsoft.DotNet.Cli.Program.Main(System.String[])
Aborted
also tried to run the dotnet <dotnet-project.dll> and received this error.
Failed to load â–’râ–’), error: /home/ec2-user/dotnet/shared/Microsoft.NETCore.App/3.0.0/libhostpolicy.so: cannot open shared object file: No such file or directory
An error occurred while loading required library libhostpolicy.so from [/home/ec2-user/dotnet/shared/Microsoft.NETCore.App/3.0.0]
[ec2-user#ip-0-0-0-0 console]$
I have followed the microsoft document as well.
https://learn.microsoft.com/en-us/dotnet/core/install/linux-centos
Nothing seems working for me. Can someone please help me here, i am stuck from last 2 days.
Thanks in advance.
PS: I am completely newbie to linux.
I was able to get this to work on Amazon Linux 2 ARM64 with the following steps:
Download and build a recent version of International Components for Unicode. Amazon Linux 2 has version 50 available in the package manager, but dotnet looks for version 55 or later. When Amazon Linux updates this, this step won't be necessary anymore and can be replaced with sudo yum install icu.
Install gcc and python3 because they'll be needed for building libicu. It takes a few minutes to build the library. Amazon Linux 2 recently added libicu60 to the package manager, so you can simply install it with yum:
sudo yum -y install libicu60
Follow the instructions from Microsoft to install the dotnet sdk. Download the dotnet sdk from the Microsoft Website. You may need to download from this link to get the latest version, but the link below worked for me.
cd ~
wget https://download.visualstudio.microsoft.com/download/pr/5ee48114-19bf-4a28-89b6-37cab15ec3f2/f5d1f54ca93ceb8be7d8e37029c8e0f2/dotnet-sdk-3.1.302-linux-arm64.tar.gz
mkdir -p $HOME/dotnet && tar zxf ~/dotnet-sdk-3.1.302-linux-arm64.tar.gz -C $HOME/dotnet
export DOTNET_ROOT=$HOME/dotnet
export PATH=$PATH:$HOME/dotnet
Test that it's working
[ec2-user#ip-172-31-69-243 ~]$ dotnet --list-sdks
3.1.302 [/home/ec2-user/dotnet/sdk]
You are running this on arm64/aarch64. It's a relatively new architecture. It's also incompatible with the Intel 64-bit architecture (x86_64 or x64). So you need to watch out for that.
Installing via RPM
Edit: So, this is just not going to work if you want to use RPM packages.
Quoting https://learn.microsoft.com/en-us/dotnet/core/install/linux-centos:
Package manager installs are only supported on the x64 architecture. Other architectures, such as ARM, must manually install the .NET Core SDK or .NET Core Runtime. For more information, see the manually install section below.
You are using aarch64/arm64. You are not using x64, so this is not going to work.
You need to use the tarball installation method.
Out of date suggestions:
I am trying to install dotnet-sdk-3.0 on linux AMI 2 ec2 instance (c6g).
sudo rpm -Uvh https://packages.microsoft.com/config/centos/7/packages-microsoft-prod.rpm
You are running Amazon Linux 2, right? As the URL here says, this is for CentOS 7. It may (or it may not) work on your Linux distribution. Anyway, try it out.
$ sudo yum install dotnet-sdk-3.0
No package dotnet-sdk-3.0 available.
Error: Nothing to do
The error says that it can't find this package. Maybe a package with this name doesn't exist? Maybe you are using the wrong name? Try using yum list to find the correct name:
sudo yum list 'dotnet-sdk*'
It should show you a list of packages, including names like dotnet-sdk-3.0.103. You can install that package by name, then:
sudo yum install dotnet-sdk-3.0.103
If that doesn't work, try another package name from yum list and try installing that.
Installing manually
Then i tried
mkdir -p "$HOME/dotnet" && tar zxf dotnet-sdk-3.0.100-linux-x64.tar.gz -C "$HOME/dotnet"
export DOTNET_ROOT=$HOME/dotnet
export PATH=$PATH:$HOME/dotnet
After this tried the dotnet command but got the error. dotnet: command not found
You are running an aarch64 machine. You need to use the arm64 tarball, not the x64 tarball. The x64 tarball is for an Intel processor. It will not work on an ARM processor.
That's surprising. Let me break down what this set of steps is doing:
mkdir -p "$HOME/dotnet" creates a directory named dotnet in your home directory
tar xf ... extracts the dotnet SDK tarball in the dotnet directory you created in step 1
export DOTNET_ROOT=$HOME/dotnet defines an environment variable DOTNET_ROOT. .NET Runtime needs it; I am a bit fuzzy myself on why
export PATH=$PATH:$HOME/dotnet adds the directory you installed the .NET SDK into to the environment variable PATH. PATH is a list of locations that the OS uses to search for a command that you enter. For example, when you type dotnet in the command line it searches for dotnet executable (think dotnet.exe on Windows) in this list of directories.
So let's try and debug it one by one:
Does the directory dotnet exist in your main home directory (aka $HOME)? Can you cd ~/dotnet? Does that work?
After you extract the tarball, do you see a file named dotnet in the dotnet directory in your $HOME? Does ls $HOME/dotnet/dotnet work? What does it show you?
What does echo $PATH show you? Does it include that dotnet directory in the value?
If you run which dotnet, does it find the dotnet executable in your main $HOME directory?
Running the SDK
when i run this, i got below error
[ec2-user#ip-0-0-0-0 home]$ dotnet --list-sdk
Process terminated. Couldn't find a valid ICU package installed on the system. Set the configuration flag System.Globalization.Invariant to true if you want to run with no globalization support
The error includes this phrase: Couldn't find a valid ICU package installed on the system.
It really means that. You need to install the ICU package for your Linux distribution:
sudo yum install libicu
And then try running dotnet --list-sdk again.
Error Running dll
Failed to load â–’râ–’), error: /home/ec2-user/dotnet/shared/Microsoft.NETCore.App/3.0.0/libhostpolicy.so: cannot open shared object file: No such file or directory
An error occurred while loading required library libhostpolicy.so from [/home/ec2-user/dotnet/shared/Microsoft.NETCore.App/3.0.0]
This is strange. It says it can't find a file that should be part of the .NET Core installation.
What does dotnet --list-runtimes say? Does it show the 3.0.0 runtime installed? If not, that means your installation is messed up. You should probably install .NET Core 3.0 again. (Or better yet, install 3.1 because 3.0 has been end-of-life'd).
Does the file /home/ec2-user/dotnet/shared/Microsoft.NETCore.App/3.0.0/libhostpolicy.so exist? If it doesn't it's the same problem as above: your installation is messed up.
What does file /home/ec2-user/dotnet/shared/Microsoft.NETCore.App/3.0.0/libhostpolicy.so say? Is it an ELF 64-bit LSB shared object?
The output is: ELF 64-bit LSB shared object, x86-64
This is a x86-64 file! In other words, you have (somehow) installed an linux-x64 (Intel 64-bit architecture) runtime. Not too surprisingly, it doens't work on the ARM 64 bit architecture. You need to delete this and re-install the SDK. I suggest just blowing away your current installation (rm -rf $HOME/dotnet) and install the linux-arm64 SDK again.

Compiling Cairo-dock errors on GTK dependency

I've Redhat 7.2 running Cinnamon, and hate the docks provided, how come I can't resize the area a widgit is allocated? All apps are jammed into half the dock.
Drives me to compile cairo-dock from source as it isn't an ibm redhat blessed package.
cmake .. -DCMAKE_INSTALL_PREFIX=/usr
...
-- checking for module 'wayland-client>=1.0.0'
-- package 'wayland-client>=1.0.0' not found
-- checking for module 'gtk+-3.0>=3.4.0'
-- package 'gtk+-3.0>=3.4.0' not found
so I find gtk version is 3.14.13-16.el7 using yum list installed "gtk*"
I downloaded gtk 3.4.4 and compiled it and follow the INSTALL provided, sudo make install, which completes with no errors
rerunning cmake gives me the same error, so I'm wondering if I had to remove 3.14? I'm not really sure how best to proceed and thought it best to get some advice. I'm not really in the mood to break things. Thanks for your time and consideration.
Calvin, I'm also IBMer and installed RHEL7.2 from IBM's image.
I could successfully download the sources and install Cairo Docker and respective plugins.
I followed the instructions in this page here:
Glx-Dock - Generic:Compilation
First, install all dependencies below from official IBM repository.
I used the same package names for the Fedora dependencies and some may NOT exist for RHEL. Therefore, some plugins won't be available by fetching dependencies from official repository only - but the Cairo Docker will work.
sudo yum install cmake make pkgconfig gcc gcc-c++ gettext glib2-devel\
cairo-devel librsvg2-devel dbus-glib-devel libxml2-devel libXrender-devel\
mesa-libGL-devel mesa-libGLU-devel pango-devel libXxf86vm-devel\
libXtst-devel libXrandr-devel libX11-devel libcurl-devel gtk3-devel\
vte3-devel lm_sensors-devel libxklavier-devel libexif-devel\
libetpan-devel gnome-menus-devel alsa-lib-devel libical-devel\
upower-devel libzeitgeist-devel
Untar the packages and build with the commands described there except that you need to force the lib64 in both main and plugin builds with:
cmake .. -DCMAKE_INSTALL_PREFIX=/usr -DFORCE_LIB64=yes

libmnl Issue while installing libnetfilter queue in linux

I am trying to install libnetfilter_queue on Suse Linux. But after the
./configure step it shows
error: Package requirements (libmnl >= 1.0.3) were not met
No package 'libmnl' found
I am new to Linux and all the solutions which are available on the web, I don't know how to use them.
How can I fix this problem?
It is a common problem to the people working in computer networking in linux environments.
Go to the below link and download the latest libmnl file.
http://www.netfilter.org/projects/libmnl/downloads.html#libmnl-1.0.3
Unzip it using the below command
tar -xvf libmnl-1.0.3.tar.bz2
cd to the extracted folder
cd libmnl-1.0.3/
Install libmnl
./configure
make
sudo make install
Then you can install the libnetfilter_queue library.

How to specify dependency location in rpm?

While installing Mono using RPM, GLIBC_2.16 is listed as a dependency. Since I'm having an older version of glibc, and didn't want to corrupt my kernel, i installed the newer glibc from sources in my home folder.
I now want the RPM to refer to this newer glibc lib directory in my home folder while installing mono. What is the RPM option for mentioning dependency locations for a package?
I am currently using the following RPM command:
sudo rpm -ivh mono-core-3.2.3-0.x86_64.rpm
I get the following error messages:
libc.so.6(GLIBC_2.14)(64bit) is needed by mono-core-3.2.3-0.x86_64
libc.so.6(GLIBC_2.15)(64bit) is needed by mono-core-3.2.3-0.x86_64
libc.so.6(GLIBC_2.16)(64bit) is needed by mono-core-3.2.3-0.x86_64
My newer glibc path is:
~/Desktop/glibc/glibc1/lib
What option should i include in rpm to reference this path while installing mono?
Thanks
I guess there is no way to install the package without --nodeps unless you install the proper version of glibc in your system.
If your goal is to run mono command completely, it may work fine by the following steps.
Installing the package by adding the --nodeps option to rpm command to ignore any dependencies.
Running mono-related commands with LD_LIBRARY_PATH set to /your/alternative/path/to/glibc.
However, I think that the best solution is to build the mono's source on your machine.

How can I (is it possible to) install mysql workbench locally?

I want to install a mysql workbench binary locally on my linux machine because I don't have sudo rights. I did this when I installed python using --prefix. Can this also be done with mysql workbench?
Yes, you can, provided that you are willing to compile Workbench from sources. You are advised however that you'll need sudo rights to install its compilation dependencies. Here are the steps:
Download Workbench's sources from the official download site. You should download the version tagged "Generic Linux (Architecture Independent), Compressed TAR Archive".
Uncompress the downloaded source file. From the linux terminal:
$ tar -zxvf mysql-workbench-whatever.tar.gz
Move to the directory with Workbench's source code:
cd mysql-workbench-whatever
Read the INSTALL file located in this directory to find out the required packages that you would need to install in order to compile Workbench. For Ubuntu here's the command to install them:
$ sudo apt-get install build-essential autoconf automake libtool libzip-dev libxml2-dev libsigc++-2.0-dev libglade2-dev libgtkmm-2.4-dev libglu1-mesa-dev libgl1-mesa-glx mesa-common-dev libmysqlclient15-dev uuid-dev liblua5.1-dev libpixman-1-dev libpcre3-dev libgnome2-dev libgtk2.0-dev libpango1.0-dev libcairo2-dev python-dev libboost-dev
Run autogen.sh with the path to where you want Workbench installed:
$ ./autogen.sh --prefix=~/bin/wb52
(The above command will get your Workbench's binaries in the directory bin/wb52 within your home directory once compiled). Just change the destination dir to whatever you like.
Compile and install MySQL Workbench:
$ make install
This will take some time (maybe half an hour depending on your system). If you have more than one CPU core available you should use, for instance:
$ make -j3 install
and this will use three cores for compilation (adjust the number of cores to whatever you find reasonable for your system).
Once compiled you can run Workbench's executable that will be located inside a bin directory within the path you set in step 5.
Have a lot of fun!

Resources