although @luser covered pretty nice most of the techniques you could use to train your pinky, but i found that this wasn't enough. sometimes after you stretch and reach out for a far fret using your pinky, what's happening is that you are stretching the muscles and tendons of your pinky so the moment you want to use it again in a semi-relaxed position you'll find it difficult.

in this riff you are starting with your pinky on 4th fret of the G then stretching it to reach 5th on E and 5th on B. and after that there's a little break down where you'll have your pinky on 4th of the D. that's when you'll feel that you can't relax your pinky enough to fret the 4th of the D.

If you play E minor pentatonic as 9/4, 12/4, 10/5, 12/5, 10/6, 12/6 (first number is the fret. Second number is the string.), everything on the 12th fret is done with the pinky, and that's half of the scale, so that would help with training your pinky.

A John petrucci training exercise I used a while back helps a lot with finger dexterity
You start off with a basic chord of :
1
2
3
4
X
X
Then move your index up a fret and switch positions with the middle finger like so:
2
1
3
4
X
X
Then you move up the whole 4 strings you are fretting with the index
When you're done you should have:
4
1
2
3
X
X
Then you start moving your middle finger same pattern
Go through the last two fingers including the pinky to reach the first chord again:
1
2
3
4
X
X
The idea is to keep all your fingers on the fret board except the ones that are being switched
It will start off as being clumsy but then it will really strengthen your fingers and give you dexterity in all of the fingers and finger independence
If you don't understand what I mean I'll make a more detailed answer
The pattern ends with the same starting chord so rinse and repeat

I find practising scales exercise the pinky quite a lot (with the "correct" fingering). Plain old major scale up and down will do fine, but also try e.g. 1-3-5-2-4-6... (The numbers refer to scale degrees, so for an A major scale it would be A-C#-E-B-D-F#...) If you e.g. start with your middle finger on the lower E string, 5th fret A, the pinky will be used on the E and the B and so forth. This can of course be varied infinitely with different scales and patterns.

Another thing to try are power chords with an added 9th:

%1/1.3/2.5/4.0/0.0/0.0/0

I think they sound pretty neat and are fun to play around with, something which is hard to say about scale exercises.

This guy's "neoclassical" lick is very easy to learn, but emphasizes using the pinky in a way I have found to be a great exercise for this, especially if you try it alternating between pinky and ring finger. I was very clumsy at first, but doing this regularly has helped my picking, and especially my pinkie strength and dexterity.

If you're starting again after a long break, you might want to consider taking the opportunity of revising your technique. I was fortunate enough to be given classical guitar lessons at an early age, and the first thing I learnt was that the thumb goes on and behind the neck opposite the fingers, not sticking out this side with the neck cradled in the web between thumb and forefinger. It was strange for a few weeks but I could see immediately that it brings the fingers into a much better relationship with the fretboard, and makes using equally all four fingers simplicity itself. So I continued with it, including on 12-strings and electrics (and electric 12-strings) when in bands. At this period I noticed that few electric players did this, and that therefore few of them could use the pinky properly either. Some asked me why my technique looked so simple, and this was basically the reason.

You lose the ability to cheat and use the thumb to complete the F chord on the bottom string, although actually you shouldn't be playing 6-string chords anyway .... But that's another discussion. Anyway the barre also becomes much easier with the thumb behind.