Is it necessary to give my debit card details to update the macbook?
Yes this is normal and necessary once Apple asks for that information on your Apple ID. When you initially sign up, this can be optional based on how precisely you establish your AppleID, but once asked, you must enter a valid form of payment to continue to use that AppleID in the stores. 

You are still purchasing and agreeing to be legally bound to the license terms when you install “free” software in any of Apple’s online stores. A form of payment is a very strong anti-fraud method since there is a paper trail to get payment credentials. 

Once you validate your identity, you can usually make the payment method none, use a card with low balance as suits your needs.