{"id":63,"date":"2012-07-23T10:58:41","date_gmt":"2012-07-23T09:58:41","guid":{"rendered":"http:\/\/toolbox.pingvinfeszek.hu\/?p=63"},"modified":"2016-03-02T10:54:24","modified_gmt":"2016-03-02T09:54:24","slug":"remove-unused-kernel-header-files-in-ubuntu","status":"publish","type":"post","link":"https:\/\/wp.gaborhargitai.hu\/remove-unused-kernel-header-files-in-ubuntu\/","title":{"rendered":"Remove unused kernel header files in Ubuntu"},"content":{"rendered":"
Straightforward, constant updating is the key to have a fresh and bleeding edge Ubuntu system. However, for those of you who are strapped for disk space – for instance if you are hosting multiple operating systems on one drive – “useless” files can eat up quite a big chunck of your available megabytes. Numerous ways exist to erase and purge unnecessary files and packages, but for the most part they all omit one crucial step: removing those kernel headers that have remained on your drive since downloading and using them for the first time<\/strong>.<\/p>\n In order to remove ALL<\/strong> but the one you are currently<\/strong> using (check it by entering “uname -r<\/strong>” in the Terminal), hit up a Terminal and issue the following command in one line:<\/p>\n The APT daemon will ask you whether you’d like to remove the headers and stuff – be sure to double check your current kernel’s version. That’s all folks \ud83d\ude42<\/p>\n <\/p>\n
\nsudo apt-get purge $(dpkg --get-selections | awk '((\/^linux-\/) && (\/[0-9]\\.\/) && (!\/'\"`uname -r | sed \"s\/-generic\/\/g\"`\"'\/)) {print $1}')<\/code>
\n <\/p>\n