Error while updating nh in Termux:
Code:
# apt full-upgrade -y
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Calculating upgrade... Done
The following packages were automatically installed and are no longer required:
  catfish docutils-common gir1.2-xfconf-0
  libicu71 libimagequant0 libprotobuf23
  libraqm0 liburing2 libzxingcore1 plocate
  python3-alabaster python3-docutils
  python3-imagesize python3-olefile
  python3-pexpect python3-pil
  python3-ptyprocess python3-pygments
  python3-roman python3-snowballstemmer
  python3-sphinx ruby3.0 ruby3.0-dev
  ruby3.0-doc sphinx-common
Use 'apt autoremove' to remove them.
The following packages will be upgraded:
  postgresql-15
1 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
174 not fully installed or removed.
Need to get 0 B/16.2 MB of archives.
After this operation, 1024 B of additional disk space will be used.
Preconfiguring packages ...
(Reading database ... 297418 files and directories currently installed.)
Preparing to unpack .../postgresql-15_15.1-1+b1_arm64.deb ...
invoke-rc.d: could not determine current runlevel
Stopping PostgreSQL 15 database server: mainError: Data directory /var/lib/postgresql/15/main must not be owned by root ... failed!
 failed!
invoke-rc.d: initscript postgresql, action "stop" failed.
dpkg: warning: old postgresql-15 package pre-removal script subprocess returned error exit status 1
dpkg: trying script from the new package instead ...
invoke-rc.d: could not determine current runlevel
Stopping PostgreSQL 15 database server: mainError: Data directory /var/lib/postgresql/15/main must not be owned by root ... failed!
 failed!
invoke-rc.d: initscript postgresql, action "stop" failed.
dpkg: error processing archive /var/cache/apt/archives/postgresql-15_15.1-1+b1_arm64.deb (--unpack):
 new postgresql-15 package pre-removal script subprocess returned error exit status 1
Errors were encountered while processing:
 /var/cache/apt/archives/postgresql-15_15.1-1+b1_arm64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)