c++ - Linux怎么实现以安装软件的路径查找呢?
高洛峰
高洛峰 2017-04-17 14:26:03
0
2
727

要做一个升级的东东,需要知道某个软件安装到了哪里去,比如我在centos下安装了Sublime_Text这个软件,我现在不知道这个软件安装到哪了,我想用编程的方式找出他来. linux下没有windows下的注册表没办法把安装程序的信息记录下来,有木有做过这种linux软件升级的大大? 求给点思路~~

高洛峰
高洛峰

拥有18年软件开发和IT教学经验。曾任多家上市公司技术总监、架构师、项目经理、高级软件工程师等职务。 网络人气名人讲师,...

reply all(2)
小葫芦

rpm -ql software name View the directory where the software is installed

迷茫

If it is a Linux system such as ubuntu/debian that uses dpkg package management software, use:

dpkg -l software name

If it is a Linux system such as centos/redhat that uses rpm package management software, use:

rpm -ql software name

The above command can list all the files (installation path) of a software package, but if you want to upgrade the software, you should use other commands provided by the package management software to upgrade instead of replacing any files yourself!

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template