centos非root用户安装软件(install package with non-root user)

发布时间: 2012-08-21 07:33:00

虽然我喜欢ubuntu, 虽然我做惯了root, 但是还是会遇到自己是non root用户的时候。要安装一个mysql client.  ( Though I love using ubuntu, and I have been used to be root, however in real world I have to be non-root for some times, so , today, I have to install mysql client for myself. )

假设你的HOME 目录是 /home/user, 假设要安装的rpm是: package.rpm: ( assuming your HOME folder is: /home/user, and the target package you want to install is: package.rm)

1.rpm –initdb –root /home/user/local –dbpath lib/rpm
2.rpm -qlp package.rpm
3.rpm -ivh package.rpm
4.rpm –root /home/user/local –dbpath lib/rpm --relocate /usr=/home/username/local --nodeps -ivh package.rpm

参考: Install a rpm in home directory as non-root