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.

5 Answers 5

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

2
  • I will try this out May 21, 2019 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 <title>SetupWizard [Jenkins]</title>
    – Lee Meador
    Nov 12, 2019 at 18:18
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)
1
  • Worked for me with Ubuntu 22.04 - Thank you. Feb 28, 2023 at 9:32
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.

1
  • Where's that file typically located?
    – jornane
    Apr 22, 2019 at 21:24
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

-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.

1
  • 2
    You may have misread the question. It's not about the plugins. It's about resetting settings. Jul 11, 2018 at 1:43

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .