How to install and update Ubuntu to a Pen drive

I want to install Ubuntu into a pen drive. The pen drive is 16GB and I want to be able to boot from it (Not the LiveCD but the actual installed system) and be able to update and install new packages.

At the end I want to be able to have the latest Firefox, Apache, MySQL, PHP installed and an updated Ubuntu in it.

I have read several questions but they are all how to install Ubuntu FROM a pen drive. I want to install it TO a pen drive.


As per my answer here:

How to create a bootable USB with multiple ISO images in it

This is what i did to run Xubuntu From a SD card it applies to USB sticks too it's really simple actually.

First we need 2 USB sticks, one for the liveCD's and the other to install the OS.

Ok, so now first make a liveUSB bootable drive, I recommend you to use UNetbootiN, to do this, pick the iso and create the liveUSB.

Now, that you have the bootable USB, reboot your PC and start the liveUSB, once you're in there start the live session.

Once you're in connect the second USB to the PC and format it to EXT4, then simply point the installer to the USB drive and that's it ( i went a little on the extreme side, and disconnected all of my Hard drives to avoid grub being insalled on them or messing the existing installations).

And now you only need to set the BIOS of your PC to boot the USB device where you installed the System.