Dosyaya http://packages.ubuntu.com/source/maverick/apt adresindekicmdline/apt-get.cc tarball dosyasından bakıldığında , bunun ayarı sağlayan bir argüman olduğunu görebiliyorum .--auto-removeAPT::Get::AutomaticRemove
Komutlar autoremoveve removeher ikisi de işlevi çağırır DoInstall.
"Autoremove" komutu da ayarlar APT::Get::AutomaticRemoveve bu nedenle aynı şeyi yapar --auto-remove.
İşleve bakıldığında, DoAutomaticRemoveişlevi etkinleştirenAPT::Get::AutomaticRemove ayarın ( --auto-removeve autoremovebunu yapar) tüm yüklü paketlerde Apt döngüsüne neden olduğu ve kullanılmayan paketleri silmek için işaretlediği .
Kimden 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);
Kimden 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;
}
İşlevden 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);
}
}
Ben doldurmak olabilir, amaçlanan dışı olup olmadığı konuşamıyor bir hata / sormak soru en launchpad.net .
Şu anda, paketleri silme işleminin dışında bırakmak mümkün değil apt-get autoremove. Paketleri saklamak istiyorsanız, çalıştırın apt-get -s autoremove, paketleri listeden kopyalayın ve saklamak istediğiniz paketleri listeden kaldırın. Son olarak, şu paketleri kaldırın: sudo apt-get purge [packages-to-be-removed](temizleme, varsa yapılandırma dosyalarını da kaldırır)