Root filesystem clean up procedure

Root filesystem clean up procedure

Derived from a Fermin's message to the list 1

This is a description of the general procedure carried out to clean up a root_fs after upgrading/installing new packages.

In order to clean the filesystem two steps should be performed, in sequence:

  Start a virtual machine that uses the filesystem in direct mode (that is, using the directive . If you plan to update packages you will also need connection to Internet from the virtual machine. Alternatively, you can mount the filesystem and use chroot from host. Once you are inside the filesystem:

 Clean the APT cache (after apt-get update, install, upgrade, etc. or whatever other APT operation) 

apt-get clean

It is not exactly a clean up operation, but if the /lib/tls directory exists (it seems to be created sometimes during the upgrading of some packages) rename it to /lib/tls.disabled (removing previous existing /lib/tls.disabled directory) (*)  It is not exactly a clean up operation, but you should also edit and change the /etc/root_fs_tutorial-version file (*)  "Outside" filesystem, supposing is mounted in /mnt/loop

cd /mnt/loop/var/cache/apt rm -f pkgcache.bin srcpkgcache.bin (**) cd /mnt/loop/tmp rm -rf * rm -f /mnt/loop/root/.bash_history cd /mnt umount /mnt/loop



(*) This step also can be done from "outside" filesystem

(**) And, in general, any other file, except the archive/ directory

-

test stuff to delete:


 * 1) "Inside" filesystem (I mean, using a running virtual machine that uses this filesystem as or mounting it and chrooting from host):
 * 2) * Clean the APT cache (after apt-get update, install, upgrade, etc. or whatever other APT operation)
 * apt-get clean


 * 1) * It is not exactly a clean up operation, but if the /lib/tls directory exists (it seems to be created sometimes during the upgrading of some packages) rename it to /lib/tls.disabled (removing previous existing /lib/tls.disabled directory) (*)
 * 2) * It is not exactly a clean up operation, but you should also edit and change the /etc/root_fs_tutorial-version file (*)
 * 3) "Outside" filesystem, supposing is mounted in /mnt/loop

cd /mnt/loop/var/cache/apt rm -f pkgcache.bin srcpkgcache.bin (**) cd /mnt/loop/tmp rm -rf * rm -f /mnt/loop/root/.bash_history cd /mnt umount /mnt/loop

List Examples:

Wiki:

You can even do mixed lists
 * 1) and nest them
 * 2) inside each other
 * 3) * or break lines in lists.
 * 4) ; definition lists
 * can be
 * nested : too

HTML:

 list item A1    list item B1</li> list item B2</li> </ol>continuing list item A1 </li> list item A2</li> </ol>