我如何删除包及其依赖项?

我如何删除包及其依赖项?

我怎样才能回到安装包之前的状态?

安装:

# apt-get -y install --no-install-recommends build-essential
...
The following additional packages will be installed:
  binutils cpp cpp-5 dpkg-dev g++ g++-5 gcc gcc-5 libasan2 libatomic1
  libc-dev-bin libc6-dev libcilkrts5 libdpkg-perl libgcc-5-dev libgdbm3
  libgomp1 libisl15 libitm1 liblsan0 libmpc3 libmpfr4 libmpx0 libperl5.22
  libquadmath0 libstdc++-5-dev libtsan0 libubsan0 linux-libc-dev make patch
  perl perl-modules-5.22 xz-utils
Suggested packages:
  binutils-doc cpp-doc gcc-5-locales debian-keyring g++-multilib
  g++-5-multilib gcc-5-doc libstdc++6-5-dbg gcc-multilib manpages-dev autoconf
  automake libtool flex bison gcc-doc gcc-5-multilib libgcc1-dbg libgomp1-dbg
  libitm1-dbg libatomic1-dbg libasan2-dbg liblsan0-dbg libtsan0-dbg
  libubsan0-dbg libcilkrts5-dbg libmpx0-dbg libquadmath0-dbg glibc-doc
  libstdc++-5-doc make-doc ed diffutils-doc perl-doc libterm-readline-gnu-perl
  | libterm-readline-perl-perl
Recommended packages:
  fakeroot libalgorithm-merge-perl manpages manpages-dev
  libfile-fcntllock-perl rename
The following NEW packages will be installed:
  binutils build-essential cpp cpp-5 dpkg-dev g++ g++-5 gcc gcc-5 libasan2
  libatomic1 libc-dev-bin libc6-dev libcilkrts5 libdpkg-perl libgcc-5-dev
  libgdbm3 libgomp1 libisl15 libitm1 liblsan0 libmpc3 libmpfr4 libmpx0
  libperl5.22 libquadmath0 libstdc++-5-dev libtsan0 libubsan0 linux-libc-dev
  make patch perl perl-modules-5.22 xz-utils

移动:

# apt-get -y --purge --auto-remove remove build-essential
...
The following packages will be REMOVED:
  build-essential*

# apt-get -y --purge autoremove
...
The following packages will be REMOVED:
  g++* g++-5* libstdc++-5-dev*

为什么要保留其他的东西?

答案1

简而言之:

sudo bash -c 'echo "Apt::AutoRemove::SuggestsImportant false;" > /etc/apt/apt.conf.d/01autoremove-suggested'

此行为由选项控制Apt::AutoRemove::SuggestsImportant

选项:Apt::AutoRemove::SuggestsImportant

默认值: true

描述:如果该选项为真,则只要任何已安装的软件包建议使用未使用的软件包,aptitude 就不会将其视为未使用的软件包(因此不会自动删除它们)。有关更多信息,请参阅“管理自动安装的软件包”一节。

来源:

Aptitude 不会删除自动安装的软件包

相关内容