Apple iOS 4.2.1 is already out and people have successfully installed it on their iPhone, iPod touch and iPad. But some iPhone 4 owners are facing an Error Code 1013 when they try to upgrade to iOS 4.2.1 from iTunes. If you are one of them, then you can try the solution below to fix the Error Code 1013 when upgrading to iOS 4.2.1 using iPhone 4. This trick was posted on Apple Support Discussion forum by the user Dave.
The iPhone “iPhone ” could not be restored. An unknown error occurred (1013).
Beware upgrading to iOS 4.2.1 will also upgrade your iPhone 4 baseband to the latest version.
Steps for Fixing Error Code 1013:
Step 1. Go to your “Applications” folder.
Step 2. Then go to “Utilities” folder.
Step 3. Launch “Terminal”.
Step 4. Type the following command in terminal “sudo nano /etc/hosts” and hit enter.
Step 5. Terminal will ask for you password, enter your password.
Step 6. Use the down arrow key to find the “gs.apple.com” entries. Once the cursor is in front, make sure you comment out the line(s) by entering “#” in front of the text.
Step 7. Save the file by pressing CONTROL+O.
Step 8. Exit the nano editor by pressing CONTROL+X.
Step 9. Restore your iDevice.
Step 1. Start –> Programs –> Accessories
Step 2. Run Notepad
Step 3. Now File->Open in Notepad.
Step 4. Browse to Windows/System32/drivers/etc
Step 5. select all documents in “files of type:”
Step 6. Open “hosts”
Step 7. Delete all lines containing “gs.apple.com” or similar to that
Step 8. Save the file.
Step 9. Restore your device