Debian/Raspbian install QGIS 3.x - build

Re-posted from GIS stackexchange as this is becoming more of a software question.
I'm trying to install QGIS 3.x on Raspbian Stretch with Desktop.
I found this build-from-source guide using this forum post, but my linux-fu is weak.
I followed sections 3.5 and 3.6 of that guide, and then started on section 3.8.
At the dpkg-buildpackage -us -uc -b stage, I get an "unmet build dependencies" error. When trying to sudo apt-get install the missing packages I get several "Unable to locate package" errors (libqscintilla2-qt5-dev, qt3d-assimpsceneimport-plugin, qt3d-defaultgeometryloader-plugin, and qt3d-scene2d-plugin).
I've already added deb https://qgis.org/debian unstable main and deb-src https://qgis.org/debian unstable main to my sources.list file (as per QGIS install page...but now I'm stumped as to what to do.
Do I need to add another source (which one?) to that file, or is it something completely different?

Alternative to building from source.
Issue: with the QGIS install instructions (assuming I followed them correctly) - it was unable to find the python3-qgis package.
Solution: basically use a different mirror than what the install recommends.
Starting from a fresh Raspbian Stretch with Desktop install.
Run: sudo apt-get update
Run: sudo nano /etc/apt/sources.list
Uncomment the deb-src line (not sure this matters).
Add the following line: "deb http://ftp.debian.org/debian sid main" (alternative mirrors can be found here).
Run: sudo apt-get update
Run: sudo apt-get install qgis python3-qgis qgis-plugin-grass
This will install ~300 packages, and can take a while (~4min to download for me). After the download there is a changelog/notice that must be read (keep pressing return then q). Soon after starting the download there is a prompt...once you're past that you should be safe to step away while it installs.
Once done you can launch QGIS (3.4 Madeira LTR as of this writing) by simply typing qgis from the terminal.

Related

How to install FGSL in Ubuntu 20.04?

How to install FGSL in Ubuntu 20.04?
I tried the following :
Add key
sudo apt install curl
curl http://lvserver.ugent.be/apt/xmi.packages.key | sudo apt-key add -
Add repo
deb [arch=amd64] http://lvserver.ugent.be/apt/ubuntu focal stable
deb-src http://lvserver.ugent.be/apt/ubuntu focal stable
to /etc/apt/sources.list file.
Update & install FGSL
sudo apt-get update
sudo apt-get install libfgsl0 libfgsl0-dev libfgsl0-doc
But, it says Unable to locate package.
(I'm not sure about whether I should write this as an answer to my own question or add this as an edit to the question. Yet, I'm chosing to write this as an answer because I feel it's little bit bigger to be added as an edit to the question.)
I found an easier way to install FGSL using Synaptic Package Manager.
Add the key.
Add the repo deb [arch=amd64] http://lvserver.ugent.be/apt/ubuntu focal stable.
(I also found an easier way to add new repo: Open Software & Updates application; select 'Other Softwares'; and then add the repo location.)
Open Ubuntu Software. Search for Synaptic Package Manager and install it.
Now, open Synaptic Package Manager and search 'libfgsl'. Mark the libfgsl packages for installation. (If you haven't installed GSL, then search 'libgsl' and mark the relevant gsl packages also for installation.) Then select 'Apply'.
That's it.
For using FGSL and compiling with gfortran, I found helpful instructions in this post. I used the example program (testintegral.f90, but I saved it as fgsl_test.f90) provided in that post. In my case, the fgsl.mod file was in the location: /usr/include/fgsl/ and I used this command to compile my program
gfortran -I/usr/include/fgsl fgsl_test.f90 -lfgsl
I'm not sure whether it is necessary to add -lgsl and -lgslcblas but it worked fine without them.

How to install libpq-fe.h?

I cannot figure this out for the life of me.
When I pip install django-tenant-schemas it tries to install the dependency psycopg2 which requires the Python headers and gcc. I have all this installed and still keep getting this error!
./psycopg/psycopg.h:35:10: fatal error: libpq-fe.h: No such file or directory
So to install libpq-fe-h I need to sudo apt-get install libpq-dev..
..which returns..
libpq-dev is already the newest version (10.10-0ubuntu0.18.04.1).
Then when I sudo find / libpq-fe.h it doesn't seem to be in my OS.
I am lost at this point. If anyone can help I would highly appreciate it.
For some reason, the file is missing on the system.
As you're using apt-get, the system is dpkg based, presumably Debian or it's derivative. You can try the Ubuntu's package search to get which package contains a file with name ending in libpq-fe.h.
I found the package is libpq-dev and file's absolute path is /usr/include/postgresql/libpq-fe.h.
FWIW, on a dpkg based system, you can check which package gives a file if you know the file's absolute path:
% dpkg -S /usr/include/postgresql/libpq-fe.h
libpq-dev: /usr/include/postgresql/libpq-fe.h
Also, unlike find, locate keeps a cache of found files (mlocate.db) that is created everyday via cron; so if the file happens to be removed after the last run, you can run locate libfq-fe.h to get the absolute path to the file without needing to check the Ubuntu package search online.
So the package is libpq-dev. Now, reinstalling it will get everything to the default state i.e. all relevant files will be copied to the right places. As it is only a library package, no user/system level configurations will be overridden (and dpkg will prompt you for action for any package that does that).
To reinstall the package:
sudo apt-get install --reinstall libpq-dev
For me, I realized it was trying to use the deprecated setup.py so I installed wheel (pip install wheel) and that sorted it all out.
Well after installing these libraries
sudo dnf install python-virtualenv openssl-devel gcc libffi-devel libxslt-devel issue was not gone.
I used mlocate to find where libpq-fe.h file is located. On my system (Fedora 32) it was located at /usr/pgsql-10/include/libpq-fe.h
yum install mlocate
sudo updateb
locate libpq-fe.h
After all added this line to ~/.bash_profile
nano ~/.bash_profile
export PATH=/usr/pgsql-10/bin/:$PATH
Works fine, I can easily install psycopg2 without any trouble.
You need to create a LD_LIBRARY_PATH that indicates the path of your library /user/pgsql-11/lib
Source: The 3rd point of build prerequisites at https://www.psycopg.org/docs/install.html#build-prerequisites

Python (Win 10): Installing matplotlib requires packages "freetype" and "png"?

I've been trying to install Python's matplotlib library for use with PyPlot, for use with Julia. I managed to get everything in place except for this one final library, and I feel as though I've hit a deadend trying to get it working.
When trying to install matplotlib (I've attempted using pip, regular python install, and easy_install), I get the following message at the very end of the install output, after which it is NOT installed:
* The following required packages can not be built:
* freetype, png
Confused about this, I looked around online and installed both of these (at least, what I think these were). One was the freetype project, and the other was LibPng, which was the closest thing I could find to a "png package" for windows or python in general.
This didn't initially work (for either of them), and I read somewhere that I needed a freetype.dll in my system32 folder. It was a long shot, but I went to where I installed freetype and pulled out the dll and renamed it, placing it in system32. This of course did not work (again, long shot).
Anyway, that's where I'm at. No idea where to go from here, and I'm unsure if I even grabbed the correct "packages" I should be using. Thoughts?
Use a more powerful installer
I would recommend to use Anaconda or Miniconda. In my experience with many Windows users, this is the simplest way to install packages such as matplotlib.
Anaconda
Anaconda comes with many packages for scientists. Matplotlib works out of the box. Just install as user not root.
Minoconda
If you don't want all packages of Ananconda use Miniconda
Conda
Both ways of installation (Anaconda or Miniconda) provide conda. It is an improved pip/virtualenv.
You can install matplotilb with this command:
conda install matplotlib
Enviroments:
You can create a new environment and install the packages you like:
conda create -n my_project35 python=3.5
activate my_project35
conda install matplotlib
or
conda create -n my_project27 python=2.7
activate my_project27
conda install matplotlib
Combine with pip
You can still use pip. conda "understands" what it is doing.
One snake is enough!
[This is for folks using the Linux Bash Shell on Windows 10.]
If you don't want to go the Anaconda route, you can install freetype (and png) by executing the following in the Windows 10 Bash shell:
sudo apt-get install freetype6-dev
The above command will also automatically install libpng. However, due to an error, the system will not 'realize' it has installed freetype, so you'll need to manually install pkg-config:
sudo apt-get install pkg-config
Thereafter you should be able to install matplotlib via pip without further incident.
sudo pip install matplotlib
I tired downloading matplotlib 2.2.2 with python 3.9.5, getting freetype & png errors for hours.
After downloading python 3.7.9 and removing python 3.9.5 from environment variables, installing matplotlib 2.2.2 worked with no problems!
Change your Python Version
Go to https://www.python.org/downloads/windows/, control-f search 3.7.9 and use the webinstaller. Follow all the recommended instructions
In pyvenv.cfg in your project directory switch version number to 3.7.9 and home to C:.....\Python37.
pip3 install alpaca-backtrader-api

Install boost version 1.40

I am using a server running with Ubuntu 12.04
I want to install the boost libraries in it. I know
sudo apt-get install libboost-all-dev
will make the work done, but it installs the latest version version 1.52 or above.
But I need to install the particular version 1.40 as there is a problem in a simulator which I am using for my academic purpose. What is the particular command for that so that I can install the boost libraries along with the other requirements for it like the linking files
Thanks in advance
Quick answer: sudo apt-get install libboost-dev= 1.40.0.1
If it doesn't work, continue reading.
The apt-get does support installing a particular version of a package as long as it is in an archive that apt knows about. From the apt-get manpage:
A specific version of a package can be selected for installation by following the
package name with an equals and the version of the package to select. This will
cause that version to be located and selected for install. Alternatively a specific
distribution can be selected by following the package name with a slash and the version of
the distribution or the Archive name (stable, frozen, unstable).
For e.g. if you wanted to install apache 2.20 for Ubuntu, you would do something like:
sudo apt-get install apache2=2.2.20-1ubuntu1
Note that you may need to do some dependency resolution on your own in this case, but if there are any problems apt-get will tell you what is causing them. For e.g.(on 11.04)
sudo apt-get install apache2=2.2.20-1ubuntu1 \
apache2.2-common=2.2.20-1ubuntu1 \
apache2.2-bin=2.2.20-1ubuntu1 \
apache2-mpm-worker=2.2.20-1ubuntu1
Note: You must first check if build 1.40 is still available. For that use:
aptitude search libboost
If aptitude search command don't give you sufficient results, try sudo aptitude update and then run aptitude search again.
You might have to investigate whether debs from earlier Ubuntu versions can be installed. i.e. remove the current package, download the debs and try installing them. But there could be dependency on older versions of the standard library.If so, you can probably try downloading the source from launchpad.
As a last resort, download from boost.org and build it - painfully!
EDIT: I see you have asked the same question on ubuntu forums and it seems that you have 1.48 as the default. You might have to build the library itself. Can you try this apt-get
sudo apt-get install libboost1.40-all-dev=1.40.0-4ubuntu4
If this doesn't work, you will have to build it and install it yourself. You can download the source from
Download source (1.40.0): libboost 1.40.0 source files
After it's installed, run the following command to hold your installed version, preventing the package manager from automatically updating it in the future:
sudo echo "[packagename] hold" | sudo dpkg --set-selections
Source:How to Downgrade Packages on Ubuntu
Generally you download sources, build it (some parts are not just headers like filesystem on Windows). Then you can select which subset of libraries you want to install (you can make compact version with only what you need). Then by invoking bootstrap script you build it to another directory this subset of libraries you want and then you invoke install.
Here is a pretty good description how to do it: http://ubuntuforums.org/showthread.php?t=1180792

Not able to install c++ eclipse indigo after completely uninstalling from ubuntu 11.10

I had installed Indigo eclipse successfully earlier in Ubuntu (Virtual Machine) with following commands:
sudo apt-get install eclipse
sudo apt-get install eclipse-cdt
However, it got messed up when I did an update from its "Install New Software" tab. After running following commands, I removed eclipse completely.
sudo apt-get remove --purge eclipse
sudo apt-get autoremove
sudo rm -rf /usr/bin/eclipse /usr/lib/eclipse/ /usr/share/eclipse /usr/share/man/man1/eclipse.1.gz /etc/eclipse.ini
However, now I want to again install eclipse in my Ubuntu. When I run the above commands, it simply doesn't go well and stop at following execution:
milind#milind-VirtualUbuntuOneiric:~$ sudo apt-get install eclipse
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
eclipse
0 upgraded, 1 newly installed, 0 to remove and 147 not upgraded.
Need to get 0 B/17.3 kB of archives.
After this operation, 131 kB of additional disk space will be used.
WARNING: The following packages cannot be authenticated!
eclipse
Install these packages without verification [y/N]? y
Selecting previously deselected package eclipse.
(Reading database ... 133931 files and directories currently installed.)
Unpacking eclipse (from .../eclipse_3.7.0-0ubuntu1_all.deb) ...
Setting up eclipse (3.7.0-0ubuntu1) ...
milind#milind-VirtualUbuntuOneiric:~$
Trying for so long (with restarting the VBox many times), but no luck. Can you please help me with:
How to install eclipse for C++ (I think indigo) from command line
like earlier I did ?
If command line is not working then what is the latest C++ eclipse site to get it ?
How to install proper CDT for this eclipse so that it can be used
nicely for debugging (which was my root problem) ?
I had a few problems installing from apt recently (Ubuntu 11.10). I eventually ended up downloading a build from here and then installing to a custom location [/home/usrname/programs/eclipse]. This was the only way I could get the marketplace to work.