}

Gitlab-CI Runner: sudo: no tty present and no askpass program specified

Created:

The problem

When you execute a gitlan-ci job tht uses sudo you can get the following error:

$ sudo apt update sudo: no tty present and no askpass program specified ERROR: Job failed: exit status 1 if(typeof __ez_fad_position != 'undefined'){__ez_fad_position('div-gpt-ad-tutorials_technology-medrectangle-3-0')};if(typeof __ez_fad_position != 'undefined'){__ez_fad_position('div-gpt-ad-tutorials_technology-medrectangle-3-0_1')};if(typeof __ez_fad_position != 'undefined'){__ez_fad_position('div-gpt-ad-tutorials_technology-medrectangle-3-0_2')}; .medrectangle-3-multi-114{border:none !important;display:block !important;float:none;line-height:0px;margin-bottom:2px !important;margin-left:0px !important;margin-right:0px !important;margin-top:2px !important;min-height:250px;min-width:300px;text-align:center !important;} The solution ============

open your /etc/sudoers with sudo and add the following line:

gitlab-runner ALL=(ALL) NOPASSWD: ALL