LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Password
Linux - Kernel This forum is for all discussion relating to the Linux kernel.

Notices


Reply
  Search this Thread
Old 07-15-2020, 05:18 AM   #1
bendipa
Member
 
Registered: Aug 2018
Posts: 35

Rep: Reputation: Disabled
Old Linux Kernel Residues


In the directory var/lib/dpkg/info I've noticed lots of files that reference old kernel versions going back months/years. Eg here are some files that reference a version that goes back several months. But there are plenty more that go back a few years.

Is it safe to delete all these old kernel reference files?
 
Old 07-15-2020, 05:30 AM   #2
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,830

Rep: Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308
if you don't need them yes.
 
Old 07-15-2020, 05:31 AM   #3
hazel
LQ Guru
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 7,570
Blog Entries: 19

Rep: Reputation: 4451Reputation: 4451Reputation: 4451Reputation: 4451Reputation: 4451Reputation: 4451Reputation: 4451Reputation: 4451Reputation: 4451Reputation: 4451Reputation: 4451
When you're dealing with an advanced package management system, it's never a good idea to delete files by hand. These files form part of dpkg's database and if it gets corrupted, your updates could start misbehaving. The command sudo apt-get clean or sudo apt-get autoclean should clear out the old files. Autoclean clears out files that are out of date and no longer available. Clean is more drastic and cleans out the whole cache.
 
1 members found this post helpful.
Old 07-15-2020, 07:50 AM   #4
shruggy
Senior Member
 
Registered: Mar 2020
Posts: 3,670

Rep: Reputation: Disabled
@hazel. True in principle, but apt-get clean/autoclean will clear up /var/cache/apt/archives, not /var/lib/dpkg/info. The files there stay until the package in question gets purged. On my systems, I've defined this alias:
Code:
alias dlc='dpkg-query -Wf'\''${Status} ${Package}\n'\''|awk '\''$3~/config-files/{print$4}'\'''
This will show what packages were removed, but not purged, i.e. still have residual (config) files on your system.

Another way to show them is aptitude search \~c which also gives a convenient way to purge them:
Code:
sudo aptitude purge \~c
 
1 members found this post helpful.
Old 07-15-2020, 08:09 AM   #5
hazel
LQ Guru
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 7,570
Blog Entries: 19

Rep: Reputation: 4451Reputation: 4451Reputation: 4451Reputation: 4451Reputation: 4451Reputation: 4451Reputation: 4451Reputation: 4451Reputation: 4451Reputation: 4451Reputation: 4451
You learn all the time! I thought that purge only removed configuration files from /etc.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Old linux, old hardware, old user/adm, but always a newbie 3dBdown Linux - Newbie 4 02-15-2011 08:54 PM
Old, old, old laptop just wondering.... Butler615 Linux - General 2 09-02-2007 03:01 PM
want linux for an old old old pc angryfirelord Linux - Distributions 5 05-20-2006 12:22 PM
Should I clean up the residues of failed installations ? ebarahonaf Linux - Newbie 1 02-14-2005 08:29 PM
big plans for old old old laptop vdogvictor Linux - Laptop and Netbook 0 05-26-2004 07:33 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel

All times are GMT -5. The time now is 06:37 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration