有没有办法在不先下载包的情况下使用`apt-get`显示包内容?

Shu*_*eng 3 packaging debian apt package-management

我知道我可以使用以下命令列出包中的文件,首先将包 (.deb) 下载到其中/var/cache/apt/archives,然后列出其内容:

apt-get --download-only install <pkg>
dpkg --contents <pkg> (.deb)
Run Code Online (Sandbox Code Playgroud)

是否apt-get支持在不先下载包的情况下列出包内容的任何方式?

额外:此外,如何在apt-get --download-only ...没有所有依赖项的情况下下载包?

ter*_*don 7

我不认为apt-get可以做到,不,但apt-file可以:

sudo apt install apt-file
sudo apt update
Run Code Online (Sandbox Code Playgroud)

进而:

sudo apt-file list <pkg>
Run Code Online (Sandbox Code Playgroud)

例如:

$ sudo apt-file list xterm
xterm: /etc/X11/app-defaults/KOI8RXTerm
xterm: /etc/X11/app-defaults/KOI8RXTerm-color
xterm: /etc/X11/app-defaults/UXTerm
xterm: /etc/X11/app-defaults/UXTerm-color
xterm: /etc/X11/app-defaults/XTerm
xterm: /etc/X11/app-defaults/XTerm-color
xterm: /usr/bin/koi8rxterm
xterm: /usr/bin/lxterm
xterm: /usr/bin/resize
xterm: /usr/bin/uxterm
xterm: /usr/bin/xterm
xterm: /usr/share/applications/debian-uxterm.desktop
xterm: /usr/share/applications/debian-xterm.desktop
xterm: /usr/share/doc-base/xterm-ctlseqs
xterm: /usr/share/doc-base/xterm-faq
xterm: /usr/share/doc/xterm/NEWS.Debian.gz
xterm: /usr/share/doc/xterm/README.Debian
xterm: /usr/share/doc/xterm/README.i18n.gz
xterm: /usr/share/doc/xterm/changelog.Debian.gz
xterm: /usr/share/doc/xterm/copyright
xterm: /usr/share/doc/xterm/ctlseqs.ms.gz
xterm: /usr/share/doc/xterm/ctlseqs.txt.gz
xterm: /usr/share/doc/xterm/xterm.faq.gz
xterm: /usr/share/doc/xterm/xterm.faq.html
xterm: /usr/share/doc/xterm/xterm.log.html
xterm: /usr/share/doc/xterm/xterm.termcap.gz
xterm: /usr/share/doc/xterm/xterm.terminfo.gz
xterm: /usr/share/icons/hicolor/48x48/apps/xterm-color.png
xterm: /usr/share/icons/hicolor/scalable/apps/xterm-color.svg
xterm: /usr/share/man/man1/koi8rxterm.1.gz
xterm: /usr/share/man/man1/lxterm.1.gz
xterm: /usr/share/man/man1/resize.1.gz
xterm: /usr/share/man/man1/uxterm.1.gz
xterm: /usr/share/man/man1/xterm.1.gz
xterm: /usr/share/pixmaps/filled-xterm_32x32.xpm
xterm: /usr/share/pixmaps/filled-xterm_48x48.xpm
xterm: /usr/share/pixmaps/mini.xterm_32x32.xpm
xterm: /usr/share/pixmaps/mini.xterm_48x48.xpm
xterm: /usr/share/pixmaps/xterm-color_32x32.xpm
xterm: /usr/share/pixmaps/xterm-color_48x48.xpm
xterm: /usr/share/pixmaps/xterm_32x32.xpm
xterm: /usr/share/pixmaps/xterm_48x48.xpm
Run Code Online (Sandbox Code Playgroud)

至于下载,这就是download命令的用途:

apt-get download <pkg>
Run Code Online (Sandbox Code Playgroud)

man apt-get

   download
       download will download the given binary package into the current
       directory.
Run Code Online (Sandbox Code Playgroud)

  • `apt-file` 的工作原理是从 Debian/Ubuntu/etc 下载一个 `Contents` 文件。存储库。 (2认同)

归档时间:

查看次数:

234 次

最近记录:

5 年,3 月 前