cloudberry
cloudberry copied to clipboard
[Bug] Cannot rpm install into a specified directory
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
- [x] I agree to follow this project's Code of Conduct.
Hi, @gavin1975 welcome!🎊 Thanks for taking the time to point this out.🙌
@tuhaihe Please have a look, thanks!
%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} .