timescale / timescaledb

An open-source time-series SQL database optimized for fast ingest and complex queries. Packaged as a PostgreSQL extension.
https://www.timescale.com/
Other
17.81k stars 885 forks source link

Debian Packages for v2 Aren't Marked as Conflicting so Install Causes APT Errors #2603

Open skyhisi opened 4 years ago

skyhisi commented 4 years ago

Relevant system information:

Describe the bug When upgrading from 1.7.4 to 2.0, the installation of the new v2 packages cause an error as they aren't marked as conflicting with the v1 packages.

root@vps:~# apt install timescaledb-2-postgresql-12 timescaledb-2-loader-postgresql-12 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following NEW packages will be installed:
  timescaledb-2-loader-postgresql-12 timescaledb-2-postgresql-12
0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
Need to get 877 kB of archives.
After this operation, 9,598 kB of additional disk space will be used.
Get:1 https://packagecloud.io/timescale/timescaledb/debian buster/main amd64 timescaledb-2-loader-postgresql-12 amd64 2.0.0-rc2~debian10-1 [51.0 kB]
Get:2 https://packagecloud.io/timescale/timescaledb/debian buster/main amd64 timescaledb-2-postgresql-12 amd64 2.0.0-rc2~debian10 [826 kB]
Fetched 877 kB in 3s (312 kB/s)                      
Selecting previously unselected package timescaledb-2-loader-postgresql-12.
(Reading database ... 74173 files and directories currently installed.)
Preparing to unpack .../timescaledb-2-loader-postgresql-12_2.0.0-rc2~debian10-1_amd64.deb ...
Unpacking timescaledb-2-loader-postgresql-12 (2.0.0-rc2~debian10-1) ...
dpkg: error processing archive /var/cache/apt/archives/timescaledb-2-loader-postgresql-12_2.0.0-rc2~debian10-1_amd64.deb (--unpack):
 trying to overwrite '/usr/lib/postgresql/12/lib/timescaledb.so', which is also in package timescaledb-loader-postgresql-12 1.7.4~debian10
Selecting previously unselected package timescaledb-2-postgresql-12.
Preparing to unpack .../timescaledb-2-postgresql-12_2.0.0-rc2~debian10_amd64.deb ...
Unpacking timescaledb-2-postgresql-12 (2.0.0-rc2~debian10) ...
dpkg: error processing archive /var/cache/apt/archives/timescaledb-2-postgresql-12_2.0.0-rc2~debian10_amd64.deb (--unpack):
 trying to overwrite '/usr/lib/postgresql/12/lib/timescaledb-1.7.0.so', which is also in package timescaledb-oss-postgresql-12 1.7.4~debian10
dpkg-deb: error: paste subprocess was killed by signal (Broken pipe)
Errors were encountered while processing:
 /var/cache/apt/archives/timescaledb-2-loader-postgresql-12_2.0.0-rc2~debian10-1_amd64.deb
 /var/cache/apt/archives/timescaledb-2-postgresql-12_2.0.0-rc2~debian10_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

To Reproduce Steps to reproduce the behavior:

  1. Install v2 packages when v1 packages are already installed

Expected behavior The install to either upgrade from v1 to v2, or abort with a conflict error prior to dpkg performing the install

Actual behavior The packages fail to install due to the conflicting files.

Workaround Erase the v1 packages, then install the v2 packages:

root@vps:~# apt remove timescaledb-loader-postgresql-12 timescaledb-oss-postgresql-12 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages were automatically installed and are no longer required:
  libpq-dev timescaledb-tools
Use 'apt autoremove' to remove them.
The following packages will be REMOVED:
  timescaledb-loader-postgresql-12 timescaledb-oss-postgresql-12
0 upgraded, 0 newly installed, 2 to remove and 0 not upgraded.
After this operation, 8,119 kB disk space will be freed.
Do you want to continue? [Y/n] y
(Reading database ... 74173 files and directories currently installed.)
Removing timescaledb-oss-postgresql-12 (1.7.4~debian10) ...
Removing timescaledb-loader-postgresql-12 (1.7.4~debian10) ...
Processing triggers for postgresql-common (221) ...
Building PostgreSQL dictionaries from installed myspell/hunspell packages...
Removing obsolete dictionary files:
root@vps:~# apt install timescaledb-2-postgresql-12 timescaledb-2-loader-postgresql-12 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following NEW packages will be installed:
  timescaledb-2-loader-postgresql-12 timescaledb-2-postgresql-12
0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B/877 kB of archives.
After this operation, 9,598 kB of additional disk space will be used.
(Reading database ... 74111 files and directories currently installed.)
Preparing to unpack .../timescaledb-2-loader-postgresql-12_2.0.0-rc2~debian10-1_amd64.deb ...
Unpacking timescaledb-2-loader-postgresql-12 (2.0.0-rc2~debian10-1) ...
Preparing to unpack .../timescaledb-2-postgresql-12_2.0.0-rc2~debian10_amd64.deb ...
Unpacking timescaledb-2-postgresql-12 (2.0.0-rc2~debian10) ...
Setting up timescaledb-2-loader-postgresql-12 (2.0.0-rc2~debian10-1) ...
Setting up timescaledb-2-postgresql-12 (2.0.0-rc2~debian10) ...
RECOMMENDED: Run 'timescaledb-tune' (installed as part of the 
timescaledb-tools package, a recommended dependency) to update your 
config settings for TimescaleDB: 

  timescaledb-tune --quiet --yes

IF NOT, you need to update your postgresql.conf file to load TimescaleDB
by adding 'timescaledb' to your shared_preload_libraries.
Find the line below and change the value as shown (uncomment if needed):

shared_preload_libraries = 'timescaledb'
Processing triggers for postgresql-common (221) ...

Once the packages were installed, I was able to use ALTER EXTENSION timescaledb UPDATE to upgrade the database to 2.0.

mfreed commented 4 years ago

Thanks for the report @skyhisi !