
請原諒這個問題的愚蠢,因為我是一個 Linux/Ubuntu 菜鳥。
我遇到了這個apt-cache search
命令另一個問題在尋找讓 LaTeXhref
套件在我的 Ubuntu 虛擬機器上運行的方法時。
然後我嘗試apt-cache search href
並得到以下輸出:
libio-dirent-perl - Perl module for accessing dirent structs returned by readdir
libclass-std-storable-perl - Support for creating serializable "inside-out" classes
libconfig-inihash-perl - Perl extension for reading and writing INI files
libdata-dumper-compact-perl - vertically compact width-limited data formatter
libdbix-abstract-perl - DBI SQL abstraction
libdigest-md5-file-perl - Perl extension for getting MD5 sums for files and urls
libhtml-html5-outline-perl - implementation of the HTML5 Outline algorithm
libhtml-microformats-perl - parse microformats in HTML
libjs-autolink - JavaScript methods converting text to links
libjson-hyper-perl - extract links from JSON via a schema
libjson-path-perl - search nested hashref/arrayref structures using JSONPath
libmoosex-arrayref-perl - blessed arrayrefs with Moose
libmoosex-oneargnew-perl - Moose role that extends class' constructor to accept single arguments
libmoosex-param-perl - simple Moose role providing a standard param method
libmoosex-singlearg-perl - module to instantiate Moose objects using a single argument
libmoosex-types-structured-perl - Moose extension for type constraints on structured types
libparams-validationcompiler-perl - module to build an optimized subroutine parameter validator
libpod-spell-perl - formatter to easily check the spelling of POD
libpostfix-parse-mailq-perl - module to parse the postfix mail queue
libtest-deep-unorderedpairs-perl - Test::Deep plugin for comparing lists as if they were hashes
libxml-atom-microformats-perl - parse microformats in Atom content
libxml-libxml-debugging-perl - get debugging information from XML::LibXML
node-url-to-options - Convert a WHATWG URL to an http(s).request options object
roffit - convert nroff manual pages into HTML
tea - graphical text editor with syntax highlighting
texlive-latex-extra - TeX Live: LaTeX additional packages
該字串href
只能在以下包中找到:
libjson-path-perl - search nested hashref/arrayref structures using JSONPath
我的理解是,apt-cache search pattern
只會辨識pattern
找到的包。
為什麼它href
沒有出現在識別的包中?
答案1
請注意https://www.ctan.org/pkg/href回傳 404。 所以您可能使用了錯誤的套件名稱。但hyperref
包存在。
如果您man apt-cache
在本地閱讀或在線的你可以看到以下內容:
search regex
...
搜尋對給定的 POSIX 正規表示式模式的所有可用套件清單執行全文搜索,請參閱正規表示式(7)。它在套件名稱和描述中搜尋正規表示式的出現,並列印出套件名稱和簡短描述,包括虛擬套件名稱。如果--full
給出則為每個匹配的包產生與 show 相同的輸出,並且如果--names-only
給出後,不會搜尋長描述,只會搜尋包名稱和提供的包。單獨的參數可用於指定透過 and 組合在一起的多個搜尋模式。
所以你可以嘗試使用apt-cache search href latex
或一些邏輯命令。但真正重要的是apt-cache
對包裝內容一無所知。
LaTeX 包通常有*.bst,*.麥粒腫文件的定義。
例如要搜尋包內容過度依賴你需要使用其他工具:
本地 - 使用
apt-file
:sudo apt-get install apt-file sudo apt-file update
得到類似的東西
$ sudo apt-file search hyperref.sty latexml: /usr/share/perl5/LaTeXML/Package/hyperref.sty.ltxml texlive-lang-arabic: /usr/share/texlive/texmf-dist/tex/xelatex/bidi/bidituftehyperref.sty texlive-latex-base: /usr/share/texlive/texmf-dist/tex/latex/hyperref/hyperref.sty texlive-latex-base: /usr/share/texlive/texmf-dist/tex/latex/hyperref/nohyperref.sty texlive-latex-extra: /usr/share/texlive/texmf-dist/tex/latex/hobsub/hobsub-hyperref.sty texlive-latex-extra: /usr/share/texlive/texmf-dist/tex/latex/interfaces/interfaces-hyperref.sty texlive-latex-extra: /usr/share/texlive/texmf-dist/tex/latex/zref/zref-hyperref.sty texlive-latex-recommended: /usr/share/texlive/texmf-dist/tex/latex/lwarp/lwarp-hyperref.sty
或使用正規表示式語法:
$ sudo apt-file search --regexp hyperref.sty$ texlive-lang-arabic: /usr/share/texlive/texmf-dist/tex/xelatex/bidi/bidituftehyperref.sty texlive-latex-base: /usr/share/texlive/texmf-dist/tex/latex/hyperref/hyperref.sty texlive-latex-base: /usr/share/texlive/texmf-dist/tex/latex/hyperref/nohyperref.sty texlive-latex-extra: /usr/share/texlive/texmf-dist/tex/latex/hobsub/hobsub-hyperref.sty texlive-latex-extra: /usr/share/texlive/texmf-dist/tex/latex/interfaces/interfaces-hyperref.sty texlive-latex-extra: /usr/share/texlive/texmf-dist/tex/latex/zref/zref-hyperref.sty texlive-latex-recommended: /usr/share/texlive/texmf-dist/tex/latex/lwarp/lwarp-hyperref.sty
透過訪問線上https://packages.ubuntu.com並蒐索
hyperref.sty
- 它包含在texlive-latex-base
Ubuntu 套件。