When I am in my postgres db and tried to create an extension for my db, I get this error
ERROR: could not open extension control file "/usr/share/postgresql/9.5/extension/postgis.control": No such file or directory
I know there are so many posts out there with this error and solutions and I tried them all too. Found so much in stackoverflow but none of them worked.
I realized in my postgresql directory there are 9.2, 9.3, 9.4, 9.5, 9.6,
I went into the directory in the error and I realized there is really no postgis.control inside 9.5
I checked my psql version and showed 9.6.1
I went into 9.6 folder and I DO see a postgis.control in it.
I want to changed the installation directory so when i run
create extension postgis
it would go
"/usr/share/postgresql/9.6/extension/postgis.control"
instead of
"/usr/share/postgresql/9.5/extension/postgis.control"
Can someone please give me a hand?
Thanks in advance.
P.S. Using Ubuntu 14.04 and also have Ubuntu 16.04 as desktop which I haven't try to install postgis yet
You should use the following command:
sudo apt-get install postgresql-9.6-postgis-scripts
Use the following command to get the postgis.control in your 9.5 version directory:
sudo apt install postgis postgresql-9.5-postgis-2.3
Related
I'm having an issue when I try to run the code command from Visual Studio Code in WSL Ubuntu. I get the following error:
$ code .
/mnt/c/Users/Name/.vscode/extensions/ms-vscode-remote.remote-wsl-0.64.2/scripts/wslCode.sh: 63: /mnt/c/Users/Name/.vscode/extensions/ms-vscode-remote.remote-wsl-0.64.2/scripts/wslCode.sh: /home/barry/.vscode/bin/899d46d82c4c95423fb7e10e68eba52050e30ba3/bin/remote-cli/code: not found
When I run the following, it installs the VS Code Server and the command works as expected:
$ /mnt/c/Users/Name/AppData/Local/Programs/Microsoft\ VS\ Code/bin/code .
When I run which -a code, I can see I have two paths related to this command and I believe the correct one is /mnt/c/Users/Name/AppData/Local/Programs/Microsoft VS Code/bin/code, but I don't know how to remove the first one or how it even related two paths to this command in the first place?
barry#RandomName:~$ which -a code
/mnt/c/Program Files/Microsoft VS Code/bin/code
/mnt/c/Users/Name/AppData/Local/Programs/Microsoft VS Code/bin/code
Can anyone help please?
Ran into the same problem 5 min ago and this post from thesteve0 worked for me:
https://github.com/microsoft/vscode-remote-release/issues/6294#issuecomment-1031974516
Quoting from the original post:
Open VS Code on Windows
Open Extensions and then search on WSL
It should say the extension needs to be reloaded - go ahead and reload it
Open WSL and type code
This should force another upgrade of code and this time it should launch.
I've managed to 'solve' it by creating a new Symlink to the correct directory so this one gets run first. I couldn't find a way to remove the incorrect directory so would appreciate it if someone knows a cleaner solution?
To add the Symlink, I ran ln -s /mnt/c/Users/Name/AppData/Local/Programs/Microsoft\ VS\ Code/bin/code /usr/local/bin/code
So now I have these 3 paths for the code command:
$ which -a code
/usr/local/bin/code
/mnt/c/Program Files/Microsoft VS Code/bin/code
/mnt/c/Users/Name/AppData/Local/Programs/Microsoft VS Code/bin/code
Whenever I tried to remove rm or unlink /mnt/c/Program Files/Microsoft VS Code/bin/code (with sudo), I get permission denied.
Just run Vscode normally on windows. This will load wsl extension and solve the issue.
A simple sudo apt update -y and then rerunning code . fixed this for me.
I fixed my issue by opening wsl and removing the .vscode-server
rm -rf .vscode-server
i followed this link link to fix
Keep it simple S*upid method:
Download & install vscode again. link for windows
(Ubuntu example) apt update && yes | apt upgrade
Try to launch code from wsl
You should see something like:
Updating VS Code Server to version 5554b12acf27056905806867f251c859323ff7e9
Removing previous installation...
Installing VS Code Server for x64 (5554b12acf27056905806867f251c859323ff7e9)
In my case the extension in VS Code was not in a state needing reload like in the most upvoted answer. What helped after multiple attempts:
Terminate the WSL2 distribution (from the Windows CLI): wsl -t Ubuntu (replace Ubuntu with your distribution name)
Check that it is stopped: wsl -l -v
Start your WSL distribution again.
In my case the command code started to be accessible through a Windows directory: /mnt/c/Users/username/AppData/Local/Programs/Microsoft VS Code/bin/code
In C:\Users<user>.vscode rename path ms-vscode-remote.remote-wsl- to ms-remote-wsl-old
In WSL run: code .
I got two versions of Visual Studio Code installed, one said "(user)". I uninstalled both and installed the newest version via winget.
That fixed it for me.
I have got two different versions of visual studio code installed on my PC.
I have uninstalled the older version keeping the latest one.
This resolved issue for me.
I have Postgres-XL 10 installed with geos-3.9.1 and postgis-3.1.1 on my Amazon Linux 2 machine. My cluster is running and working flawlessly but I am having troubles with getting postgis installed into the database. I've built and installed everything from source.
The error I'm getting when I run CREATE EXTENSION postgis; is:
ERROR: could not load library "/usr/local/pgsql/lib/postgis-3.so": libgeos_c.so.1: cannot open shared object file: No such file or directory
Using solutions from other posts online, I have tried:
Running sudo ldconfig
Using the --enable-shared option when installing geos and postgis
Ensured /usr/local/lib is in the LD_LIBRARY_PATH environment variable and I also added /usr/local/pgsql/lib to LD_LIBRARY_PATH
None of these solutions worked. I can't install PostGIS or Geos using yum because it will install postgresql 12 which conflicts with my version of postgresql which is a custom one for Postgres-XL.
Is there anything else I can try to solve this error? Any help is appreciated.
Thanks.
It looks like you might need to downgrade. Postgres-XL is only supporting 2.0.x versions of postgis right now. At least according to their docs.
https://www.postgres-xl.org/faq/
Q. Is PostGIS supported?
Yes, PostGIS can be added to Postgres-XL. It has been tested with PostGIS 2.0.
I am trying to write a base type for PostgreSQL in C (using xcode), and I already installed PostgreSQL 11, but it seems that postgres.h cannot be simply included in the file ("'postgres.h' file not found").
Could someone tell me how to fix that problem? And can I write code under an arbitary directory, or do I have to write under the PostgreSQL directory?
Or perhaps the question should be: how to install header files like postgres.h?
Install postgresql-server-dev package with this command:
sudo apt install postgresql-server-dev-XX
Replace [XX] with your already installed version of postgresql:9.5, 10, 11, 12
You have several approaches here:
Search for the file yourself, using some command like
find / -name "postgres.h" -print
this will tell you (on my Mac does) the file is in:
/usr/local/Cellar/postgresql/11.2_1/include/server/postgres.h
and add the -I /usr/local/Cellar/postgresql/11.2_1/include/server option to the compiler. Check your postgresql version for the possibility of having a different one.
Probably there's another package for database development. Search for a package named postgresql-dev or similar, and install it. After searching packages with:
brew search postgres
and
brew search psql
on my system doesn't appear anything that matches.
EDIT
I've checked a FreeBSD system for that file and it appears on
/usr/local/include/postgresql/server/postgres.h
So probably you have to #include <server/postgres.h> instead, and use the appropiate -I flag (as mentioned above)
I was facing the same issue while compiling postgis 3.1.7 for postgresql#13 on my Mac.
The problem was that in pg_config the link to server file was
/opt/homebrew/opt/postgresql#13/include/server
While the actual server folder was in
/opt/homebrew/opt/postgresql#13/include/postgresql/server
So I moved the entire "server" folder up a directory inside "/include". And viola, postgis compiled and installed perfectly.
I am trying to install CKAN on my local computer using Ubuntu 14.04 LTS.
I followed the instructions for installing from source found here and I try to check if solr is running by visiting http://localhost:8983/solr/.
I can see that Jetty is running because when I visit http://localhost:8983 I see that it is up.
I added the jdk as follows:
JAVA_HOME=/usr/lib/jvm/java-1.6.0-openjdk-amd64
I am getting a 500 error when i try to open the solr page:
HTTP ERROR 500
Problem accessing /solr/index.jsp. Reason:
JSP support not configured
Powered by Jetty://
Any ideas? Should I redo the whole thing from the start?
Edit/Update
I just couldn't do anything with this installation. The bigger problem was that installation files were meshed up! I tried to install tomcat/solr instead of jetty/solr and things went sour. So I just created a VM and did a fresh install there. For anyone interested I did a tomcat/solr installation following this and a CKAN installation following this (with out of course the solr instructions). Also, for some reason the CKAN installation has commented out the solr URL, so even if it is right, I had to delete the comment.
A fix has been documented by #mstantoncook here [2939] & [1651] How to solr-jetty JSP support
Note the last comment, sudo service jetty restart
It's a Jetty BUG on Ubuntu 14.04!
There is nothing wrong with Ckan itself.
Actually, there is a bug in the libjetty-extra-java package (version 6.1.26 and newer) in Ubuntu 14.04. The bug was introduced after Jetty (in Ubuntu) has changed it's dependences from libtomcat6-java to libtomcat7-java.
You can get more info about this bug in Ubuntu Launchpad: Bug #1508562 "Broken symlinks for JSP support in libjetty-extra-java version 6.1.26-1ubuntu1.1".
The bug is already fixed on Debian, and I'm hope it will be solved in Ubuntu 14.04 soon.
There are workarounds that may work for your case
I proposed some workarounds in this bug report, and since they can be useful for the Ckan users, I'll also replicate them here.
All of them consist on use both jetty and libtomcat7-java, but adding/replacing some classes (code ported from libtomcat6, in put in the jsp-2.1-6.0.2.jar file) to the Jetty classpath.
I don't know if they have some problem. Use them at your own risk!
Workaround 1 - Install the fix package proposed by vshn
I found this workaround here: https://github.com/ckan/ckan/pull/2966
In short:
wget https://launchpad.net/~vshn/+archive/ubuntu/solr/+files/solr-jetty-jsp-fix_1.0.2_all.deb
dpkg -i solr-jetty-jsp-fix_1.0.2_all.deb
service jetty restart
This will install a JSP jar that works (the file will be named jsp-2.1-6.0.2.jar, but it contains classes ported from libtomcat6).
Workaround 2 - Manually install the JSP jar
Download the same JAR file that the DEB package above would install.
wget https://bugs.launchpad.net/ubuntu/+source/jetty/+bug/1508562/+attachment/4785985/+files/jsp-2.1-6.0.2.jar
Now, move it to a proper location inside the Jetty config dir. I did it this way:
mkdir /etc/jetty/extra-jars
mv jsp-2.1-6.0.2.jar /etc/jetty/extra-jars
And add a line like this one in the Jetty start.config file:
echo "/etc/jetty/extra-jars/jsp-2.1-6.0.2.jar" >> /etc/jetty/start.config
And:
service jetty restart
Correct solution
The correct solution is to wait for the Ubuntu Team solution. However, while waiting for this fix, you can use any of the previous workarounds (I prefer the last one).
I hope they help you!
Try this steps:
sudo mv jsp-2.1-6.0.2.jar /usr/share/jetty/lib/.
change own:
sudo chown root:root /usr/share/jetty/lib/jsp-2.1-6.0.2.jar
finally restart jetty:
sudo service jetty restart
I followed this steps and now I can see localhost:8983/solr and localhost/solr/admin
In Ubuntu 14.04 this can be fixed with:
cd /tmp
wget https://launchpad.net/~vshn/+archive/ubuntu/solr/+files/solr-jetty-jsp-fix_1.0.2_all.deb
sudo dpkg -i solr-jetty-jsp-fix_1.0.2_all.deb
sudo service jetty restart
Following http://docs.ckan.org/en/ckan-1.6/solr-setup.html#single-solr-instance
(this one a bit old, but worked perfect for me )
You will have to edit /etc/profile and add this line to the end such as this to the end (adjusting the path for your machine’s jdk install:
JAVA_HOME=/usr/lib/jvm/java-6-openjdk-amd64/ (or other version)
then
export JAVA_HOME
sudo service jetty start
I am trying to use the static binary of wkhtmltopdf on Ubuntu server 10.0.4. The reason for is that it apparently has a built in modified QT that will allow me to run wkhtmltopdf without an X Server.
Result:
Once installed (see steps below), when I execute wkhtmltopdf in the terminal, it does not fire up... just returns me to the prompt - like it ran and did something, no error but no output:
:/usr/bin$ wkhtmltopdf
:/usr/bin$
Same behavior if I put args:
:/usr/bin$ wkhtmltopdf http://www.google.com test.pdf
:/usr/bin$
Am I doing something wrong --- my understanding that the static binary should just fire up. Perhaps missing some dependency? Is there a way to get some verbose output?
These are the steps I have followed:
In /usr/bin:
1) Confirmed that the existing (non-static) wkhtmltopdf resides there and that it executes. When I execute it with no args I get the help/about output from the app.
2) Moved the existing wkhtmltopdf out of the directory (renamed it)
3) Get the static binary: sudo curl -C - -O http:
//wkhtmltopdf.googlecode.com/files/wkhtmltopdf-0.9.9-static-i386.tar.bz2
4) Untar: tar xvjf wkhtmltopdf-0.9.9-static-i386.tar.bz2
5) Rename: mv wkhtmltopdf-i386 wkthtmltopdf
6) Get (apparently) necessary packages: sudo apt-get install openssl build-essential xorg libssl-dev
I was having the same problem. I removed the existing wkhtmltopdf and followed the steps below and the installation worked.
First, installing dependencies
sudo aptitude install openssl build-essential xorg libssl-dev
for 64-bit OS
wget http://wkhtmltopdf.googlecode.com/files/wkhtmltopdf-0.9.2-static-amd64.tar.bz2
tar xvjf wkhtmltopdf-0.9.2-static-amd64.tar.bz2
chown root:root wkhtmltopdf-amd64
mv wkhtmltopdf-amd64 /usr/bin/wkhtmltopdf
The only difference is that I put it in /usr/local/bin/wkhtmltopdf.
I hope this helps!
Following deb's answer got it working for me on Ubuntu 10.04 64bit - thanks!
Although rather than downloading 0.9.2 as per deb's instructions, I would suggest people download the latest version by:
Go to http://code.google.com/p/wkhtmltopdf/downloads/list
Download the latest version of wkhtmltopdf-[version number]-static-amd64.tar.bz2
At this time, the latest 64bit is http://wkhtmltopdf.googlecode.com/files/wkhtmltopdf-0.11.0_rc1-static-amd64.tar.bz2.
In my debian server trying to run wkhtmltopdf-i386 lead to same blank prompt.
Non-static (with non-patched QT) version of wkhtmltopdf installed with "aptitude install wkhtmltopdf" is worked.
Problem solved by switching to wkhtmltopdf-amd64, server was a 64 bit and i missed it.
After that, wkhtmltopdf-amd64 says 'libxrender shared library not found', this problem was solved by "aptitude install xorg"
0.11.0_rc1 seems to be buggy.
It keeps throwing the error "Cannot create a QPixmap when no GUI is being used".
Reverting to 0.9.9 worked for me.