且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Debian和CentOS主流系统按包含文件名称搜索软件包

更新时间:2022-08-17 12:07:46

例如在初始化cpan时遇到某些程序没有安装而导致初始化中报warning的情况,如下:


  1. Where is your gzip program? [/bin/gzip]  
  2. Where is your tar program? [/bin/tar]  
  3. Where is your unzip program? [/usr/bin/unzip]  
  4. Where is your make program? [/usr/bin/make]  
  5. Where is your links program? [/usr/bin/links]  
  6. Where is your wget program? [/usr/bin/wget]  
  7. Warning: ncftpget not found in PATH 
  8. Where is your ncftpget program? []  

如果追求完美的话,我们可以这样操作:
在以deb包系列的操作系统中,如Debian或Ubuntu中,如果我们需要安装包含applypatch程序的软件包,我们可以这样操作:


  1. # apt-file search applypatch 
  2.  
  3. dpsyco-lib: /usr/bin/dpsyco-applypatch 
  4.  
  5. dpsyco-lib: /usr/share/man/man1/dpsyco-applypatch.1.gz 
  6.  
  7. git-core: /usr/share/git-core/templates/hooks/applypatch-msg 
  8.  
  9. git-core: /usr/share/git-core/templates/hooks/pre-applypatch 
  10.  
  11. makepatch: /usr/bin/applypatch 
  12.  
  13. makepatch: /usr/share/man/man1/applypatch.1p.gz 

 

在以rpm包系列的操作系统中,如RedHat、CentOS等中,我们可以这样操作:


  1. # yum whatprovides "*/ncftpget"   
  2. Loaded plugins: downloadonly, fastestmirror 
  3. Loading mirror speeds from cached hostfile 
  4.  * c5-media:  
  5. 2:ncftp-3.2.2-1.el5.x86_64 : Improved console FTP client 
  6. Repo        : installed 
  7. Matched from
  8. Filename    : /usr/bin/ncftpget 

 

     本文转自xiaoyuwang 51CTO博客,原文链接:http://blog.51cto.com/wangxiaoyu/512886,如需转载请自行联系原作者