"Device or resource busy" error during the major upgrade of PostgreSQL on Ubuntu
General
Escalation
General
Escalation
Description
I just tried to update my Postgresql installation on from 13 on an Ubuntu 20.04.3 LTS node and it fails due to the postgresql-common package post installation script.
The following NEW packages will be installed:
postgresql-client-common postgresql-common
The following packages will be upgraded:
libpq5 percona-patroni percona-pg-stat-monitor13 percona-pgbackrest percona-postgresql-13 percona-postgresql-13-pgaudit percona-postgresql-13-repack percona-postgresql-client-13 percona-postgresql-client-common
percona-postgresql-common
10 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B/17.7 MB of archives.
After this operation, 23.6 kB of additional disk space will be used.
Do you want to continue? [Y/n] Y
Preconfiguring packages ...
dpkg: percona-postgresql-common: dependency problems, but removing anyway as you requested:
percona-postgresql-13 depends on percona-postgresql-common (>= 182~).
percona-pgbackrest depends on postgresql-common | percona-postgresql-common; however:
Package postgresql-common is not installed.
Package percona-postgresql-common which provides postgresql-common is to be removed.
Package percona-postgresql-common is to be removed.
Package percona-postgresql-common which provides percona-postgresql-common is to be removed.
percona-postgresql-13 depends on percona-postgresql-common (>= 182~).
percona-pgbackrest depends on postgresql-common | percona-postgresql-common; however:
Package postgresql-common is not installed.
Package percona-postgresql-common which provides postgresql-common is to be removed.
Package percona-postgresql-common is to be removed.
Package percona-postgresql-common which provides percona-postgresql-common is to be removed.
percona-pgbackrest depends on postgresql-common | percona-postgresql-common; however:
Package postgresql-common is not installed.
Package percona-postgresql-common which provides postgresql-common is to be removed.
Package percona-postgresql-common is to be removed.
Package percona-postgresql-common which provides percona-postgresql-common is to be removed.
(Reading database ... 114499 files and directories currently installed.)
Removing percona-postgresql-common (226-3.focal) ...
dpkg: warning: while removing percona-postgresql-common, unable to remove directory '/var/lib/postgresql': Device or resource busy - directory may be a mount point?
Removing 'diversion of /usr/bin/pg_config to /usr/bin/pg_config.libpq-dev by percona-postgresql-common'
Selecting previously unselected package postgresql-common.
(Reading database ... 114385 files and directories currently installed.)
Preparing to unpack .../postgresql-common_1%3a230-1.focal_all.deb ...
Adding 'diversion of /usr/bin/pg_config to /usr/bin/pg_config.libpq-dev by postgresql-common'
Unpacking postgresql-common (1:230-1.focal) ...
Setting up postgresql-common (1:230-1.focal) ...
ucfr: Attempt from package postgresql-common to take /etc/postgresql-common/createcluster.conf away from package percona-postgresql-common
ucfr: Aborting.
dpkg: error processing package postgresql-common (--configure):
installed postgresql-common package post-installation script subprocess returned error exit status 4
Errors were encountered while processing:
postgresql-common
E: Sub-process /usr/bin/dpkg returned an error code (1)
$ sudo apt --fix-broken install
Reading package lists... Done
Building dependency tree
Reading state information... Done
Correcting dependencies... Done
The following additional packages will be installed:
percona-postgresql-common
The following NEW packages will be installed:
percona-postgresql-common
0 upgraded, 1 newly installed, 0 to remove and 9 not upgraded.
1 not fully installed or removed.
Need to get 0 B/5,884 B of archives.
After this operation, 11.3 kB of additional disk space will be used.
Do you want to continue? [Y/n] Y
Setting up postgresql-common (1:230-1.focal) ...
ucfr: Attempt from package postgresql-common to take /etc/postgresql-common/createcluster.conf away from package percona-postgresql-common
ucfr: Aborting.
dpkg: error processing package postgresql-common (--configure):
installed postgresql-common package post-installation script subprocess returned error exit status 4
Errors were encountered while processing:
postgresql-common
E: Sub-process /usr/bin/dpkg returned an error code (1)
I just tried to update my Postgresql installation on from 13 on an Ubuntu 20.04.3 LTS node and it fails due to the postgresql-common package post installation script.
The following NEW packages will be installed: postgresql-client-common postgresql-common The following packages will be upgraded: libpq5 percona-patroni percona-pg-stat-monitor13 percona-pgbackrest percona-postgresql-13 percona-postgresql-13-pgaudit percona-postgresql-13-repack percona-postgresql-client-13 percona-postgresql-client-common percona-postgresql-common 10 upgraded, 2 newly installed, 0 to remove and 0 not upgraded. Need to get 0 B/17.7 MB of archives. After this operation, 23.6 kB of additional disk space will be used. Do you want to continue? [Y/n] Y Preconfiguring packages ... dpkg: percona-postgresql-common: dependency problems, but removing anyway as you requested: percona-postgresql-13 depends on percona-postgresql-common (>= 182~). percona-pgbackrest depends on postgresql-common | percona-postgresql-common; however: Package postgresql-common is not installed. Package percona-postgresql-common which provides postgresql-common is to be removed. Package percona-postgresql-common is to be removed. Package percona-postgresql-common which provides percona-postgresql-common is to be removed. percona-postgresql-13 depends on percona-postgresql-common (>= 182~). percona-pgbackrest depends on postgresql-common | percona-postgresql-common; however: Package postgresql-common is not installed. Package percona-postgresql-common which provides postgresql-common is to be removed. Package percona-postgresql-common is to be removed. Package percona-postgresql-common which provides percona-postgresql-common is to be removed. percona-pgbackrest depends on postgresql-common | percona-postgresql-common; however: Package postgresql-common is not installed. Package percona-postgresql-common which provides postgresql-common is to be removed. Package percona-postgresql-common is to be removed. Package percona-postgresql-common which provides percona-postgresql-common is to be removed. (Reading database ... 114499 files and directories currently installed.) Removing percona-postgresql-common (226-3.focal) ... dpkg: warning: while removing percona-postgresql-common, unable to remove directory '/var/lib/postgresql': Device or resource busy - directory may be a mount point? Removing 'diversion of /usr/bin/pg_config to /usr/bin/pg_config.libpq-dev by percona-postgresql-common' Selecting previously unselected package postgresql-common. (Reading database ... 114385 files and directories currently installed.) Preparing to unpack .../postgresql-common_1%3a230-1.focal_all.deb ... Adding 'diversion of /usr/bin/pg_config to /usr/bin/pg_config.libpq-dev by postgresql-common' Unpacking postgresql-common (1:230-1.focal) ... Setting up postgresql-common (1:230-1.focal) ... ucfr: Attempt from package postgresql-common to take /etc/postgresql-common/createcluster.conf away from package percona-postgresql-common ucfr: Aborting. dpkg: error processing package postgresql-common (--configure): installed postgresql-common package post-installation script subprocess returned error exit status 4 Errors were encountered while processing: postgresql-common E: Sub-process /usr/bin/dpkg returned an error code (1) $ sudo apt --fix-broken install Reading package lists... Done Building dependency tree Reading state information... Done Correcting dependencies... Done The following additional packages will be installed: percona-postgresql-common The following NEW packages will be installed: percona-postgresql-common 0 upgraded, 1 newly installed, 0 to remove and 9 not upgraded. 1 not fully installed or removed. Need to get 0 B/5,884 B of archives. After this operation, 11.3 kB of additional disk space will be used. Do you want to continue? [Y/n] Y Setting up postgresql-common (1:230-1.focal) ... ucfr: Attempt from package postgresql-common to take /etc/postgresql-common/createcluster.conf away from package percona-postgresql-common ucfr: Aborting. dpkg: error processing package postgresql-common (--configure): installed postgresql-common package post-installation script subprocess returned error exit status 4 Errors were encountered while processing: postgresql-common E: Sub-process /usr/bin/dpkg returned an error code (1)