Olhando no arquivo cmdline/apt-get.ccdo tarball de origem em http://packages.ubuntu.com/source/maverick/apt , posso ver que esse --auto-removeé um argumento que permite a APT::Get::AutomaticRemoveconfiguração.
Os comandos autoremovee removeas chamadas da função DoInstall.
O comando "autoremove" APT::Get::AutomaticRemovetambém define e, portanto, faz o mesmo que --auto-remove.
Observando a DoAutomaticRemovefunção, é claramente visível que ativar a APT::Get::AutomaticRemoveconfiguração ( --auto-removee autoremovefaz isso) faz com que o Apt faça um loop em todos os pacotes instalados e marque os pacotes não utilizados para exclusão.
De main():
CommandLine::Args Args[] = {
// ... stripped to save space
{0,"auto-remove","APT::Get::AutomaticRemove",0},
// ...
}
CommandLine::Dispatch Cmds[] = { // ...
{"remove",&DoInstall},
{"purge",&DoInstall},
{"autoremove",&DoInstall},
// ...
}
// ...
// Parse the command line and initialize the package library
CommandLine CmdL(Args,_config);
De DoInstall():
unsigned short fallback = MOD_INSTALL;
if (strcasecmp(CmdL.FileList[0],"remove") == 0)
fallback = MOD_REMOVE;
else if (strcasecmp(CmdL.FileList[0], "purge") == 0)
{
_config->Set("APT::Get::Purge", true);
fallback = MOD_REMOVE;
}
else if (strcasecmp(CmdL.FileList[0], "autoremove") == 0)
{
_config->Set("APT::Get::AutomaticRemove", "true");
fallback = MOD_REMOVE;
}
Da função DoAutomaticRemove:
bool doAutoRemove = _config->FindB("APT::Get::AutomaticRemove", false);
// ...
// look over the cache to see what can be removed
for (pkgCache::PkgIterator Pkg = Cache->PkgBegin(); ! Pkg.end(); ++Pkg) {
if (doAutoRemove) {
if(Pkg.CurrentVer() != 0 &&
Pkg->CurrentState != pkgCache::State::ConfigFiles)
Cache->MarkDelete(Pkg, purgePkgs);
else
Cache->MarkKeep(Pkg, false, false);
}
}
Não consigo falar se é intencional ou não, você pode preencher um erro / fazer uma pergunta no launchpad.net .
No momento, não é possível excluir pacotes da exclusão por apt-get autoremove. Se você deseja manter os pacotes, execute apt-get -s autoremove, copie-os da lista e remova-os da lista que deseja manter. Por fim, remova esses pacotes: sudo apt-get purge [packages-to-be-removed](a limpeza também remove os arquivos de configuração, se houver)