为什么这个命令删除的包比我想要的多?

为什么这个命令删除的包比我想要的多?

当我运行以下命令时:

# apt-get purge unity-scopes-m*

我希望它删除以下包:

unity-scope-manpages
unity-scope-musicstores
unity-scope-musique

相反,它想要清除大量我没想到的包:

Note, selecting 'unity-scopes-impl-0' for regex 'unity-scopes-m*'
Note, selecting 'unity-scopes-impl-1' for regex 'unity-scopes-m*'
Note, selecting 'unity-scopes-impl-4' for regex 'unity-scopes-m*'
Note, selecting 'unity-scopes-impl-6' for regex 'unity-scopes-m*'
Note, selecting 'unity-scopes-master-default' for regex 'unity-scopes-m*'
Note, selecting 'libunity-scopes-qt-dev' for regex 'unity-scopes-m*'
Note, selecting 'unity-scopes-json-def' for regex 'unity-scopes-m*'
Note, selecting 'libunity-scopes-qt' for regex 'unity-scopes-m*'
Note, selecting 'libunity-scopes-qt-doc' for regex 'unity-scopes-m*'
Note, selecting 'libunity-scopes-json-def-desktop' for regex 'unity-scopes-m*'
Note, selecting 'unity-scopes-runner' for regex 'unity-scopes-m*'
Note, selecting 'libunity-scopes-dev' for regex 'unity-scopes-m*'
Note, selecting 'libunity-scopes-json-def-phone' for regex 'unity-scopes-m*'
Note, selecting 'libunity-scopes-doc' for regex 'unity-scopes-m*'
Note, selecting 'unity-scopes-master' for regex 'unity-scopes-m*'
Note, selecting 'unity-scopes-impl' for regex 'unity-scopes-m*'
Note, selecting 'libunity-scopes-cli' for regex 'unity-scopes-m*'
Note, selecting 'unity-scopes-master-default' instead of 'unity-scopes-master'
Note, selecting 'unity-plugin-scopes' instead of 'unity-scopes-impl'
Note, selecting 'unity-plugin-scopes' instead of 'unity-scopes-impl-0'
Note, selecting 'unity-plugin-scopes' instead of 'unity-scopes-impl-1'
Note, selecting 'unity-plugin-scopes' instead of 'unity-scopes-impl-4'
Note, selecting 'unity-plugin-scopes' instead of 'unity-scopes-impl-6'
Package 'libunity-scopes-cli' is not installed, so not removed
Package 'libunity-scopes-dev' is not installed, so not removed
Package 'libunity-scopes-doc' is not installed, so not removed
Package 'libunity-scopes-json-def-phone' is not installed, so not removed
Package 'libunity-scopes-qt' is not installed, so not removed
Package 'libunity-scopes-qt-dev' is not installed, so not removed
Package 'libunity-scopes-qt-doc' is not installed, so not removed
The following packages will be REMOVED:
  account-plugin-aim account-plugin-jabber account-plugin-salut account-plugin-yahoo brasero brasero-cdrkit deja-dup
  deja-dup-backend-gvfs empathy gir1.2-unity-5.0 libbrasero-media3-1 libunity-scopes-json-def-desktop libunity-webapps0 libunity9
  mcp-account-manager-uoa nautilus nautilus-sendto nautilus-share rhythmbox-plugin-cdrecorder shotwell telepathy-indicator
  thunderbird-gnome-support ubuntu-desktop unity unity-lens-applications unity-lens-files unity-lens-music unity-lens-photos
  unity-lens-video unity-scope-audacious unity-scope-calculator unity-scope-chromiumbookmarks unity-scope-clementine
  unity-scope-colourlovers unity-scope-devhelp unity-scope-firefoxbookmarks unity-scope-gdrive unity-scope-gmusicbrowser
  unity-scope-gourmet unity-scope-guayadeque unity-scope-home unity-scope-manpages unity-scope-musicstores unity-scope-musique
  unity-scope-openclipart unity-scope-texdoc unity-scope-tomboy unity-scope-video-remote unity-scope-virtualbox unity-scope-yelp
  unity-scope-zotero unity-scopes-master-default unity-scopes-runner unity-webapps-common unity-webapps-qml unity-webapps-service
  usb-creator-gtk webapp-container xul-ext-unity xul-ext-websites-integration
0 upgraded, 0 newly installed, 60 to remove and 0 not upgraded.
After this operation, 39.7 MB disk space will be freed.

为什么该命令吞噬的软件包比我预期的要多得多?根据apt-get手册:

.如果没有包与给定表达式匹配,并且该表达式包含,?或者之一*,则假定它是 POSIX 正则表达式,并将其应用于数据库中的所有包名称。然后安装(或删除)所有匹配项。

我的当前目录中没有文件导致 Bash 展开*,即使我放入unity-scope-m*单引号也会发生同样的问题。

答案1

附加包很可能是您希望删除的主包的依赖项。

您确定这些是唯一与该字符串模式匹配的软件包吗?检查:

rpm -qa | grep unity-scopes-m

相关内容