Chinaunix首页 | 论坛 | 博客
  • 博客访问: 2371840
  • 博文数量: 473
  • 博客积分: 12252
  • 博客等级: 上将
  • 技术积分: 4307
  • 用 户 组: 普通用户
  • 注册时间: 2007-10-12 10:02
文章分类

全部博文(473)

文章存档

2012年(8)

2011年(63)

2010年(73)

2009年(231)

2008年(98)

分类: LINUX

2011-10-14 13:26:20

Q. Can you explain CentOS / RHEL / Fedora Linux relocatable package concept?

A. RPM has the ability to give users some latitude in deciding where packages are to be installed on their systems. However, package builders must first design their packages to give users this freedom. In other words, an RPM package that can be installed into a different directory is said to be relocatable. Please note that not all RPM packages can be installed into another directory.

Task: Find out if whether a particular package is relocatable or not

Use rpm command as follows:
$ rpm -qi {package-name} | grep Relocations
$ rpm -qpi package.file.rpm | grep Relocations
$ rpm -qi bash | grep Relocations

Sample output (it means bash package can be installed in diffrent directory such as /home/chroot/users/):

Name : bash Relocations: /usr

Following package is not relocatable:
$ rpm -qi keyutils-libs | grep -i Relocations
Output:

Name : keyutils-libs Relocations: (not relocatable)Task: Install package into a different directory

rpm command has --prefix option. It allows to install package in diffrent directory. For example, install bash into /opt directory:
# rpm --prefix=/opt bash*.rpm

阅读(1629) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~