Check installed packages

Todos los paquetes con su descripcion y estado actual dpkg -l Buscar los paquetes que empiezan por g, y mostrar su estado dpkg -l | grep '^....g' aptitude search '~i(~n gr)' Mostrar todos los paquetes que empiezan por gr dpkg -l | awk '{print $2}' | grep ^gr List all packages ordered by installed size The easiest way (without installing extra packages) is: dpkg-query -Wf '${Installed-Size}\t${Package}\n' | sort -n which displays packages in size order, largest package last. ...

July 24, 2020 · Alberto Casado

Remove older kernel versions

These were taken from this source. My one-liner to remove old kernels (this also frees up disk space) dpkg --list | grep linux-image | awk '{ print $2 }' | sort -V | sed -n '/'`uname -r`'/q;p' | xargs sudo apt-get -y purge Explanation (remember, | uses the output of the previous command as the input to the next) dpkg –list lists all installed packages grep linux-image looks for the installed linux images awk '{ print $2 }' just outputs the 2nd column (which is the package name) sort -V puts the items in order by version number sed -n '/'`uname -r`'/q;p prints the lines before the current kernel xargs sudo apt-get -y purge purges the found kernels Unwinding the sed invocation: ...

July 24, 2020 · Alberto Casado