summaryrefslogtreecommitdiff
path: root/apt-pkg/depcache.cc
diff options
context:
space:
mode:
Diffstat (limited to 'apt-pkg/depcache.cc')
-rw-r--r--apt-pkg/depcache.cc5
1 files changed, 5 insertions, 0 deletions
diff --git a/apt-pkg/depcache.cc b/apt-pkg/depcache.cc
index 1e4771dda..390d93dc8 100644
--- a/apt-pkg/depcache.cc
+++ b/apt-pkg/depcache.cc
@@ -1345,6 +1345,11 @@ bool pkgDepCache::Sweep()
{
StateCache &state=PkgState[p->ID];
+ // skip required packages
+ if (!p.CurrentVer().end() &&
+ (p.CurrentVer()->Priority == pkgCache::State::Required))
+ continue;
+
// if it is not marked and it is installed, it's garbage
if(!state.Marked && (!p.CurrentVer().end() || state.Install()))
{