The importance of sleep in maintaining cognitive functions such as learning and memory has been reported in both vertebrates and invertebrates. Previous studies demonstrated that sleep deprivation impaired the olfactory memory retention of fruit flies in classical conditioning paradigms. Here, we show that sleep deprivation leads to a preference for the odours of the rearing environment in Drosophila melanogaster. Flies disturbed with periodic rotation stimuli during nighttime preferred apple cider vinegar over broth, while this preference was lower in undisturbed controls and in flies rotated during the daytime. These results suggest that sleep functions in food odour preference and that sleep deprivation increases attachment to familiar environmental cues, reducing preference for novel odours.