/var/cache/pacman/pkgto a folder called
repoon a USB stick. From the command line I mounted the usb stick on my new installation to /mnt/usb.
mount -t vfat /dev/sdb1 /mnt/usb
Now, all I had to do was to tell pacman to look for packages in the repo folder in the USB stick. I achieved this by setting
#DBPath = /var/lib/pacman/
CacheDir = /mnt/usb/repo/
LogFile = /var/log/pacman.log
Actually, you can also try creating a local repo. It is there in the pacman manual pages. However, this seemed easier and faster to me and worked on first go.
After this setting, when I tried installing
Xorgit told me that there is no extra.db and community.db; but I had those repos enabled and therefore it failed. I realized only core.db existed in my system and I had not synced the repo databases even once. I could have achieved that by
pacman -Syu; but for my internet connection to work I needed to install
usb_modeswitchas I use a 3G USB internet card. So, I just copied extra.db and community.db from my old system into the new one and things worked fine.