Used-bike: How much to reserve for repairs/upgrades of total budget? Let's say I have 500€ to buy a second hand bike. How much of that budget shall I keep for repairs and upgrades, and how much shall I spend on the bike itself? 

Of course it depends on the condition of the bike, but I was wondering if there is some general wisdom about this.

When buying a second hand car, the common wisdom says that ~30% of one's budget should be kept for immediate repairs and upgrades. So when someone has 10000€ for a second hand car, wisdom says to buy a car for 7000€, and keep the rest 3000€ for the repairs and upgrades after the buy.



The resources I found had no mention about the expected costs of repairs and upgrades.

I researched these topics already:


What should I do to get an older bike into good condition?
What should I look for when buying a used bicycle?
How to tell if a bike is good before purchasing?
Purchasing a bike
Suggestions for budget mountain bike with opportunities for upgrade
What to look out for in a second hand bike buy
Buying a higher quality use bike vs. a lower quality new bike


External resources:


Buying used bikes for beginners
Buying a Used Bike 2: Things to Look (Out) For
How to buy a used bike
Google search: how to buy a second hand bike
For convenience here I've made some assumptions here about the type of bike you're buying, but since you don't say...

If I were buying a second-hand bike, I would examine the following as soon as I got it:


chain
cassette
tyres
brake pads
brake/gear cables (conceivable but unlikely)


and if any of these showed sufficient wear I would change them. You can get a ballpark estimate of the associated cost from Google, but note that changing the top two and the last requires special tools, so you might need to factor these in as well (or mechanic costs). 

I'd have thought all those items would come to a bit less than €100 as a guide, just the parts, with no labour or tools. But you should take this with a pinch of salt because it depends on the specific items you get - you could quite easily blow €100 on a pair of tyres alone if the fancy took you. Similarly you probably wouldn't have to change all of them, at least initially.

Provided the bike is in generally good condition, this should be all you need to change in the  short term (first year or so). But of course because it is used, you're taking a bit of a chance that it doesn't have other stuff wrong with it that you'll need to sort.