# Ubuntu 20.04 Initial Jenkins startup failure

**URL:** https://community.jenkins.io/t/ubuntu-20-04-initial-jenkins-startup-failure/1419
**Category:** Ask a question
**Tags:** question
**Created:** [February 3, 2022, 4:50pm UTC](https://community.jenkins.io/t/ubuntu-20-04-initial-jenkins-startup-failure/1419 "2022-02-03T16:50:03Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![CaptainHaddock](https://avatars.discourse-cdn.com/v4/letter/c/b77776/32.png) [@CaptainHaddock](https://community.jenkins.io/u/CaptainHaddock)
#### Post date: [February 3, 2022, 4:50pm UTC](https://community.jenkins.io/t/ubuntu-20-04-initial-jenkins-startup-failure/1419/1 "2022-02-03T16:50:03Z")

</div>

Just installed to Ubuntu 20.04LTS and the service fails to start:

$ sudo systemctl start jenkins.service  
Job for jenkins.service failed because the control process exited with error code.  
See “systemctl status jenkins.service” and “journalctl -xe” for details.

I added an echo of the command line to the init.d script and get:

$ sudo systemctl status jenkins.service  
● jenkins.service - LSB: Start Jenkins at boot time  
Loaded: loaded (/etc/init.d/jenkins; generated)  
Active: failed (Result: exit-code) since Thu 2022-02-03 11:43:18 EST; 1min 19s ago  
Docs: man:systemd-sysv-generator(8)  
Process: 9970 ExecStart=/etc/init.d/jenkins start (code=exited, status=7)

Feb 03 11:43:16 david-ThinkPad-W541 jenkins[9970]: Correct java version found  
Feb 03 11:43:16 david-ThinkPad-W541 jenkins[9970]: \* Starting Jenkins Automation Server jenkins  
Feb 03 11:43:16 david-ThinkPad-W541 jenkins[9970]: /bin/su -l jenkins --shell=/bin/bash -c /usr/bin/daemon --name=jenkins --inherit --env=JENKINS\_HOME=/var/lib/jenkins --output=/var/log/jenkins/jenkins.log --pidfile=/var/run/jenkins/jenkins.pid – /usr/bin/java -Djava.awt.headless=true -jar /usr/share/jenkins/jenkins.war --webroot=/var/cache/jenkins/war --httpPort=8080  
Feb 03 11:43:16 david-ThinkPad-W541 su[10024]: (to jenkins) root on none  
Feb 03 11:43:16 david-ThinkPad-W541 su[10024]: pam\_unix(su-l:session): session opened for user jenkins by (uid=0)  
Feb 03 11:43:17 david-ThinkPad-W541 su[10024]: pam\_unix(su-l:session): session closed for user jenkins  
Feb 03 11:43:18 david-ThinkPad-W541 jenkins[9970]: …fail!  
Feb 03 11:43:18 david-ThinkPad-W541 systemd[1]: jenkins.service: Control process exited, code=exited, status=7/NOTRUNNING  
Feb 03 11:43:18 david-ThinkPad-W541 systemd[1]: jenkins.service: Failed with result ‘exit-code’.  
Feb 03 11:43:18 david-ThinkPad-W541 systemd[1]: Failed to start LSB: Start Jenkins at boot time.

When I try the traced command from the command line I get:

/bin/su: unrecognized option ‘–name=jenkins’

Any thoughts are welcome

---

<div class="post-metadata">

### Author: ![MarkEWaite](https://dub1.discourse-cdn.com/flex013/user_avatar/community.jenkins.io/markewaite/32/20_2.png) [@MarkEWaite](https://community.jenkins.io/u/MarkEWaite)
#### Post date: [February 3, 2022, 9:36pm UTC](https://community.jenkins.io/t/ubuntu-20-04-initial-jenkins-startup-failure/1419/2 "2022-02-03T21:36:15Z")

</div>

I just installed Jenkins 2.333 (latest weekly) on a Ubuntu 20.04 that was freshly installed and updated to most recent operating system patches. Steps that I took included:

Install Java 11 - required because Jenkins [intentionally does not declare a Java dependency](https://www.jenkins.io/doc/book/installing/linux/#installation-of-java) but requires Java

```bash
$ sudo apt-get install openjdk-11-jdk-headless

```

Follow the steps from [Linux](https://www.jenkins.io/doc/book/installing/linux/#debianubuntu) install instructions for Debian/Ubuntu or from the [Debian Jenkins Packages](https://pkg.jenkins.io/debian/) install instructions

```bash
$ curl -fsSL https://pkg.jenkins.io/debian/jenkins.io.key | sudo tee \
    /usr/share/keyrings/jenkins-keyring.asc > /dev/null
$ echo deb [signed-by=/usr/share/keyrings/jenkins-keyring.asc] \
    https://pkg.jenkins.io/debian binary/ | sudo tee \
    /etc/apt/sources.list.d/jenkins.list > /dev/null
$ sudo apt-get update
$ sudo apt-get install jenkins

```

After doing that, `systemctl status jenkins` reports that the process is running.

How did you perform your installation?

---

<div class="post-metadata">

### Author: ![CaptainHaddock](https://avatars.discourse-cdn.com/v4/letter/c/b77776/32.png) [@CaptainHaddock](https://community.jenkins.io/u/CaptainHaddock)
#### Post date: [February 3, 2022, 9:50pm UTC](https://community.jenkins.io/t/ubuntu-20-04-initial-jenkins-startup-failure/1419/3 "2022-02-03T21:50:39Z")

</div>

I was using apt-get in similar fashion.  
Finally got installed moments ago by removing a tomcat install I had and installing via the snap.

```auto
snap install jenkins --classic

```

---

<div class="post-metadata">

### Author: ![MarkEWaite](https://dub1.discourse-cdn.com/flex013/user_avatar/community.jenkins.io/markewaite/32/20_2.png) [@MarkEWaite](https://community.jenkins.io/u/MarkEWaite)
#### Post date: [February 4, 2022, 4:14am UTC](https://community.jenkins.io/t/ubuntu-20-04-initial-jenkins-startup-failure/1419/4 "2022-02-04T04:14:13Z")

</div>

> [@CaptainHaddock](#):
>
> Finally got installed moments ago by removing a tomcat install I had and installing via the snap

If the tomcat was running on port 8080, then Jenkins would not be able to start because it defaults to port 8080. There is a configuration setting in the `/etc/default/jenkins` file that will change the port number.

I’ve never used snap to install Jenkins. I’m glad it works. That’s great.

---

<div class="post-metadata">

### Author: ![uiisoft](https://dub1.discourse-cdn.com/flex013/user_avatar/community.jenkins.io/uiisoft/32/1481_2.png) [@uiisoft](https://community.jenkins.io/u/uiisoft)
#### Post date: [May 9, 2022, 4:29am UTC](https://community.jenkins.io/t/ubuntu-20-04-initial-jenkins-startup-failure/1419/5 "2022-05-09T04:29:14Z")

</div>

I have met the same problem, thank you very much for your answer, my problem was solved.  
I used Ubuntu20.04, I installed openJK-11-JDK and OpenJK-11-JRE, the problem still exists, until the openJK-11-JK-headless problem in your answer is fixed, Jenkins is now running properly.
