Yes, you can. You have (at least) two options, you can loop-mount ubuntu.img and chroot and upgrade and you can also loop-mount delete everything and install by debootstraping 12.04 directly, but this one would need more work to tweak up everything like i describe in the other thread where i put the example with debian.
I think the esaiest way is to upgrade.
Asuming you have a linux enviroment in your computer (virtual or native, or even livecd, it doesn't matter) make a copy of ubuntu.img (just in case something goes wrong to be able to repeeat or just keep the older one, but you can always redownload it)
(i asume you are in the folder were you have the copy of ubuntu.img and it's also named ubuntu.img)
then mount-loop in some folder, for example:
create folder
mount the image
Code:
sudo mount -o loop ubuntu.img target
you have to install qemu-user-static in order to be able to chroot to another architecture enviroment:
Code:
sudo aptitude install qemu-usr-static
and copy the correct binary
Code:
sudo cp /usr/bin/qemu-arm-static target/usr/bin
you may need to mount proc and sys and if you don't mount dev before chroot you won't have /dev/pts and you will get some warnings but they don't mean any problem it's just anoyin
how to mount dev
before chroot:
Code:
mount --bind /dev target/dev
EDITED: trick to have enough space and all packagaes needed for upgrading outside the image, so you will have enough space and if you repeat this process you will already downloaded all packages so the upgrade will be much faster
create another folder named temp:
(partial is a folder needed inside /var/cache/apt/archives)
and then mount it over apt cache folder
Code:
sudo mount --bind temp target/var/cache/apt/archives
/EDITED
and now you can chroot:
mount proc and sys inside chroot
Code:
mount -t sysfs sysfs /sys
now you can upgrade, but you don't have desktop enviroment so you will have to upgrade in the "server" way
install update-manager-core
Code:
sudo apt-get install update-manager-core
you may need to edit /etc/update-manager/release-upgrades and set Prompt=normal . I don't know it's been a long time since i haven't use ubuntu
and then upgrade:
Code:
sudo do-release-upgrade -d
now unmount proc and sys:
Code:
sudo umount /proc
sudo umount /sys
and exit chroot
and now unmount dev and aptcache folder
Code:
sudo umount target/var/cache/apt/archives
i think i haven't miss anything. Let me know if you have any problem.
EDIT: sure, you should remove all downloaded deb packages for the space (sudo aptitude clean) after finished
ONLY IF YOU DON'T DO /varr/cache/apt/archives trick descrived below Because if you mount --bind an external folder it won't affect the original ubuntu.img and you will have all those deb packagess already download if you make another attemp so you will save time downloading things.
And another important thing:
I don't know how much free space is in that image so before upgrading execute df -h to see if you will have enough space to upgrade (i think before attempting the upgrade update-manager will tell you i need to download XXXMb or something like that
if you don't have enough space you can mount --bind another partition/folder/filesystem to give more space to do it, like you mounted /dev
for example, if you have linux installed and enough space in the folder you are working create another folder named temp:
(partial is a folder needed inside /var/cache/apt/archives)
and then mount it over apt cache folder
Code:
sudo mount --bind temp target/var/cache/apt/archives
now you will have all the space you had in your home folder aviable inside the chroot enviroment located in /var/cache/apt/archives were deb packages are downloaded for the upgrade. Remember you have to do this outside chroot enviroment, if you already are inside open another terminal to do it without exiting:
and remember also to unmount everithing after finished.