Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to customize a LiveCD, but I can't manage to fit it on a normal CD. So I investigated, and came across a few files of which I don't know if it's safe to remove them.

Maybe you can help me there?
I don't care if the files get recreated every time, as I remove them just before I start packing everything into a new ISO. So it'll still save me some space.

The files:

  • /var/cache/apt-xapian-index/index.1/postlist.DB
    • This file seems pretty useless to me, and it keeps growing every time. It's now at a 38MB, while I could have sworn it was only 27MB the last time I checked.
  • /var/cache/apt-xapian-index/index.1/termlist.DB
    • Same story as postlist.DB.
  • The files in /var/lib/apt/lists/
    • Seems to me that those are cached files which get automatically recreated when you run apt-get update, is this correct? I don't really dare to remove them unless I'm sure in case I break something. All those files together are about 50MB.
  • /boot/initrd.img-3.0.0-12-generic
    • I'm not at all sure of this one... But doesn't this file get automatically created when the user installs the system to his hard drive? I thought the initrd.lz file in the casper directory inside the ISO already contained the initrd stuff to boot the liveCD.
  • /var/cache/debconf/templates.dat
    • Doesn't this automatically get recreated when some runs apt-get update?
  • The rest of the files inside /var/cache/apt-xapian-index/index.1
    • Aren't they all cache files which automatically get recreated?

You don't have to tell me about all the files in one answer. But if you know one or more of them, I'd be grateful if you told me.

share|improve this question
    
In case you didn't notice, I have posted a partial answer to your 3-year old question. Details in my answer below. – clearkimura Nov 9 '15 at 20:59

You can remove cache files .. they are created when you update or install some files through apt...& it is recommended from my side..don't edit anything inside /boot folder .

share|improve this answer
1  
... Lucky I had a backup. – RobinJ Dec 12 '11 at 16:11
    
then, why do *buntu ISOs come with many files (more than 100MB) in /var/cache ? – LovinBuntu Nov 29 '14 at 17:54

I have only partial answer to your 3-year old question.

Delete /var/cache/apt-xapian-index

The directory is created by apt-xapian-index package, which provides the quick search feature in Synaptic Package Manager. This feature is optional, so you can safely delete the content under apt-xapian-index directory.

$ ls -l /var/cache/apt-xapian-index/index.2/
total 84912
-rw-r--r-- 1 root root        0 Nov 30  2014 flintlock
-rw-r--r-- 1 root root       28 Oct  4  2014 iamchert
-rw-r--r-- 1 root root      712 Nov 30  2014 postlist.baseA
-rw-r--r-- 1 root root      712 Nov 23  2014 postlist.baseB
-rw-r--r-- 1 root root 45531136 Nov 30  2014 postlist.DB
-rw-r--r-- 1 root root       40 Nov 30  2014 record.baseA
-rw-r--r-- 1 root root       40 Nov 23  2014 record.baseB
-rw-r--r-- 1 root root  1572864 Nov 30  2014 record.DB
-rw-r--r-- 1 root root       94 Nov 30  2014 spelling.baseA
-rw-r--r-- 1 root root       94 Nov 23  2014 spelling.baseB
-rw-r--r-- 1 root root  5423104 Nov 30  2014 spelling.DB
-rw-r--r-- 1 root root       14 Nov 30  2014 synonym.baseA
-rw-r--r-- 1 root root       14 Nov 23  2014 synonym.baseB
-rw-r--r-- 1 root root    16384 Nov 30  2014 synonym.DB
-rw-r--r-- 1 root root      543 Nov 30  2014 termlist.baseA
-rw-r--r-- 1 root root      542 Nov 23  2014 termlist.baseB
-rw-r--r-- 1 root root 34357248 Nov 30  2014 termlist.DB
$ cd /var/cache/
$ sudo rm -r apt-xapian-index

I saved at least 80 MB on my machine. However, this was done only after I realized these files were not deleted after I had purged the apt-xapian-index package some time ago.

Purge apt-xapian-index anyway

This optional feature had been causing some delays when running the package manager every time, at least from my experience on Xubuntu 12.04. So I had removed it. As a result, the quick search box will be missing (marked by a red circle in screenshot below).

apt-xapian-index-removed-in-synaptic

Removing the package doesn't mean you can't search in the package manager. While the search box is removed and quick search is disabled, the package manager will now run faster. You can always click on the Search button to do typical search.

Preserve /boot/initrd.img*

/boot/initrd.img-3.0.0-12-generic

I'm not at all sure of this one... But doesn't this file get automatically created when the user installs the system to his hard drive? I thought the initrd.lz file in the casper directory inside the ISO already contained the initrd stuff to boot the liveCD.

When doing chroot, it is essential to preserve /boot/initrd.img* and /boot/vmlinuz* files. I believe these files are needed by update-initramfs command, which will generate appropriate files for existing kernel and later copies them back to casper directory.

Like you said, it supposedly automatically created but I found this is only true on locally installed system and not for chroot case. If /boot/initrd.img* and /boot/vmlinuz* files were missing, then proceed to create Squashfs, APT will remove and redownload the same packages for existing kernel and do post-installation to ensure those files are restored.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.