skip to Main Content

so im trying to install the jenkins on my ubuntu and ofc i made sure to update the system by running : apt update

then i tried to run the following commands from jenkins website to install jenkins :

"


curl -fsSL https://pkg.jenkins.io/debian-stable/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-stable binary/ | sudo tee 

/etc/apt/sources.list.d/jenkins.list > /dev/null

sudo apt-get update

sudo apt-get install jenkins

then i got an error message that says :


Reading package lists... Done

Building dependency tree

Reading state information... Done

Package jenkins is not available, but is referred to by another package.

This may mean that the package is missing, has been obsoleted, or

is only available from another source

E: Package jenkins has no installation candidate

i barely understood, is that trying to recognize the repo which the files are downloading from?

i saw a youtube video of someone who had the same problem and he use the following commands:


wget -q -O - https://pkg.jenkins.io/debian-stable/... | sudo apt-get key add

'sudo sh -c 'echo deb https://pkg.jenkins.io/debian-stable binary/>/etc/apt/sources.list.d/jenkind.list

sudo apt-get update

sudo apt-get install jenkins

but it still doesnt work for me
can you help me please get jenkins installed ?

6

Answers


  1. Follow below commands to install the Jenkins in the ubuntu 18:04

    command1 :

    curl -fsSL https://pkg.jenkins.io/debian-stable/jenkins.io.key | sudo tee

    /usr/share/keyrings/jenkins-keyring.asc > /dev/null

    command2 :

    echo deb [signed-by=/usr/share/keyrings/jenkins-keyring.asc]

    https://pkg.jenkins.io/debian-stable binary/ | sudo tee

    /etc/apt/sources.list.d/jenkins.list > /dev/null

    command3:

    sudo apt-get update

    sudo apt-get install jenkins

    sudo systemctl status jenkins

    Access the URL http://hostname:8080

    use the below command to get the password

    more /var/lib/jenkins/secrets/initialAdminPassword

    Login or Signup to reply.
  2. switch to root user first.
    Command: sudo su –

    Then you can run the commands you ran earlier to install Jenkins. It should work now.

    Login or Signup to reply.
  3. You can add [trusted=yes] in the /etc/apt/sources.list.d/jenkins.list file.

    Initially /etc/apt/sources.list.d/jenkins.list will have,

    deb [signed-by=/usr/share/keyrings/jenkins-keyring.asc] https://pkg.jenkins.io/debian binary/
    

    Update it as,

    deb [trusted=yes] https://pkg.jenkins.io/debian binary/
    

    After that run the installation instructions.

    Eg: for Debian releases

    sudo apt-get update
    sudo apt-get install fontconfig openjdk-11-jre
    sudo apt-get install jenkins
    
    Login or Signup to reply.
    1. install ca-certificates.

      sudo apt install ca-certificates

    2. then install Jenkins from the official documentation

    https://www.jenkins.io/doc/book/installing/linux/#debianubuntu

    Login or Signup to reply.
  4. I too had this problem and the issue was because I was using Zsh and not Bash. Once I switched to Bash (by typing "bash") the commands on the Jenkins website to install on Linux (Ubuntu for me) actually worked.

    Login or Signup to reply.
  5. first command
    1.

     curl -fsSL https://pkg.jenkins.io/debian-stable/jenkins.io-2023.key | sudo tee 
        /usr/share/keyrings/jenkins-keyring.asc > /dev/null
    

    Then add a Jenkins apt repository entry:
    second command:-

    echo deb [signed-by=/usr/share/keyrings/jenkins-keyring.asc] 
        https://pkg.jenkins.io/debian-stable binary/ | sudo tee 
        /etc/apt/sources.list.d/jenkins.list > /dev/null
    

    run these it worked for me

      sudo apt-get update
      sudo apt-get install fontconfig openjdk-11-jre
      sudo apt-get install jenkins
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search