Only on your own computer. This doesn't work if the whole disk is encrypted.
1. Restart and hold Shift (or press Esc) to show the GRUB menu.
2. Choose "Advanced options for Ubuntu", then a line ending in "(recovery mode)".
3. Choose "root: Drop to root shell prompt" and press Enter.
4. Make the drive writable: mount -o remount,rw /
5. Set a new password: passwd yourusername (find the name with ls /home)
6. Type exit, then choose "resume" or run reboot.
Saved passwords in the keyring may ask for the old password once. Choose to create a new keyring.