Q:

Shadripu in Hindu texts

What is the source of the concept of Shadripu (six enemies) in Hindu philosophy, i.e., which Hindu religious text first described the Shadripu (षड्रिपु)?
From Wikipedia :

Shadripu (Sanskrit: षड्रिपु meaning the six enemies)
The shadripus have been listed as:

Lust (Kama)
Anger (Krodha)
Greed (Lobha)
Arrogance (Mada)
Attachment (Moha)
Jealousy (Matsarya)

A:

It is difficult to say which Hindu text mention them for the first time.But they do mention about the Shada Ripus or the six enemies of mankind.They are better(or also) known as Ari Shad Vargas.(Ari=Enemy,Shad=Six)
They are:

Arishad vargas: or Shat Gunas: Kaama or Desire, Krodha or Anger,
  Lobha or Avarice, Moha or Infatuation, Mada or Ego, Matsarya or
  Jealousy.

For the time being i am only able to quote from the Bhavisya Purana which mention them in the context of Brahmachari duties(duties of a celibate life ,life of a student):

Needless to emphasise that a Brahmachari should get rid of meat, madya
  (intoxicants), gandha or scented bases, flower garlands, violence,
  body-decoratives and scents, footwear, umbrellas, dance and music
  other than for religious purposes. The other taboos include
  Asatya(utterances of lies), Asteya (stealing), Para Ninda(criticism of
  others), company of women and involvement of Arishad -vargas or the
  Six Enemies of human beings like desire, anger, greed, attachment, ego
  and envy

But,i am quite sure that,besides Bhavisya Purana, they find mention in many other Hindu Shastras as well.I'll try to search for the same and update my answer if and when i find them.
Update- Here is a not-so-direct reference to Arishadavargas from "Apara Stuti of Shiva by Maha Rishis at Darukavana" found in the Linga Purana:

Sarvathaa vartamaanopi yoyo Bhaavo Bhavishyati, Twaameva thatr
  prashamo Brahmanaa tathitam tathaa/
  Kaamah krodhasccha lobhascha vishaado Mada yeva cha, yatadicchaamahe bodhum praseeda Parameswara
Our venerations to you Mahadeva! As you are devoid of the
  ‘Shatvargas’or the Six Enemies of humanity viz. Kama-Krodha-
  Lobha-Moha-Mada and Matsaraas or Lust-Anger-Greed-Attachment-Pride and
  Envy, besides Vishada or Grief. Parama Shiva!

Further from Hindupedia.com we find the following additional information:

Ariṣaḍvarga literally means ‘group of six enemies
Religion has always considered mokṣa or liberation from transmigratory
  existence, as the real and the ultimate goal of life. Since this is
  got by realising the ātman - one’s true Self already present in
  everyone but covered over by various impurities of the mind, it is
  first necessary to efface them.
These impurities of mind, which act as ‘ari’ or an enemy in the path
  of spiritual evolution, are generally classed into six varieties and
  are called ‘ariṣaḍvarga’, the group of six enemies. They are :
Kāma - Lust
Krodha - Anger
Lobha - Avarice
Moha - Delusion
Mada - Arrogance
Mātsarya - Jealousy

Some of the treatises of Vedānta like the Jivanmuktiviveka of
  Vidyāraṇya (14th century A. D.) deal with the methods of eradicating
  them. According to the teachers of bhakti or devotion, these six
  passions can be eliminated by nāmajapa (repetition of the divine name)
  and upāsanā (meditation on God) or sublimated by directing them
  towards God Himself!

A:

There is a mention of ari-ṣaḍ-varga (a.k.a ṣaḍ-ripu) in the third chapter of Maitreya Upaniṣad of Sāma-veda which is a dialogue between Lord Śiva and Sage Maitreya.

[Śiva says]
षड्विकारविहीनोऽस्मि षट्कोषरहितोऽस्म्यहम् । 
अरिषड्वर्गमुक्तोऽस्मि अन्तरादन्तरोऽस्म्यहम् ॥ १८॥
III-18. I am devoid of the six changes (of birth, etc), I am without the six sheaths (the gross material body, etc); I am free from the group of six (internal) enemies (passions, etc) and I am the witness, being the supreme God.

The Devī Bhāgavatam lists the 6 inner enemies that a yogi needs to conquer.

हिमालय उवाच 
योग वद महेशानि सांग संवित्प्रदायकम्। कृतेन येन योग्योऽहं भवेयं तत्वदर्शने ॥१॥ 
श्रीदेव्युवाच 
न योगो नभस: पृछे न भूमी न रसातले । ऐक्यं जीवात्मनोराहुर्योग योगविशारदाः ॥२॥ 
तत्प्रत्यूहाः षडाख्याता योगविघ्नकरानघ । कामक्रोधौ लोभमोहौ मदमात्सर्यसंज्ञकौ ॥३॥ 
1.
Himâlayâ said :-- "O Mahesvarî! Now tell me the Yoga with all its Amgas (limbs) giving the knowledge of the Supreme Consciousness so that, I may realise my Self, when I practise according to those instructions.
2-10. Srî Devî said :-- "The Yoga does not exist in the Heavens; nor does it exist on earth or in the nether regions (Pâtâla). Those who are skilled in the Yogas say that the realization of the identity between the Jivâtma and the Paramâtmâ is "Yoga." O Sinless One! The enemies to this Yoga are six; and they are lust, anger, greed, ignorance, vanity and jealousy. The Yogis attain the Yoga when they become able to destroy these six enemies by practicing the accompaniments to Yoga.

