How to clear the CUPS print queue

To cancel a print job in the queue just use cancel. To see all the available jobs in the queue just use lpstat.

$ lpstat -o
HP-Officejet-7610-2-128 user2     240640   mié 09 mar 2016 11:07:14 CET
HP-Officejet-Pro-8620-137 jose             55296   dom 03 jul 2016 13:29:49 CEST
$ cancel -a HP-Officejet-7610-2-128
$ cancel -a HP-Officejet-Pro-8620-137

How to compile the linux kernel

Download a kernel source from and let’s suppose that it is extracted in the directory ~/linux-x.yy.zz

Sometimes it can be a good idea to start with a current kernel configuration. You can get this configuration from the text file /boot/config-xx.yy.zz or a compressed version from /proc/config.gz. Copy the text file into ~/linux-x.yy.zz/.config.

Now you can start configuring the new kernel by executing inside the dir ~/linux-x.yy.zz/:

make menuconfig

Then compile the kernel, the modules and the image:

make bzImage

If everything it’s ok the new kernel will be in ~/linux-x.yy.zz/arch/x86/boot/bzImage. Copy this file to the boot directory in the desired machine:

cp ~/linux-x.yy.zz/arch/x86/boot/bzImage /boot/vmlinuz-x.yy.z

Now you have to compile and install the modules:

make modules 
make modules_install

This will copy all the firmware and modules to /lib/firmware and /lib/modules/x.yy.z. If you want to change the directory you can do it by defining the INSTALL_MOD_PATH environment variable.

After install all the modules you have to go to /boot directory, create the initramfs and update the grub.

update-initramfs -c -k x.yy.zz