Plug-in installation failure

This is the sixth day of my participation in the August More text Challenge. For details, see:August is more challenging

I’m sure a lot of people in the early days of Jenkins had problems with plugins failing to be installed, or simply staying there and not responding, so I summarized my own experience to provide a reference for you.

Usually to download foreign software plug-ins, such as the link to foreign countries will be too slow or wall, which requires us to change the mirror source

Modifying a Configuration File

  • After we changed the URL of the upgrade site in Jenkins

  • If the plug-in is still stuck in Installing/Updating plug-ins, modify the configuration file

why

The original link: blog.csdn.net/JikeStardy/…

The purpose of mirror source is simple: third-party groups and organizations use their own servers to synchronize files and data from foreign official sources. In this way, when we need to download and use these files, we don’t have to slowly get them from the foreign server, but directly through the domestic network to get the files that they have synchronized early. So we can see in the configuration of some environments, software, there is a source swap.

  • Looking at Jenkins’ update-center.json in various open-source mirror sites, such as Qinghua Source, you can find the following

  • The purple part is the official Jenkins source, while the above content is from the update-center-json file in the image source of Tsinghua University. Jenkins should get update-center-json according to the address of the upgrade site. The actual URL links to update resources (such as plug-in ontology, Jenkins ontology, etc.) are in update-center.json.
  • Therefore, after changing the URL of the upgrade site, Jenkins will still download according to the link in update-center-json, because update-center-json on the domestic image source = update-center-json on the Jenkins official source
  • The next step is to change the URL in the local configuration file

Configuration file address:

{your Jenkins working directory}/updates/defaulet.json

(usually /var/lib/jenkins)

Replace www.google.com –> www.baidu.comjenkins

Always try to connect to www.google.com before installing the plug-in to determine whether the network is working. Google’s website is not accessible on the mainland, so the problem arises.

To replace global updates. Jenkins. IO/download / – > mirrors.tuna.tsinghua.edu.cn/jenkins/

Command line operation

sed -i 's#https://updates.jenkins.io/download#https://mirrors.tuna.tsinghua.edu.cn/jenkins#g' }/updates/default.json sed -i 's#http://www.google.com#https://www.baidu.com#g' {your Jenkins working directory}/updates/default.jsonCopy the code

Save and restart Jenkins

Pit point

  • Many, many tutorials on the web are about changing configuration files

    http://updates.jenkins-ci.org/download

    If you replace it with the sed command, you won’t get an error, but you won’t succeed either. Why?

  • We opened the configuration file and looked for the link, but it was not found at all

  • If you look closely, the link in the configuration file looks like this

    https://updates.jenkins.io/download/

    Not something like this

    http://updates.jenkins-ci.org/download

    HTTP becomes HTTPS

    -ci.org becomes.io

  • Change the link again, successful

  • The cause of the accident is unknown. It is possible that your configuration file is in this format http://updates.jenkins-ci.org/download, so please check it carefully

    If you know anything about it, please comment in the comments section

No configuration file

Reference from www.cnblogs.com/hellxz/p/in…

If the updates file is not found, the updates directory will not be generated because your network is not connected to the Jenkins repository. If the updates folder is not created, the updates directory will not be generated. If the Updates folder is not created, the updates directory will not be generated

sed -i "s#https://updates.jenkins.io/update-center.json#https://mirrors.tuna.tsinghua.edu.cn/jenkins/updates/update-center.json # g "} {you Jenkins working folder/root/Hudson. Model. UpdateCenter. The XMLCopy the code

Configuring the Proxy Server

  • If the above operation still fails, then go to the proxy server

    Download and install Clash

    Launch./{you downloaded clash} -d.

    Purchase the proxy server node service

    Obtain yamL configuration information from the website to overwrite the local Clash configuration

    Log in to clash. Razord. top/ and select the node

    Log in to www.youtube.com to check whether the operation is successful

    Return to Jenkins to see if it was successful

  • If the fault persists, run the following two commands

Export http_proxy="http://127.0.0.1: your VPN port number "export https_proxy="http://127.0.0.1: your VPN port number"Copy the code
  • Or no? I’m at my wit’s end. This is all I can do for you. Come on!