Error with Jenkins installation on Ubuntu 20.04 [closed] - linux

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 9 months ago.
Improve this question
I'm trying to install Jenkins on an Azure VM with Ubuntu 20.04 following the next command lines:
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 -y
sudo apt-get install jenkins -y
But when I try to install Jenkins with the last command, this happens:
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
jenkins
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 91.4 MB of archives.
After this operation, 95.0 MB of additional disk space will be used.
Err:1 https://pkg.jenkins.io/debian-stable binary/ jenkins 2.332.3
Redirection from https to 'http://mirrors.jenkins.io/debian-stable/jenkins_2.332.3_all.deb' is forbidden [IP: 146.75.30.133 443]
E: Failed to fetch https://pkg.jenkins.io/debian-stable/binary/jenkins_2.332.3_all.deb Redirection from https to 'http://mirrors.jenkins.io/debian-stable/jenkins_2.332.3_all.deb' is forbidden [IP: 146.75.30.133 443]
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?
How can I solve this issue?

I actually solved the problem, I don't know why with the actuall Jenkins installation guide it doesn't work but i solved it with these 2 command lines:
wget https://pkg.jenkins.io/debian-stable/binary/jenkins_2.332.3_all.deb
sudo dpkg -i jenkins_2.332.3_all.deb
I've been trying with some versions till I found the one that worked, and now Jenkins is working.
https://deb.pkgs.org/packages/jenkins/jenkins_2.332.3_all.deb.html

(Ubuntu 22.04)
I have installed "net-tools" manually and just after that "Jenkins" has started to install.
Accordingly, I've changed my Ansible yaml
---
- name: Install dependencies
apt:
name: net-tools
state: present
- name: ensure the jenkins apt repository key is installed
apt_key:
<skipped>

it was solved for me,
i'm running ubuntu 20.04 in AWS EC2 NEW instance
first command that im used in it
sudo su - (to enter the root user)
Update the repository
apt update
Install net-tools
apt install net-tools
Install JAVA, 'cause the jenkins can be running with JAVA
apt -y install openjdk-11-jdk
Edit the Java's path
find /usr/lib/jvm/java-1.11* (copy the output of that command)
Add JAVA PATH
nano /etc/environment (Open the file)
JAVA_HOME="/usr/lib/jvm/java-1.11.0-openjdk-amd64" (add this command)
CTRL + X and Y and ENTER (for save that file)
Reload the file
source /etc/environment
And check the PATH
echo $JAVA_HOME (the output will be pretty same like step number 6)
Those were the requirement before you install the Jenkins
Download the jenkins file
wget https://pkg.jenkins.io/debian-stable/binary/jenkins_2.332.3_all.deb
And then install it
dpkg -i jenkins_2.332.3_all.deb
The installation will be success, now you can see your jenkins in EC2
[your-ip-public]:8080 ('cause the jenkins is run with 8080 port, we need add new rule of securtiy group in our EC2 instance)
I hope this helps

Before installing Jenkins, you need to do,
sudo apt-get upgrade
sudo apt-get update
Then install,
sudo apt-get install jenkins -y

You can install Jenkins with docker via docker-compose.
version: "3.1"
services:
jenkins:
image: jenkins:latest
ports:
- 8080:8080
- 50000:50000
volumes:
- jenkins-home:/var/jenkins_home
volumes:
jenkins-home:
Before installation -> sudo apt install docker.io docker-compose -y

Related

Issues installing Docker on RHEL 7 Linux Server

I have been constantly running into this issue more and more lately, and finally need some assistance because I'm completely stuck.
I just got access to a RHEL EC2 Linux server and I am just simply trying to install Docker. This process has been extremely painful lately. Tons of 404 HTTP Not Found errors when trying to follow the processes mentioned online
According to https://docs.aws.amazon.com/AmazonECS/latest/developerguide/docker-basics.html, you can just simply run one of the following two commands:
sudo amazon-linux-extras install docker
sudo yum install docker
However, neither one of these comands work, as shown in the output below:
[root#d8de679d27f2454 myuser]# sudo amazon-linux-extras install docker
sudo: amazon-linux-extras: command not found
[root#d8de679d27f2454 myuser]# yum install docker
Loaded plugins: amazon-id, search-disabled-repos
No package docker available.
Error: Nothing to do
[root#d8de679d27f2454 myuser]#
Here is a list of things I've tried to do :
First Attempt (RE: How to install docker on Amazon Linux2)
The second answer proposed in that you can just run the following:
sudo yum update -y
sudo yum -y install docker
However, that doesn't work either, as shown in the output below:
[root#d8de679d27f2454 myuser]# yum update -y
Loaded plugins: amazon-id, search-disabled-repos
No packages marked for update
[root#d8de679d27f2454 myuser]# yum -y install docker
Loaded plugins: amazon-id, search-disabled-repos
No package docker available.
Error: Nothing to do
[root#d8de679d27f2454 myuser]#
Second Attempt: Installing via get.docker.com
When running curl https://get.docker.com | bash, that doesn't work either
Third Attempt: https://computingforgeeks.com/install-docker-ce-on-rhel-7-linux/
Part of this article suggests running the following two commands:
sudo yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
sudo yum install -y yum-utils device-mapper-persistent-data lvm2
However, that doesn't work either:
# yum install -y yum-utils device-mapper-persistent-data lvm2
Loaded plugins: amazon-id, product-id, search-disabled-repos, subscription-manager
This system is not registered with an entitlement server. You can use subscription-manager to register.
https://download.docker.com/linux/rhel/7/x86_64/stable/repodata/repomd.xml: [Errno 14] HTTPS Error 404 - Not Found
Trying other mirror.
To address this issue please refer to the below knowledge base article
https://access.redhat.com/articles/1320623
If above article doesn't help to resolve this issue please open a ticket with Red Hat Support.
One of the configured repositories failed (Docker CE Stable - x86_64),
and yum doesn't have enough cached data to continue. At this point the only
safe thing yum can do is fail. There are a few ways to work "fix" this:
1. Contact the upstream for the repository and get them to fix the problem.
2. Reconfigure the baseurl/etc. for the repository, to point to a working
upstream. This is most often useful if you are using a newer
distribution release than is supported by the repository (and the
packages for the previous distribution release still work).
3. Run the command with the repository temporarily disabled
yum --disablerepo=docker-ce-stable ...
4. Disable the repository permanently, so yum won't use it by default. Yum
will then just ignore the repository until you permanently enable it
again or use --enablerepo for temporary usage:
yum-config-manager --disable docker-ce-stable
or
subscription-manager repos --disable=docker-ce-stable
5. Configure the failing repository to be skipped, if it is unavailable.
Note that yum will try to contact the repo. when it runs most commands,
so will have to try and fail each time (and thus. yum will be be much
slower). If it is a very temporary problem though, this is often a nice
compromise:
yum-config-manager --save --setopt=docker-ce-stable.skip_if_unavailable=true
failure: repodata/repomd.xml from docker-ce-stable: [Errno 256] No more mirrors to try.
https://download.docker.com/linux/rhel/7/x86_64/stable/repodata/repomd.xml: [Errno 14] HTTPS Error 404 - Not Found
Here's the output of my cat /etc/os-release command
NAME="Red Hat Enterprise Linux Server"
VERSION="7.9 (Maipo)"
ID="rhel"
ID_LIKE="fedora"
VARIANT="Server"
VARIANT_ID="server"
VERSION_ID="7.9"
PRETTY_NAME="Red Hat Enterprise Linux Server 7.9 (Maipo)"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:redhat:enterprise_linux:7.9:GA:server"
HOME_URL="https://www.redhat.com/"
BUG_REPORT_URL="https://bugzilla.redhat.com/"
Any help would be greatly appreciated. It seems nearly impossible to install docker at this point.
Ran the following commands and this worked:
yum install -y https://download.docker.com/linux/centos/7/x86_64/stable/Packages/docker-ce-selinux-17.03.0.ce-1.el7.centos.noarch.rpm
yum install -y https://download.docker.com/linux/centos/7/x86_64/stable/Packages/docker-ce-17.03.0.ce-1.el7.centos.x86_64.rpm
Download latest version of these 3 packages from internet and
[root#test_hostame docker19.03_rpm]# ll
total 93904
-rw-r--r-- 1 root root 30381608 Jan 20 18:19 containerd.io-1.3.9-3.1.el7.x86_64.rpm
-rw-r--r-- 1 root root 25519432 Jan 20 18:19 docker-ce-19.03.14-3.el7.x86_64.rpm
-rw-r--r-- 1 root root 40247412 Jan 20 18:19 docker-ce-cli-19.03.14-3.el7.x86_64.rpm
run command in folder where only these 3 packages are present
yum localinstall *rpm
It is surely gonna work. If it doesnt, share your error.

Having trouble installing mongodb on ubuntu version 18.04 LTS [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 4 years ago.
Improve this question
I've recently installed Ubuntu version 18.04 LTS and just started to learn to use use linux and terminal. I want to install mongodb. I'm following the steps from this website.
i ran the following lines in the terminal
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 9DA31620334BD75D9DCB49F368818C72E52529D4
echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/4.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.0.list
sudo apt-get update
sudo apt-get install -y mongodb-org
after i run the fourth line the following appears
tasif#Tasif-Dell:/$ sudo apt-get install -y mongodb-org
[sudo] password for tasif:
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
mongodb-org : Depends: mongodb-org-server but it is not going to be
installed
E: Unable to correct problems, you have held broken packages.
Then when i want to start mongodb the following message is displayed
tasif#Tasif-Dell:/$ sudo service mongod start
[sudo] password for tasif:
Failed to start mongod.service: Unit mongod.service not found.
installing libcurl3 fixed it for me
sudo apt install libcurl3
Unfortunately, there's no non-development release of MongoDB for 18.04 yet. (Current as of 2018-07-12)
https://repo.mongodb.org/apt/ubuntu/dists/bionic/ shows that there's only a dev release.
Your specific problem is that you are not installing all the dependencies for Mongo, which can probably be fixed with:
sudo apt-get install -f
Per this ask Ubuntu answer.

Install gitlab-ce on ubuntu server 17.04

I'm trying to install the gitlab-ce package on a system running Ubuntu server 17.04. I followed the official installation instructions here.
First I ran:
sudo apt-get install curl openssh-server ca-certificates postfix
I already had all of those installed. Then I ran:
curl -sS https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.deb.sh | sudo bash
Which also worked fine. But when I try to run
sudo apt-get install gitlab-ce
I get the following error message:
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package gitlab-ce
I know it's possible to install gitlab on Ubuntu server 17.04, since I had already done It on a previous installation. Unfortunately I installed the OS again from scratch and I can't remember how I had installed gitlab.
Thanks for any help in advance!
I gave up with the "full" automated script, as it doesn't appear to be working with 17.04... Anyway. I grabbed the latest package from https://packages.gitlab.com/gitlab/gitlab-ce/packages/ubuntu/xenial/gitlab-ce_9.3.0-ce.0_amd64.deb
curl -LJO https://packages.gitlab.com/gitlab/gitlab-ce/packages/ubuntu/xenial/gitlab-ce_9.3.0-ce.0_amd64.deb/download
Installed it with the package manager
sudo dpkg -i gitlab-ce_9.3.0-ce.0_amd64.deb
Then configured it with
sudo gitlab-ctl reconfigure
Then, point your web browser at your new gitlab install and you should be good to go...
Ubuntu 20.04.1
Incase anyone bumps back into this, while trying to gitlab on version 20.0.4 of ubuntu, life is much easier... and the instructions and automated script actually work. GitLab-CE installation instructions
on a fresh install of ubuntu: -
sudo apt install curl
curl -s https://packages.gitlab.com/install/repositories/gitlab/gitlab- ce/script.deb.sh | sudo bash
sudo apt install gitlab-ce
done!
I was facing the same problem (Lubuntu 17.10), after searching the gitlab forums for 2 Hours, I found this thread.
So from what I have read: Gitlab-ce is not supported for zesty yet. Also the simple
sudo apt-get install gitlab
is a wrong prompt cause it installs a Ubuntu package created by a user named as "praveen" and It is not officially supported by Gitlab.
here is what I did To solve my problem:
sudo nano /etc/apt/sources.list.d/gitlab_gitlab-ce.list.save
sudo nano /etc/apt/sources.list.d/gitlab_gitlab-ce.list
replace "zesty" with "xenial" (These files are root access only)
sudo apt update
sudo apt-get install gitlab-ce
This worked for me.
I have spent my whole afternoon for solving this problem, I hope this solution works for you too.
Prost !
EDIT: corrected spelling
I had the same problem getting the install to run on 17.10. According to an issue on their site ( https://gitlab.com/gitlab-org/gitlab-runner/issues/2851 ), the artful packages are not being built.
I did the same this as #DevX, but just changed the parameters on their setup script.
Howler#GitLab:/tmp$ curl -LO https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.deb.sh
Howler#GitLab:/tmp$ sudo os=ubuntu dist=xenial bash ./script.deb.sh
Howler#GitLab:/tmp$ sudo apt-get install gitlab-ce

How do I install Fish Shell on AWS Linux [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 1 year ago.
Improve this question
I can't seem to install Fish shell on an AWS Linux instance. I keep getting the following error and can't seem to find a fix for it.
[root#ip-172-31-20-125 ec2-user]# yum -y install fish
Loaded plugins: priorities, update-motd, upgrade-helper
Repository shells_fish_release_2 is listed more than once in the configuration
Resolving Dependencies
--> Running transaction check
---> Package fish.x86_64 0:2.5.0-1.2 will be installed
--> Processing Dependency: hostname for package: fish-2.5.0-1.2.x86_64
--> Finished Dependency Resolution
Error: Package: fish-2.5.0-1.2.x86_64 (shells_fish_release_2)
Requires: hostname
You could try using --skip-broken to work around the problem
You could try running: rpm -Va --nofiles --nodigest
Same way as on Centos 6.
from:
cd /etc/yum.repos.d/
wget http://download.opensuse.org/repositories/shells:fish:release:2/CentOS_6/shells:fish:release:2.repo
yum install fish
2021 update:
If you're running a newer version of AWS Linux - run rpm -E %{rhel} to see the RHEL version, and then use one of the links here for the wget command. For instance, if the RHEL version is 7, run as root:
cd /etc/yum.repos.d/
wget --no-check-certificate https://download.opensuse.org/repositories/shells:fish:release:3/CentOS_7/shells:fish:release:3.repo
yum install fish
You can use Fish's Red Hat 6 package repository, which works out fine for Amazon Linux 2:
sudo yum-config-manager --add-repo http://fishshell.com/files/linux/RedHat_RHEL-6/fish.release:2.repo
After that you can install it normally.
sudo yum -y install fish
This worked for me on release:
cat /etc/os-release
NAME="Amazon Linux AMI"
VERSION="2018.03"
ID="amzn"
ID_LIKE="rhel fedora"
VERSION_ID="2018.03"
PRETTY_NAME="Amazon Linux AMI 2018.03"
ANSI_COLOR="0;33"
CPE_NAME="cpe:/o:amazon:linux:2018.03:ga"
HOME_URL="http://aws.amazon.com/amazon-linux-ami/"
add repo
sudo yum-config-manager --add-repo http://fishshell.com/files/linux/RedHat_RHEL-6/fish.release:2.repo
clean
sudo yum clean all
install
sudo yum -y install fish
test
[ec2-user#ip-xxx-xx-x-xx] yum.repos.d]$ fish
Welcome to fish, the friendly interactive shell
For fish 3 see the instructions on the README https://github.com/fish-shell/fish-shell#building-from-source-all-platforms---makefile-generator

How to install npm on debian vagrant box? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 4 years ago.
Improve this question
How can I install npm inside Debian vagrant box? I try this, but it's not wotking.
vagrant#packer-debian-7:~$ sudo apt-get install nodejs
Reading package lists... Done
Building dependency tree
Reading state information... Done
nodejs is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 82 not upgraded.
vagrant#packer-debian-7:~$ nodejs -v
v0.10.29
vagrant#packer-debian-7:~$ sudo apt-get install npm
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package npm
vagrant#packer-debian-7:~$ npm -v
-bash: npm: command not found
My host OS is Ubuntu
The debian way would be to add the repo and install with apt-get
curl --silent --location https://deb.nodesource.com/setup_0.12 | sudo bash -
sudo apt-get update
sudo apt-get install --yes nodejs
That will install nodejs and npm the debian way
Here you have a vagrant provision i build that comes with nodejs
https://github.com/Sudakatux/vagrant-liferay-others
run command :
wget https://npmjs.org/install.sh
sudo chmod +x install.sh
sudo ./install.sh
it will install npm to your vagrant box.
Scroll down on the nodesource installation page (https://github.com/nodesource/distributions/blob/master/README.md#debinstall). You need to install build-essentials, which includes npm.
# use `sudo` on Ubuntu or run this as root on debian
apt-get install -y build-essential

Resources