Evaluate installed Linux kernel packages (linux-headers
, linux-image
,
linux-image-extra
) and purge any that are not the current version or the
newest version.
dpkg
expects a more robust path:
PATH=/usr/sbin:/usr/bin:/sbin:/bin @daily /usr/local/sbin/kernel_cleanup.py -q
Tested on:
- Ubuntu 10.04 LTS (Lucid Lynx)
- Ubuntu 12.04 LTS (Precise Pangolin)
- Ubuntu 14.04 LTS (Trusty Tahr)
- Ubuntu 16.04 LTS (Xenial Xerus)
Change directory into repository (into same directory as where this README resides).
Install virtual environment:
mkvirtualenv --system-site-packages -a $(pwd) -r tests/requirements.txt \ kernel_cleanup_test
If installing requirements errors, update pip:
pip install --upgrade pip
Install requirements:
pip install -r tests/requirements.txt
Run pytest:
py.test
To test against alternate Python versions, it may be useful to create virtual
environments with an interpreter other than the one with which virtualenv
was installed, e.g. for non-default python3:
mkvirtualenv --system-site-packages -a $(pwd) -p $(which python3) \ -r tests/requirements.txt kernel_cleanup_test3