Can not upgrade postgis 2.5 to 3.0.1 for postgresql 11 on ubuntu - postgis

I need to upgrade my PostgreSQL 11 to PostgreSQL 12 with PostGIT 2.5 to 3.0.1.
I tried to install PostGIS 3 for PostgreSQL 11 on Ubuntu server to upgrade PostGIS first, before upgrading PostgreSQL.
I run
apt-get install postgresql-10-postgis-3
and get the error:
The following NEW packages will be installed:
postgresql-10-postgis-3 postgresql-10-postgis-3-scripts
0 upgraded, 2 newly installed, 0 to remove and 403 not upgraded.
Need to get 1,883 kB of archives.
After this operation, 30.0 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://apt.postgresql.org/pub/repos/apt xenial-pgdg/main amd64 postgresql-10-postgis-3-scripts all 3.0.1+dfsg-4.pgdg16.04+1 [1,052 kB]
Get:2 http://apt.postgresql.org/pub/repos/apt xenial-pgdg/main amd64 postgresql-10-postgis-3 amd64 3.0.1+dfsg-4.pgdg16.04+1 [831 kB]
Fetched 1,883 kB in 19s (97.0 kB/s)
Selecting previously unselected package postgresql-10-postgis-3-scripts.
(Reading database ... 175146 files and directories currently installed.)
Preparing to unpack .../postgresql-10-postgis-3-scripts_3.0.1+dfsg-4.pgdg16.04+1_all.deb ...
Unpacking postgresql-10-postgis-3-scripts (3.0.1+dfsg-4.pgdg16.04+1) ...
dpkg: error processing archive /var/cache/apt/archives/postgresql-10-postgis-3-scripts_3.0.1+dfsg-4.pgdg16.04+1_all.deb (--unpack):
trying to overwrite '/usr/share/postgresql/10/applications/shp2pgsql-gui.desktop', which is also in package postgresql-10-postgis-2.5-scripts 2.5.4+dfsg-1.pgdg16.04+1
dpkg-deb: error: subprocess paste was killed by signal (Broken pipe)
Selecting previously unselected package postgresql-10-postgis-3.
Preparing to unpack .../postgresql-10-postgis-3_3.0.1+dfsg-4.pgdg16.04+1_amd64.deb ...
Unpacking postgresql-10-postgis-3 (3.0.1+dfsg-4.pgdg16.04+1) ...
Processing triggers for postgresql-common (216.pgdg16.04+1) ...
Building PostgreSQL dictionaries from installed myspell/hunspell packages...
en_us
Removing obsolete dictionary files:
Errors were encountered while processing:
/var/cache/apt/archives/postgresql-10-postgis-3-scripts_3.0.1+dfsg-4.pgdg16.04+1_all.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
Anybody faced such issue? Any hint is appreciated.

Related

installing lalsuite to conda

im trying to install lalsuite on conda https://github.com/conda-forge/lalsuite-feedstock
attempt 1 = conda-forge
(base) C:\Users\jack.flavell>conda install -c conda-forge lalsuite
Collecting package metadata (current_repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Solving environment: failed with repodata from current_repodata.json, will retry with next repodata source.
Collecting package metadata (repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Solving environment: /
Found conflicts! Looking for incompatible packages.
This can take several minutes. Press CTRL-C to abort.
Examining python=3.9: 100%|██████████████████████████████████████████████████████████████| 4/4 [00:01<00:00, 3.56it/s]- |failed
UnsatisfiableError: The following specifications were found to be incompatible with each other:
Output in format: Requested package -> Available versions
doesn't work + it states some packages aren't compatible but doesn't say which.
attempt 2 = messing with channels
(base) C:\Users\jack.flavell>conda config --add channels conda-forge
(base) C:\Users\jack.flavell>conda config --set channel_priority strict
(base) C:\Users\jack.flavell>conda install lalsuite
Collecting package metadata (current_repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Solving environment: failed with repodata from current_repodata.json, will retry with next repodata source.
Collecting package metadata (repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Solving environment: /
Found conflicts! Looking for incompatible packages.
This can take several minutes. Press CTRL-C to abort.-
failed
UnsatisfiableError: The following specifications were found to be incompatible with each other:
Output in format: Requested package -> Available versions
Note that strict channel priority may have removed packages required for satisfiability.
result from 2 ,similar to 1.
attempt 3 = use conda forge as part of my create env command
(base) C:\Users\jack.flavell>conda create -n gwe3 -c conda-forge -c lalsuite
Collecting package metadata (current_repodata.json): done
Solving environment: done
UnavailableInvalidChannel: The channel is not accessible or is invalid.
channel name: lalsuite
channel url: https://conda.anaconda.org/lalsuite
error code: 404
You will need to adjust your conda configuration to proceed.
Use `conda config --show channels` to view your configuration's current state,
and use `conda config --show-sources` to view config file locations.
so i do what message said in attempt 3
(base) C:\Users\jack.flavell>conda config --show channels
channels:
- conda-forge
- defaults
and no idea what to do next...
any idea how to install lalsuite? please?
##########################
extra info
ive tried python 2.7, 3.6, 3.10
ive read about many compatibility issus with lalsuite. eg no pip version < 18.
And so below is information about my environment from conda. it seems within the parameters ive seen around.
package
build
bzip2-1.0.8
h8ffe710_4 149 KB conda-forge
ca-certificates-2022.9.24
h5b45459_0 189 KB conda-forge
libffi-3.4.2
h8ffe710_5 41 KB conda-forge
libsqlite-3.39.4
hcfcfb64_0 642 KB conda-forge
libzlib-1.2.12
hcfcfb64_4 71 KB conda-forge
openssl-3.0.5
hcfcfb64_2 7.8 MB conda-forge
pip-22.2.2
pyhd8ed1ab_0 1.5 MB conda-forge
python-3.10.6
hcf16a7b_0_cpython 16.5 MB conda-forge
setuptools-65.4.1
pyhd8ed1ab_0 776 KB conda-forge
tk-8.6.12
h8ffe710_0 3.5 MB conda-forge
tzdata-2022d
h191b570_0 118 KB conda-forge
ucrt-10.0.20348.0
h57928b3_0 1.2 MB conda-forge
vc-14.2
hac3ee0b_8 14 KB conda-forge
vs2015_runtime-14.29.30139
h890b9b1_8 1.2 MB conda-forge
wheel-0.37.1
pyhd8ed1ab_0 31 KB conda-forge
xz-5.2.6
h8d14728_0 213 KB conda-forge
##############
update
attempt 4
I thought using conda install -c "conda-forge/label/cf202003" lalsuite would point specifically to a version, and so shouldn't fail. I got the link from here https://anaconda.org/conda-forge/lalsuite
however the output I get is
(wge3) C:\Users\jack.flavell>conda install -c "conda-forge/label/cf202003" lalsuite
Collecting package metadata (current_repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Solving environment: failed with repodata from current_repodata.json, will retry with next repodata source.
Collecting package metadata (repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Solving environment: \
Found conflicts! Looking for incompatible packages.
This can take several minutes. Press CTRL-C to abort.
failed
UnsatisfiableError: The following specifications were found to be incompatible with each other:
Output in format: Requested package -> Available versions
Note that strict channel priority may have removed packages required for satisfiability.
conda search confirms the package is there...
(wge4) C:\Users\jack.flavell>conda search lalsuite
Loading channels: done
# Name Version Build Channel
lalsuite 6.57 py_1 conda-forge
lalsuite 6.60 py_0 conda-forge
................
why the bloody hell does this not work?
what does it want?
what more info might help answer
arrrrrgggghhhhh >:(
######## update 2
I was under the impression that anything on pypi can be downloaded with pip. like here https://pypi.org/project/lalsuite/.
Below is just in a regular cmd not using conda
C:\Users\jack.flavell>"C:\Users\jack.flavell\AppData\Local\Programs\Python\Python37\Scripts\pip.exe" install lalsuite
ERROR: Could not find a version that satisfies the requirement lalsuite (from versions: none)
ERROR: No matching distribution found for lalsuite
WARNING: You are using pip version 20.1.1; however, version 22.2.2 is available.
You should consider upgrading via the 'c:\users\jack.flavell\appdata\local\programs\python\python37\python.exe -m pip install --upgrade pip' command.
... apparently not ...
should things be available on pip if i find them on pypi?
turns out it doesnt work on windows,i need linux

Unable to connect Microsoft SQL-Server and Visual Studio code

I just installed MSSQL 2017 for linux and Visual Studio code for linux on my Ubuntu 18.10 machine.
Both the installation succeeded, but I cannot connect from visual studio to the DB.
I have the following running drivers:
$ odbcinst -j
unixODBC 2.3.7
DRIVERS............: /etc/odbcinst.ini
SYSTEM DATA SOURCES: /etc/odbc.ini
FILE DATA SOURCES..: /etc/ODBCDataSources
USER DATA SOURCES..: /home/neo4j/.odbc.ini
SQLULEN Size.......: 8
SQLLEN Size........: 8
SQLSETPOSIROW Size.: 8
but, when I try to install
$ sudo apt-get install mssql-tools unixodbc-dev
I receive the following error:
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
mssql-tools : Depends: msodbcsql17 (>= 17.3.0.0) but it is not going to be installed
Depends: msodbcsql17 (< 17.4.0.0) but it is not going to be installed
unixodbc-dev : Depends: unixodbc (= 2.3.7)
E: Unable to correct problems, you have held broken packages.
after a lot of googling, i found a lot of suggestions, but they doesn't run, like try to remove msodbcsql and unixodbc
$ sudo apt-get remove msodbcsql
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package 'msodbcsql' is not installed, so not removed
0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded.
At this point I'm locked and not able to go ahead.
Has anyone some running solution?
You only need unixodbc-dev if you plan on doing unixodbc-dev development (not required for database connectivity). I'm guessing you can leave it out to avoid confusion here.
And msodbcsql and msodbcsql17 are different packages. msodbcsql (MS ODBC Driver 13 for SQL Server) isn't even available on Ubuntu 18.10.
The key in your problem is the error message:
E: Unable to correct problems, you have held broken packages.
You need to remove the hold on the broken package. First, I'd try specifically installing msodbcsql17:
sudo apt-get install msodbcsql17
If you still get an error, there are other steps you can take to try to fix the problem of held packages:
https://askubuntu.com/a/223267

(Postgrex.Error) ERROR 58P01 (undefined_file) $libdir/postgis-2.4

I had to brew reinstall some things that my existing project uses.
Now I'm getting this error when I'm running a SELECT statement:
Interactive Elixir (1.7.4) - press Ctrl+C to exit (type h() ENTER for help)
iex(1)>
18:07:23.636 [debug] QUERY ERROR source="shops" db=5.4ms
SELECT s0."id", s0."name", s0."place_id", s0."point", s0."inserted_at", s0."updated_at",ST_Distance_Sphere(s0."point", ST_SetSRID(ST_MakePoint($1,$2), $3)) FROM "shops" AS s0 WHERE (ST_DWithin(s0."point"::geography, ST_SetSRID(ST_MakePoint($4, $5), $6), $7)) ORDER BY s0."point" <-> ST_SetSRID(ST_MakePoint($8,$9), $10) [176.1666197, -37.6741546, 4326, 176.1666197, -37.6741546, 4326, 2000, 176.1666197, -37.6741546, 4326]
18:07:23.666 [error] #PID<0.356.0> running Api.Router terminated
Server: 192.168.20.9:4000 (http)
Request: GET /products?categories[]=1&categories[]=2&categories[]=3&categories[]=4&categories[]=5&categories[]=6&categories[]=7&categories[]=8&categories[]=9&categories[]=10&categories[]=11&categories[]=12&categories[]=13&categories[]=14&categories[]=15&categories[]=16&categories[]=17&categories[]=18&categories[]=19&categories[]=20&categories[]=21&categories[]=22&categories[]=23&categories[]=24&categories[]=25&keyword=%22%22&latitude=-37.6741546&longitude=176.1666197&distanceFromLocationValue=2&distanceFromLocationUnit=%22kilometers%22
** (exit) an exception was raised:
** (Postgrex.Error) ERROR 58P01 (undefined_file): could not access file "$libdir/postgis-2.4": No such file or directory
(ecto) lib/ecto/adapters/sql.ex:436: Ecto.Adapters.SQL.execute_and_cache/7
(ecto) lib/ecto/repo/queryable.ex:130: Ecto.Repo.Queryable.execute/5
(ecto) lib/ecto/repo/queryable.ex:35: Ecto.Repo.Queryable.all/4
(api) lib/api/controllers/product/get_product.ex:46: Api.Controllers.GetProduct.get_products/1
(api) lib/api/router.ex:1: Api.Router.plug_builder_call/2
(api) lib/plug/debugger.ex:123: Api.Router.call/2
(plug) lib/plug/adapters/cowboy/handler.ex:15: Plug.Adapters.Cowboy.Handler.upgrade/4
(cowboy) /Users/Ben/Development/Projects/vepo/api/deps/cowboy/src/cowboy_protocol.erl:442: :cowboy_protocol.execute/4
It is complaining about PostGis. I did brew install postgis to install it again. Still getting the error. Where is $libdirdirectory in my macbook so that I can view the files? How do I fix this error?
The issue was that my versions of postGis and postgresql were incompatible (I had used brew install xxx to get them both).
So I just uninstalled all postgresql and postgis versions from my computer: brew uninstall postgresql and brew uninstall postgis
brew list still listed one version of postgresql:
postgresql9.4
So I uninstalled that version:
brew uninstall postgresql9.4
Then I used postgres.app downloads to download and install postgresql and postgis, because it gets them both together and they are always compatible.
I specifically went for the "Legacy Postgres.app with PostgreSQL 10" download because that is what I was using all through my development on this app.
Use instructions at https://postgresapp.com/ to install it after it is downloaded.

How to install Snapper on Ubuntu 16.04 Server using BTRFS as file system

I am having some difficulty installing Snapper(http://snapper.io/) on Ubuntu Server 16.04.
When I follow instructions from Snapper for Ubuntu 16.04, I am getting the below error:
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
libsnapper
0 upgraded, 1 newly installed, 0 to remove and 41 not upgraded.
Need to get 197 kB of archives.
After this operation, 674 kB of additional disk space will be used.
Err:1
(download.opensuse.org/repositories/filesystems:/snapper/xUbuntu_16.04 libsnapper 0.5.1 Protocol "http" not supported or disabled in libcurl
E: Failed to fetch)
(download.opensuse.org/repositories/filesystems:/snapper/xUbuntu_16.04/./amd64/libsnapper_0.5.1_amd64.deb Protocol "http" not supported or disabled in libcurl)
This seems to work fine for Ubuntu 16.04 Desktop. Can I make it work for server???
I just changed the https to http in the /etc/apt/sources.list.d/snapper.list and now it works
This is a work around as opensuse org does not support https i guess.
https://github.com/openSUSE/snapper/issues/357

Completely remove mssql linux

Someone Help Please:
My Ubuntu 14 Server has 1 GB Memory, Was trying installation but it didn't complete. It was a mistake but now I can't completely remove it. Any external package I try to install fails, such as
(apt-get install python-requests) I get this error
(
/var/cache/apt/archives/mssql-server_14.0.800.90-2_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
)
Tried Uninstall but doesn't work
root#root: sudo apt-get remove mssql-server
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
libc++1 libjemalloc1 libsss-nss-idmap0
Use 'apt-get autoremove' to remove them.
The following packages will be REMOVED:
mssql-server
0 upgraded, 0 newly installed, 1 to remove and 172 not upgraded.
184 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] y
dpkg: error processing package mssql-server (--remove):
package is in a very bad inconsistent state; you should
reinstall it before attempting a removal
Errors were encountered while processing:
mssql-server
E: Sub-process /usr/bin/dpkg returned an error code (1)
I don't wan't to lose my server
If other external packages are failing to install, try removing the /etc/apt/sources.list.d/mssql-server.list file that you downloaded to register the Microsoft repository. Run sudo apt-get update. Then try installing the other external packages again and see if you have problems. This won't remove the failing mssql-server package, but maybe it will get you back and running with other packages.

Resources