I have packages that I need to remove including postgresql-client-16, postgresql-client-18, postgresql-client-common and postgreql-common. Whenever I try to remove/purge any of them I get a message saying
/var/lib/dpkg/info/postgresql-client-16.prerm: 10: .: cannot open /usr/share/postgresql-common/maintscripts0functions: No such file
dpkg: error processing package postgres-client-16 (--remove):
installed postgres1l-client-16 package pre-removal script subprocess returned error exit status 2
dpkg: too many errors, stopping
/var/lib/dpkg/info/postgresql-client-16.postinst: 7: .: cannot open /usr/share/postgresql-common/maintscripts-functions: No such file
dpkg: error while cleaning up:
installed postgresql-client-16 package post-installation script subprocess returned error exit status 2
Errors were encountered while processing:
postgresql-client-16
Processing was halted because there were too many errors
needrestart is being skipped since dpkg has failed
(if there is typo above it's because I manually typed the console message from the laptop I'm using for ubuntu which doesn't have a GUI)
/usr/share/postgresql-common/maintscripts-functionsappears to be provided by the postgresql-client-common package so perhaps try re-installing that first?gpmpackage provides mouse selection with copy and paste on the console. also you can just redirect the output of a program to a file (in the case of apt-get, you will probably need to use either--assume-noor--assume-yesbecause with the output redirected you won't be able to see any questions it asks. or you could usetee)