问题原文
原帖链接 · Vinícius Ferrão · CC BY-SA 4.0
Is there a better way to install only the required dependencies of a package, instead of installing it directly with apt-get (or any other frontend of dpkg) and then immediately removing it, leaving out its dependencies?
已采纳解答
原帖链接 · smammy · CC BY-SA 3.0
apt-cache depends pkgname will show a package's dependencies.
If you want it all in one command, you could do worse than:
apt-get install `apt-cache depends pkgname | awk '/Depends:/{print$2}'`
摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。
