I created my custom local repository by following the procedure given here:
My repository is at /home/custompkgs.
I created the database file of the repository in the same directory as mentioned above using the command
repo-add ./custompkgs.db.tar.gz ./*.pkg.tar.xz
I enabled custompkgs repository in /etc/pacman.conf by removing the comments. I also disabled all other internet repositories. After this, when I try the command suggested by Rahtgaz above, I got error message telling that there is no database for my custompkgs repository. But when I checked the directory, custompkgs.db.tar.gz file is present there.
After this, I opened pamac and refreshed the database.
After doing this in pamac, I tried the commands suggested by Rahtgaz for batch installation in the terminal. It worked perfectly.
I am unable to explain, why the database did not load first time.