(self)
Clear the package list cache by removing the files under ``/var/lib/apt/lists``.
Clear the package list cache by removing the files under ``/var/lib/apt/lists``.
Clear the package list cache by removing the files under / var / lib / apt / lists .
def clear_package_lists(self):
        """Clear the package list cache by removing the files under ``/var/lib/apt/lists``."""
        timer = Timer()
        logger.info("Clearing package list cache of %s ..", self.context)
        self.context.execute(
            # We use an ugly but necessary find | xargs pipeline here because
            # find's -delete option implies -depth which negates -prune. Sigh.
            'find /var/lib/apt/lists -type f -name lock -prune -o -type f -print0 | xargs -0 rm -f',
            sudo=True,
        )
        logger.info("Successfully cleared package list cache of %s in %s.", self.context, timer)
def clear_package_lists ( self ) : timer = Timer ( ) logger . info ( "Clearing package list cache of %s .." , self . context ) self . context . execute ( # We use an ugly but necessary find | xargs pipeline here because # find's -delete option implies -depth which negates -prune. Sigh. 'find /var/lib/apt/lists -type f -name lock -prune -o -type f -print0 | xargs -0 rm -f' , sudo = True , ) logger . info ( "Successfully cleared package list cache of %s in %s." , self . context , timer )