1、安装rpm包可以指定路径,但是安装包时它可能执行一些内置的命令。如果手动指定路径,可能造成部分功能失效
比如下面安装jdk的rpm包。默认安装后它会创建个软链接。下面就提示创建软链接失败了。但是不影响使用
[root@dawn-cobbler-1-1 /]# mkdir /tools
[root@dawn-cobbler-1-1 /]# cd /tools/
[root@dawn-cobbler-1-1 /tools]# mv /jdk-8u111-linux-x64.rpm .
[root@dawn-cobbler-1-1 /tools]# ls
jdk-8u111-linux-x64.rpm
[root@dawn-cobbler-1-1 /tools]# mkdir /app -p
[root@dawn-cobbler-1-1 /tools]# rpm -ivh --prefix=/app/ jdk-8u111-linux-x64.rpm
Preparing... ################################# [100%]
Updating / installing...
1:jdk1.8.0_111-2000:1.8.0_111-fcs ################################# [100%]
Unpacking JAR files...
tools.jar...
plugin.jar...
javaws.jar...
deploy.jar...
rt.jar...
jsse.jar...
charsets.jar...
localedata.jar...
ln: failed to create symbolic link ‘/usr/java/jdk1.8.0_111’: No such file or directory
[root@dawn-cobbler-1-1 /tools]# cd /app/
[root@dawn-cobbler-1-1 /app]# ls
jdk1.8.0_111
[root@dawn-cobbler-1-1 /app]# cd jdk1.8.0_111/
[root@dawn-cobbler-1-1 /app/jdk1.8.0_111]# ls
bin db javafx-src.zip lib man release THIRDPARTYLICENSEREADME-JAVAFX.txt
COPYRIGHT include jre LICENSE README.html src.zip THIRDPARTYLICENSEREADME.txt
[root@dawn-cobbler-1-1 /app/jdk1.8.0_111]# du -sh *
728Kbin
4.0KCOPYRIGHT
5.7Mdb
200Kinclude
4.9Mjavafx-src.zip
179Mjre
117Mlib
4.0KLICENSE
2.0Mman
4.0KREADME.html
4.0Krelease
21Msrc.zip
108KTHIRDPARTYLICENSEREADME-JAVAFX.txt
176KTHIRDPARTYLICENSEREADME.txt
[root@dawn-cobbler-1-1 /app/jdk1.8.0_111]# du -sh
329M.
[root@dawn-cobbler-1-1 /app/jdk1.8.0_111]#
如果觉得《mysql rpm包安装指定路径_安装rpm包时指定路径》对你有帮助,请点赞、收藏,并留下你的观点哦!