ubuntu查看安装软件包_查看在Ubuntu上安装软件包的位置

ubuntu查看安装软件包

ubuntu查看安装软件包

Once you use the apt-get utility to install a package, sometimes it seems to disappear into nowhere. You know it’s installed, you just have no idea where.

一旦使用apt-get实用程序安装软件包,有时它似乎就消失了。 您知道它已安装,只是不知道在哪里。

If you know the name of the executable, you can use the which command to find the location of the binary, but that doesn’t give you information on where the supporting files might be located.

如果您知道可执行文件的名称,则可以使用which命令查找二进制文件的位置,但这不会为您提供有关支持文件可能位于何处的信息。

There’s an easy way to see the locations of all the files installed as part of the package, using the dpkg utility.

使用dpkg实用程序可以很容易地查看作为软件包一部分安装的所有文件的位置。

dpkg -L <packagename>

dpkg -L <程序包名称>

Example: I had installed davfs2, but I wasn’t sure where the configuration file was, so I ran this command:

示例:我已经安装了davfs2,但是不确定配置文件在哪里,所以我运行了以下命令:

geek@ubuntuServ:~$ dpkg -L davfs2

geek @ ubuntuServ:〜$ dpkg -L davfs2

davfs2: /usr/share/lintian/overrides/davfs2davfs2: /usr/share/davfs2/GPLdavfs2: /usr/share/doc/davfs2/BUGSdavfs2: /usr/share/doc/davfs2/copyrightdavfs2: /usr/share/davfs2/NEWSdavfs2: /usr/share/doc/davfs2/THANKSdavfs2: /usr/share/doc/davfs2/NEWS.gzdavfs2: /usr/share/doc/davfs2/README.gzdavfs2: /usr/share/doc/davfs2davfs2: /usr/share/doc/davfs2/TODOdavfs2: /etc/davfs2/secretsdavfs2: /usr/share/davfs2/THANKSdavfs2: /usr/share/doc/davfs2/README.Debiandavfs2: /usr/share/davfs2/BUGSdavfs2: /etc/davfs2/davfs2.confdavfs2: /usr/share/davfs2/ChangeLogdavfs2: /usr/share/davfs2/FAQdavfs2: /etc/davfs2davfs2: /usr/share/doc/davfs2/changelog.Debian.gzdavfs2: /usr/share/davfs2/secrets.templatedavfs2: /usr/share/doc/davfs2/changelog.gzdavfs2: /usr/share/davfs2/TODOdavfs2: /usr/share/davfs2/davfs2.conf.templatedavfs2: /usr/share/davfs2/READMEdavfs2: /usr/share/davfs2davfs2: /usr/share/doc/davfs2/FAQ

davfs2:/ usr / share / lintian / overrides / davfs2davfs2:/ usr / share / davfs2 / GPLdavfs2:/ usr / share / doc / davfs2 / BUGSdavfs2:/ usr / share / doc / davfs2 / copyrightdavfs2:/ usr / share / doc / davfs2 / copyrightdavfs2:/ usr / share / davfs2 / NEWSdavfs2:/ usr / share / doc / davfs2 / THANKSdavfs2:/usr/share/doc/davfs2/NEWS.gzdavfs2:/usr/share/doc/davfs2/README.gzdavfs2:/ usr / share / doc / davfs2davfs2:/ usr / share / doc / davfs2 / TODOdavfs2:/ etc / davfs2 / secretsdavfs2:/ usr / share / davfs2 / THANKSdavfs2:/usr/share/doc/davfs2/README.Debiandavfs2:/ usr / share / davfs2 / BUGSdavfs2: /davfs2/davfs2.confdavfs2:/ usr / share / davfs2 / ChangeLogdavfs2:/ usr / share / davfs2 / FAQdavfs2:/ etc / davfs2davfs2:/usr/share/doc/davfs2/changelog.Debian.gzdavfs2:/ usr / davfs2 / secrets.templatedavfs2:/usr/share/doc/davfs2/changelog.gzdavfs2:/ usr / share / davfs2 / TODOdavfs2:/usr/share/davfs2/davfs2.conf.templatedavfs2:/ usr / share / davfs2 / READMEd / usr / share / davfs2davfs2:/ usr / share / doc / davfs2 / FAQ

Well, now I don’t have to wonder anymore. The conf file is clearly  /etc/davfs2/davfs2.conf. If I wanted to see just what files were installed into /etc, you could always grep the output like this:

好吧,现在我不必再怀疑了。 conf文件显然是/etc/davfs2/davfs2.conf。 如果我只想查看/ etc中安装了什么文件,则可以总是grep这样的输出:

geek@ubuntuServ:~$ dpkg -L davfs2 | grep etc

geek @ ubuntuServ:〜$ dpkg -L davfs2 | grep等

davfs2: /etc/davfs2/secretsdavfs2: /etc/davfs2/davfs2.confdavfs2: /etc/davfs2

davfs2:/ etc / davfs2 / secretsdavfs2:/etc/davfs2/davfs2.confdavfs2:/ etc / davfs2

Even easier to read.

甚至更容易阅读。

Update: Changed from -S to -L thanks to a tip from sebest.

更新:由于sebest的提示,从-S更改为-L。

翻译自: https://www.howtogeek.com/howto/ubuntu/see-where-a-package-is-installed-on-ubuntu/

ubuntu查看安装软件包

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值