3

I have installed Jenkins on my Red Hat server following this tutorial. But by mistake I skipped the default plugins part.

I tried deleting /var/lib/jenkins/config.xml but this file getting created again and again.

  • How can I get back to the initial setting where I can do it correctly this time?
  • Or is there a way I can go to default plugin installation without doing much changes?

I tried googling but all the documents that match are for resetting admin passwords.

NOTE: I do know that I can go to plugin management and install the plugins I want. However, I'm currently ended up with a blank slate and I'm not sure which are all the plugins I should install.

Patrick Mevzek
  • 9,921
  • 7
  • 32
  • 43
Raja Anbazhagan
  • 133
  • 1
  • 1
  • 8

5 Answers5

1

Looking at the provided tutorial link, I assume you installed jenkins with your package manager.

Use your package manager to look what files were installed with the Jenkins package using this command: rpm -ql jenkins (for debian based distros dpkg -L jenkins). You will notice it installs configuration files in /etc, service files in /lib and doc/binaries in /usr. Also, it creates these 3 folders for its working directory, logs and cache:

/var/cache/jenkins
/var/lib/jenkins
/var/log/jenkins

Basically, you need to reset the files/folders to their original state by deleting everything that Jenkins wrote in the /var folders. This is assuming that you did not modify /etc or .service files

TL;DR

  • Stop the service with systemctl stop jenkins.service (sudo if needed)
  • Wipe out the working directory, logs and cache with rm -rf /var/lib/jenkins/* /var/cache/jenkins/* /var/log/jenkins/*
  • Start jenkins back with systemctl start jenkins.service (sudo if needed)
speed488
  • 111
  • 2
1

An earlier answer mentioned a .jenkins file or folder. At least on my jenkins instance on CentOS no such file exists.

edit /var/lib/jenkins/config.xml and change the following line to:

<installStateName>NEW</installStateName> then service jenkins restart

enter image description here

  • I will try this out – Raja Anbazhagan May 21 '19 at 21:36
  • I just get a blank screen now when I go to the base URL. F12 shows it loading the base page and a whole bunch of css and js files. Then nothing. Blank white screen. View page source shows HTML and the title is SetupWizard [Jenkins] – Lee Meador Nov 12 '19 at 18:18
0

Delete the .jenkins file. I just had the same problem (similar) and I deleted the .jenkins folder. It should bring you back to the setup.

0

I know resetting and reinstalling is not the same thing, but it might be the right thing to do in this situation.

I suggest you uninstall jenkins completely and then reinstall it. I tried it as well with the answers mentioned above, but nothing did what I wanted (I forgot to install the Plugins, just like you). I did it on a Ubuntu Server 18.04.

Uninstall:

sudo service jenkins stop
sudo yum clean all
sudo yum -y remove jenkins
sudo rm -rf /var/cache/jenkins
sudo rm -rf /var/lib/jenkins/

Install:

sudo wget -O /etc/yum.repos.d/jenkins.repo http://pkg.jenkins-ci.org/redhat- stable/jenkins.repo
sudo rpm --import https://jenkins-ci.org/redhat/jenkins-ci.org.key
sudo yum -y install jenkins

sudo service jenkins start

Source for Red Hat install / uninstall: https://gist.github.com/springaki/1add83b255c2d38800e5c3d864cbb737

sidi7
  • 101
  • 1
-1

Check this link https://github.com/jenkinsci/jenkins/blob/jenkins-2.19.4/core/src/main/resources/jenkins/install/platform-plugins.json list of succested plugins. You can install this plugins manually.