\pretolerance=10000 \tolerance=2000 \emergencystretch=10pt
See more details here.
\usepackage{lineno} \linenumbers