Ubuntu 14.04 LTS
我知道传统方法正在使用sudo apt-cache search
,但是此命令不是最佳方法。例如,如果我要搜索numpy,它将显示许多不相关的软件包,如下所示。我需要一个一个地搜索,有没有更好的方法?
.....
python3-tables-dbg - hierarchical database for Python 3 based on HDF5 (debug extension)
python3-tables-lib - hierarchical database for Python3 based on HDF5 (extension)
reinteract - Worksheet-based graphical Python shell
stimfit - Program for viewing and analyzing electrophysiological data
stimfit-dbg - Debug symbols for stimfit
texlive-lang-italian - TeX Live: Italian
python-spyderlib-doc - python IDE for scientists (Documentation)
python3-spyderlib - python IDE for scientists (Python 3)
spyder-common - python IDE for scientists (common files)
......
Run Code Online (Sandbox Code Playgroud)
apt-cache search
在给定的正则表达式模式下搜索程序包名称和描述,可以使正则表达式模式更可靠,并仅通过--names-only
选项搜索程序包名称:
apt-cache search --names-only '^python3?-numpy'
Run Code Online (Sandbox Code Playgroud)
另外,您无需sudo
运行apt-cache
。
^python3?-numpy
匹配程序包名称以python3-numpy
或开头python-numpy
如果只想搜索python3
包装,请使用^python3-numpy
只需获取软件包名称:
apt-cache search --names-only '^python3?-numpy' | awk '{print $1}'
Run Code Online (Sandbox Code Playgroud)例:
$ apt-cache search --names-only '^python3?-numpy'
python-numpy - Numerical Python adds a fast array facility to the Python language
python-numpy-dbg - Fast array facility to the Python language (debug extension)
python-numpy-doc - NumPy documentation
python3-numpy - Fast array facility to the Python 3 language
python3-numpy-dbg - Fast array facility to the Python 3 language (debug extension)
python-numpydoc - Sphinx extension to support docstrings in Numpy format
$ apt-cache search --names-only '^python3?-numpy' | awk '{print $1}'
python-numpy
python-numpy-dbg
python-numpy-doc
python3-numpy
python3-numpy-dbg
python-numpydoc
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
1091 次 |
最近记录: |