apt-get -s E: 命令行 [origin -s] 中的选项“s”未知

apt-get -s E: 命令行 [origin -s] 中的选项“s”未知

标题中几乎全部是这样的,但 14.04。我还尝试了 man 中找到的所有 5 个等效长 (--) 选项,但出现相同的错误。man 中的 -u 也以同样的方式失败。请问这是什么?谢谢。

答案1

你不能直接执行sudo apt-get -s。你需要告诉它做某事。

话虽如此,这样做sudo apt-get update -s会产生您提到的相同错误:

$ sudo apt-get update -s
E: Command line option 's' [from -s] is not known.

但是,asudo apt-get install -s不会出错。

$ sudo apt-get install -s
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages were automatically installed and are no longer required:
  linux-headers-3.13.0-23 linux-headers-3.13.0-23-generic linux-image-3.13.0-23-generic linux-image-extra-3.13.0-23-generic
Use 'apt-get autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 39 not upgraded.

我假设该-s标志只适用于部分命令。Apt/Get 操作方法wiki。给出的示例是install,并且没有明确说明它可以与任何其他操作一起使用。

使用 -s 标志来模拟操作。“sudo apt-get -s install”将模拟安装包,向您展示将安装和配置哪些包。

相关内容