cloudberry icon indicating copy to clipboard operation
cloudberry copied to clipboard

[Bug] Cannot rpm install into a specified directory

Open gavin1975 opened this issue 8 months ago • 3 comments

Apache Cloudberry version

cloudberry-db-1.6.0-1.el8.x86_64.rpm

What happened

I want to inistall Cloudberry-db into a specified directory, etc, /home/gpadmin/. But it will prompt error as below.

[root@gp7cdw gpadmin]# rpm -ivh cloudberry-db-1.6.0-1.el8.x86_64.rpm --prefix=/home/gpadmin/
warning: cloudberry-db-1.6.0-1.el8.x86_64.rpm: Header V4 RSA/SHA256 Signature, key ID accad176: NOKEY
error: unpacking of archive failed on file /home/gpadmin;680f301b: cpio: File from package already exists as a directory in system
error: cloudberry-db-1.6.0-1.el8.x86_64: install failed

What you think should happen instead

No response

How to reproduce

Just using command line as : rpm -ivh cloudberry-db-1.6.0-1.el8.x86_64.rpm --prefix=/home/gpadmin/

Operating System

Rocky Linux 8.10

Anything else

No response

Are you willing to submit PR?

  • [x] Yes, I am willing to submit a PR!

Code of Conduct

gavin1975 avatar Apr 28 '25 07:04 gavin1975

Hi, @gavin1975 welcome!🎊 Thanks for taking the time to point this out.🙌

github-actions[bot] avatar Apr 28 '25 07:04 github-actions[bot]

@tuhaihe Please have a look, thanks!

my-ship-it avatar Apr 28 '25 07:04 my-ship-it

%post
# Change ownership to gpadmin.gpadmin if the gpadmin user exists
if id "gpadmin" &>/dev/null; then
    chown -R gpadmin:gpadmin %{cloudberry_install_dir}-%{version}
    chown gpadmin:gpadmin %{cloudberry_install_dir}
fi

%postun
if [ $1 -eq 0 ] ; then
  if [ "$(readlink -f "%{cloudberry_install_dir}")" == "%{cloudberry_install_dir}-%{version}" ]; then
    unlink "%{cloudberry_install_dir}" || true
  fi
fi

it's related code, maybe lost %{prefix} .

yjhjstz avatar Jun 12 '25 19:06 yjhjstz