QT-DevOps / AzureIssues

This repository is for questions
8 stars 27 forks source link

Jenkins - unable to install jenkins in Ubuntu instance #79

Closed kvbr999 closed 4 years ago

kvbr999 commented 4 years ago

Git Bash used - commands as mentioned in https://www.jenkins.io/doc/book/installing/#debianubuntu

ubuntu@ip-172-31-93-230:~$ sudo sh -c 'echo deb https://pkg.jenkins.io/debian-stable binary/etc/apt/sources.list.d/jenkins.list' deb https://pkg.jenkins.io/debian-stable binary/etc/apt/sources.list.d/jenkins.list ubuntu@ip-172-31-93-230:~$ sudo apt-get update Hit:1 http://us-east-1.ec2.archive.ubuntu.com/ubuntu bionic InRelease Get:2 http://us-east-1.ec2.archive.ubuntu.com/ubuntu bionic-updates InRelease [88.7 kB] Get:3 http://us-east-1.ec2.archive.ubuntu.com/ubuntu bionic-backports InRelease [74.6 kB] Hit:4 http://security.ubuntu.com/ubuntu bionic-security InRelease Fetched 163 kB in 0s (404 kB/s) Reading package lists... Done ubuntu@ip-172-31-93-230:~$ sudo apt-get install jenkins 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

neelaraokala commented 4 years ago

If you installed Jenkins correctly as per above mentioned article , then just restart Jenkins by using the command Service Jenkins restart . It will works.

srmanikanta commented 4 years ago

hi kvbr, follow above steps you faced this error because syntax error in below /etc/apt/sources.list.d/jenkins.list or /etc/apt/sources.list files.

  1. first check these files /etc/apt/sources.list.d/jenkins.list and /etc/apt/sources.list and delete this line deb https://pkg.jenkins.io/debian-stable binary/
  2. once you delete that particular line try again the installation
  3. switch as root user sudo -i
  4. execute these commands
    
    wget -q -O - https://pkg.jenkins.io/debian-stable/jenkins.io.key | sudo apt-key add -
    sudo sh -c 'echo deb https://pkg.jenkins.io/debian-stable binary/ > \
    /etc/apt/sources.list.d/jenkins.list'
    sudo apt-get update
    sudo apt-get install jenkins

Note: ensure java is installed or not.

if you already solve this issue please close the issue.
srmanikanta commented 4 years ago

hi kvbr, please close the issue.

kvbr999 commented 4 years ago

closed

vidurpunj commented 1 year ago

hi kvbr, follow above steps you faced this error because syntax error in below /etc/apt/sources.list.d/jenkins.list or /etc/apt/sources.list files.

  1. first check these files /etc/apt/sources.list.d/jenkins.list and /etc/apt/sources.list and delete this line deb https://pkg.jenkins.io/debian-stable binary/
  2. once you delete that particular line try again the installation
  3. switch as root user sudo -i
  4. execute these commands
wget -q -O - https://pkg.jenkins.io/debian-stable/jenkins.io.key | sudo apt-key add -
sudo sh -c 'echo deb https://pkg.jenkins.io/debian-stable binary/ > \
    /etc/apt/sources.list.d/jenkins.list'
sudo apt-get update
sudo apt-get install jenkins

Note: ensure java is installed or not.

if you already solve this issue please close the issue.

reference link: https://www.jenkins.io/blog/2023/03/27/repository-signing-keys-changing/

use: Debian/Ubuntu LTS release $ curl -fsSL https://pkg.jenkins.io/debian-stable/jenkins.io-2023.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