Linux OS ( in my case Kali)
libimobiledevice is a cross-platform software library that talks the protocols to support iPhone®, iPod Touch®, iPad® and Apple TV® devices. It is released under GPL.
More information can be found at http://www.libimobiledevice.org.
To make use of the above-mentioned library, git-clone or download the source of all the files in the repository located at http://cgit.libimobiledevice.org/ , and build it from source.
syntax for restoring.
idevicerestore -e yourIPSW.ipsw
where yourIPSW.ipsw is the latest firmware for the appropriate iDevice.
full credits to the above-mentioned site and the authors/creators of the library.
below is the video of the update/restore process.