_rpmlock_path的含义问题参考下面的链接:
https://rhn.redhat.com/errata/RHBA-2006-0440.html
https://bugzilla.redhat.com/show_bug.cgi?id=222194
Transaction lock issues using RPM with --root and --dbpath have been fixed.
Note, to use --dbpath as non root, customers will need to define the
%_rpmlock_path macro to a location that can be written to; future versions of RPM use '%{_dbpath}/__db.000'.
Note, to use --dbpath as non root, customers will need to define the
%_rpmlock_path macro to a location that can be written to; future versions of RPM use '%{_dbpath}/__db.000'.
rhel4.6 其他用户安装rpm包:
1. 用户根目录下新建目录rpm,以admin用户为例, mkdir ~/xxx_rpm
2. cd ~/xxx_rpm && mkdir -p var/lib/rpm && mkdir -p var/lock/rpm
3. rpm --initdb --root ~/xxx_rpm/ 将该目录设为根
4. touch ~/.rpmmacros /home/admin/rpm/var/lock/rpm/transaction
5. 在~/.rpmmacros文件里添加: %_rpmlock_path /home/admin/rpm/var/lock/rpm/transaction
6. rpm -ivh --nodeps alog* --dbpath ~/xxx_rpm/var/lib/rpm --prefix ~/xxx_usr/
--nodeps: 用了用户自己的rpm数据库会找不到系统的东东
--dbpath: 指定用户rpm数据库路径
rhel5.3 其他用户安装rpm包:
1. 用户根目录下新建目录rpm,以admin用户为例, mkdir ~/xxx_rpm
2. rpm --rebuilddb --dbpath /home/admin/xxx_rpm/
3. rpm -ivh --nodeps alog* --dbpath ~/xxx_rpm/var/lib/rpm --prefix ~/xxx_usr/
1. 用户根目录下新建目录rpm,以admin用户为例, mkdir ~/xxx_rpm
2. cd ~/xxx_rpm && mkdir -p var/lib/rpm && mkdir -p var/lock/rpm
3. rpm --initdb --root ~/xxx_rpm/ 将该目录设为根
4. touch ~/.rpmmacros /home/admin/rpm/var/lock/rpm/transaction
5. 在~/.rpmmacros文件里添加: %_rpmlock_path /home/admin/rpm/var/lock/rpm/transaction
6. rpm -ivh --nodeps alog* --dbpath ~/xxx_rpm/var/lib/rpm --prefix ~/xxx_usr/
--nodeps: 用了用户自己的rpm数据库会找不到系统的东东
--dbpath: 指定用户rpm数据库路径
rhel5.3 其他用户安装rpm包:
1. 用户根目录下新建目录rpm,以admin用户为例, mkdir ~/xxx_rpm
2. rpm --rebuilddb --dbpath /home/admin/xxx_rpm/
3. rpm -ivh --nodeps alog* --dbpath ~/xxx_rpm/var/lib/rpm --prefix ~/xxx_usr/