summaryrefslogtreecommitdiff
path: root/apt-pkg
diff options
context:
space:
mode:
Diffstat (limited to 'apt-pkg')
-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 87443f9f3..81e1eeb33 100644
--- a/apt-pkg/depcache.cc
+++ b/apt-pkg/depcache.cc
@@ -1324,6 +1324,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()))
{