A long way back, in the protean years of indie rock, circa 1985, there was a ragtag band from a sleepy Massachusetts locale. Dinosaur Jr. played a major role in shaping the sound of what would later become known as “alternative rock” during the 1990s, influencing small-time basement four-trackers and radio rock gods alike. Yet the band attained little more than a cult following, and was gradually forgotten over the course of the 1990s. Thankfully, Merge Records has re-released the band’s seminal “You’re Living All Over Me,” their second album, and “Bug,” their third, which have both long been out of print. Listening to the re-mastered “Living” and “Bug” — especially their beloved highlights like “Little Fury Things,” “Yeah We Know” and “Freak Scene” — is a long-awaited joy.

As many a fan would say, Dinosaur Jr. broke new ground by becoming one of the first post-hardcore indie bands to integrate the sounds and solos of classic ’70s hard rock and psychedelia. It is one of the first bands to affirm that classic dinosaur rock sounds were worthy of use, all the while armed with a lovable slacker sensibility that paved the way for the likes of Nirvana and Pavement.

The band’s debut “Dinosaur,” also re-released by Merge, was originally put out on the fledgling Homestead Records. (Homestead was run by their friend Gerard Cosloy, who would later found indie heavyweight Matador Records.) “Dinosaur” is bogged down by endless stylistic inconstancies, though the track “Repulsion” shows a strong grasp of melody, and the loud/soft, verse/chorus dynamic that would later become a paradigm.

But the band found its sound on “You’re Living All Over Me.” When released in 1987, the band was clearly listening to label-mates on SST Records, the home of like-minded punk and psychedelic outfits like Sonic Youth and the Meat Puppets. The first track of “Living,” “Little Fury Things,” is maybe its best. The multifaceted opener effectively sums up the Dinosaur Jr. sound: The track begins with a noisy, wah-wah freak-out that segues into gentle, melodic verses.

On the track and throughout the album, vocalist/guitarist/songwriter/longhaired goofball J Mascis sings in his trademark wistful voice. It is to his credit that he sounds like Neil Young, who is clearly an influence on Mascis and the band. But Mascis also sounds perpetually laid back, a trait that later rubbed off on Pavement’s Stephen Malkmus. Dinosaur Jr.’s laconic, even-tempered and fragile-sounding vocals were a grand departure from the urgent growls that characterized most of its contemporaries.

Much of the band’s dense, layered guitar work also illustrates how it innovated its own swirling wall of sound. The heavy riffage of “SludgeFeast” suggests the band’s penchant for metal; high-octane solos are sprinkled liberally throughout the album, proving that Mascis was a veritable guitar god to boot (at least in the indie rock world).

There was another formidable creative force lurking behind the scenes of Dinosaur Jr.: bass player Lou Barlow. Barlow’s contributions to “Living” are surprisingly conspicuous, given his overall dissatisfaction with Mascis. (He would later leave to found the equally-impressive Sebadoh.) Barlow sings effectively on “Lose,” though he’s clearly doing his best J Mascis impression. His “Poledo,” however, is a jumbled, goth-y tape-loop experiment, crudely recorded in his basement. It sounds weird and out of place, but is interesting to hear in context of Barlow’s later work with his own band. Another highlight on the release of “Living” is a jangly cover of the Cure’s “Just Like Heaven,” a bonus track that shines light on Dinosaur’s British goth-rock influences.

While “Bug” lacks some of the magic of “You’re Living All Over Me,” it starts off with the brilliant “Freak Scene.” The anthemic track, about Mascis’ and Barlow’s dysfunctional friendship, is perhaps the catchiest song the band ever wrote. Had the cosmos been aligned differently (and SST had better distribution), “Freak” could have been the generation-defining song that “Smells Like Teen Spirit” would later become.

“Yeah We Know,” with its wah-wah driven hooks and start-stop cadence, is also a highlight. The obtuse lyrics feel like an afterthought, but are especially interesting in retrospect: “About to crack / With no hope of coming back / How can you ever get it together?” “Don’t,” the final song before the bonus track, is a menacing, chaotic noise jam. Barlow’s repetitive screams — “Why don’t you like me?” — are particularly poignant, since the perpetually tormented bassist quit the band after “Bug.”

Afterwards, Dinosaur Jr. essentially became a J Mascis solo project. The slew of increasingly mediocre major label releases that followed never topped the brilliance of its second and third albums. As a result, even college students’ familiarity with the band is often limited to the uninspired but widely available “Hand It Over” and “Without A Sound” — if they’ve heard of the trio at all. The re-release of the ground-breaking “You’re Living All Over Me” and the manic “Bug” will set the record straight, and maybe even launch Dinosaur Jr. back into the pantheon of indie rock legends.