As usual, every two weeks you get a new package with a new version of the application. which need to be installed on approximately 1,200 production servers.
What's your idea for the realization of this task? One can assume that your OS is Debian.?
what I did. I just created a simple script which inside contain the installation comand .
apt-get install chrome
But I dont know commands which can help me to install the application to manny other servers (1200) which I have acces to it through remotely . any suggestions..?
It would be a good idea to make a cron job.
$ crontab -e
And add a new line:
0 0 * * 0 root (apt-get update && apt-get upgrade -y) > /dev/null
This will run full a system update every Sunday midnight.
If you want to update only chrome:
0 0 * * 0 root (apt-get update && apt-get --only-upgrade install -y chrome) > /dev/null
Take a look at the following article. This can help you:
http://www.linuxjournal.com/magazine/hack-and-manage-multiple-servers-efficiently
Related
I'm trying create a bash installation script to install Node.js version 12 on a Raspberry Pi using:
curl -sL https://deb.nodesource.com/setup_12.x | sudo bash -
sudo apt-get install -y nodejs
When the installation is done, however, I check the version with node --version, and I've got v10.24.0 instead.
What would cause this, and how do I stop it from happening?
I'm also finding that npm isn't installed unless I instead do:
sudo apt-get install -y nodejs npm
...and make the installation of npm explicit. This sort of works, but then I get warnings every time I use npm that npm isn't really meant to be used with Node 10.
Am I perhaps missing some prerequisite for version 12, and being automatically downgraded to version 10?
I'm trying to to get this to work with a Raspberry Pi 3B+ with only 1GB RAM. Could that be the issue? My intention was to deliberately install 12 instead of 14 in this installation script if I detect less than 2GB RAM, because I think 14 might require more than 1GB to run reliably. Maybe 1GB is too small for 12 too?
If I try to install again, I get:
pi#raspberry:~ $ sudo apt-get install -y nodejs
Reading package lists... Done
Building dependency tree
Reading state information... Done
nodejs is already the newest version (10.24.0~dfsg-1~deb10u1).
0 upgraded, 0 newly installed, 0 to remove and 2 not upgraded.
Note: For most of my testing, I'm not using a real Raspberry Pi, but a VM with Debian Linux 10.8 and a Raspberry Pi desktop. The problems are the same on the real hardware, however. The VM just makes testing a LOT faster.
Remove the installed version:
sudo apt purge nodejs
Download the tarball from here, extact it then copy it to /usr/local/ (use uname -a the get the exact ARMv* version):
wget https://nodejs.org/dist/v12.9.1/node-v12.9.1-linux-armv7l.tar.xz
unxz node-v12.9.1-linux-armv7l.tar.xz
tar xvf node-v12.9.1-linux-armv7l.tar
cd node-v12.9.1-linux-armv7l/
sudo cp -R * /usr/local/
There are ways to automatically answer -y in bash commands for example like
RUN apt-get install -y nodejs
but I'm having this case I want to run
dpkg --install someDebianpackage.deb && apt install --assume-yes --fix-broken
It actually answers y for the immediate prompt given by it but in the later stage it asks me to configure geographic are with answer 6
and after that again I want to answer the command with 20 for the city corresponding to timezone
and then again with answer 31 and then 1 as same as above for different questions.
What I want to know is to run this command as single command in a non-interactive way. ( I'm hoping to make a docker file and put the above command along with some other commands that can be chained with && in a RUN Command for example like
RUN apt-get update && apt-get install sudo && "the above command along with their answers" && "some other command"
I would highly appreciate some guidance over this
Technically, you can auto-answer prompts with a tool like expect. However, that's usually much more difficult than getting the program to stop asking you questions.
I'm not sure why apt is asking for your timezone, but I suspect that you're pulling in the tzdata package somehow, which wants to configure your timezone. To avoid these questions, you should set the frontend to non-interactive:
To run dpkg (behind other tools like Apt) without interactive
dialogue, you can set one environment variable as
DEBIAN_FRONTEND=noninteractive
(Source.)
In a Dockerfile, you can set an environment variable like this:
ENV DEBIAN_FRONTEND=noninteractive
I'm running a vagrant box which runs ubuntu inside a vm (using Laravel Homestead box)
I'm trying to install the Elastic App-search product.
The first requirement is to install Elastic search, which i have done multiple times. I did the following steps:
https://www.elastic.co/guide/en/elasticsearch/reference/current/deb.html
wget -qO - https://artifacts.elastic.co/GPG-KEY-elasticsearch | sudo apt-key add -
sudo apt-get install apt-transport-https
echo "deb https://artifacts.elastic.co/packages/7.x/apt stable main" | sudo tee -a /etc/apt/sources.list.d/elastic-7.x.list
sudo apt-get update && sudo apt-get install elasticsearch
I'm using the systemd configuration:
sudo /bin/systemctl daemon-reload
sudo /bin/systemctl enable elasticsearch.service
I'm running curl localhost:9200 and everything is working.
Next I try to install elastic app search.
https://www.elastic.co/guide/en/app-search/current/installation.html#installation-self-managed.
Which doesn't have instructions for debian systems. But it does have a .deb install file. I downloaded the file and put it in my project route.
I ran dpkg -i on the file and it seems to have installed. When I run the command to check the file location it shows this:
dpkg -L enterprise-search
/.
/etc
/etc/init.d
/etc/init.d/enterprise-search
/var
/var/log
/var/log/enterprise-search
/usr
/usr/share
/usr/share/enterprise-search
/usr/share/enterprise-search/README.md
/usr/share/enterprise-search/bin
/usr/share/enterprise-search/bin/vendor
/usr/share/enterprise-search/bin/vendor/filebeat
/usr/share/enterprise-search/bin/vendor/filebeat/filebeat-linux-x86_64
/usr/share/enterprise-search/bin/enterprise-search
/usr/share/enterprise-search/filebeat
/usr/share/enterprise-search/filebeat/ecs-template.json
/usr/share/enterprise-search/filebeat/filebeat-ecs.yml
/usr/share/enterprise-search/lib
/usr/share/enterprise-search/lib/require_java_version.sh
/usr/share/enterprise-search/lib/enterprise-search.war
/usr/share/enterprise-search/jetty
/usr/share/enterprise-search/jetty/webserver-ssl.xml
/usr/share/enterprise-search/jetty/webserver-ssl-with-redirect.xml
/usr/share/enterprise-search/jetty/webserver.xml
/usr/share/enterprise-search/LICENSE
/usr/share/enterprise-search/config
/usr/share/enterprise-search/config/env.sh
/usr/share/enterprise-search/config/enterprise-search.yml
/usr/share/enterprise-search/NOTICE.txt
/usr/share/doc
/usr/share/doc/enterprise-search
/usr/share/doc/enterprise-search/changelog.gz
/usr/lib
/usr/lib/systemd
/usr/lib/systemd/system
/usr/lib/systemd/system/enterprise-search.service
I'm not really sure if this is the correct location? I want it to live in the same place as my elasticsearch install, but I'm actually not sure. I did all the next steps for the install process and ran:
./usr/share/enterprise-search/bin/elasticsearch
But this gives me the error:
Could not find java in PATH
I'm very confused by this since the main elasticsearch installation works and that also needs java? Also i want it also to run with systemd auto-enable and i want it to be available with enterprise-search start / stop. Not sure how to handle that.
Looks like it's Debian package, so it's installable on ubuntu, but some things may differ.
I would say you can:
Just switch to using debian VM for this (here you can get vagrant for one: https://app.vagrantup.com/debian/boxes/stretch64 )
Debug. From what I see that package runs elasticsearch-env before it runs itself. Java is looked for like this:
if [ ! -z "$JAVA_HOME" ]; then
JAVA="$JAVA_HOME/bin/java"
JAVA_TYPE="JAVA_HOME"
else
if [ "$(uname -s)" = "Darwin" ]; then
# macOS has a different structure
JAVA="$ES_HOME/jdk.app/Contents/Home/bin/java"
else
JAVA="$ES_HOME/jdk/bin/java"
fi
JAVA_TYPE="bundled jdk"
fi
if [ ! -x "$JAVA" ]; then
echo "could not find java in $JAVA_TYPE at $JAVA" >&2
exit 1
fi
So I would advise to set JAVA_HOME in start script (or before running the binary), and see if that helps.
I solved it by adding another version of Java, Elastichsearch has a java install build-in and not separate, so the app-search install can't reach that version. Feels very dirty but got it working!
I have spent about a week trying to get python python 3.x.x setup “properly” on my system. It has been quite a battle and I'm just about there with one final obstacle I can't seem to resolve. Many forums discuss setting up Python 3.X.X on various distro's and each has different methods, goals, outcomes, errors/issues with no clear answer. By now I have put in over 100 hours and have busted/reinstalled my system with clonzilla images dozens to times. But after all that, I have captured all the steps necessary to have the ultimate python setup in this posting - minus the answer to the final obstacle which I'm hoping someone can help me with:
The end goal I'm aiming for is the “ultimate python3.x.x setup” that I define as having the following characteristics:
has clean installation/configurations of python3.x.x. that are built from source, and include multiple side-by-side python3.x.x. versions (e.g. python3.0.1, python3.2.5, python3.3.0) with preserved root permissions assigned to each folder as part of the default /opt/ directory
Each installation does not interfere with the system's default interpreter,has pip, easy install, distribute tools, and virtualenv all properly configured and working and can run in isolation with different modules via virtualenv's
each python3.x.x is compiled, installed and named clearly in the /opt/ directory (e.g. python3.3.0, python3.3.1, python3.3.2), and is configured such that when calling whatever python3.x.x from the terminal window or using that version that it does not screwup the system's default interpretor, its dependencies/packages (plenty of forums on this one)
Each python3.x.x is working in pycharm's stupidly simplistic and awesome virtualenv manager - my last hurdle
The following steps are my setup so far and it compiled from multiple forums necessary to accomplish all of the above minus the last hurdle. Two important points are 1) I'm running Linux Mint LTS 13 and 2) I have NOT ran “sudo apt-get install python3” or any similar apt-get of python3xxxxx (this is deliberate for reasons below).
These are the steps I have taken on a fresh install of Linux mint 13, and now have backed up clonezilla image as well as virtual box's which I'm now using to solve this last hurdle.
Step 1:
This mega-command will download and setup pycharm, including the program's oracle (sun) dependencies, and install everything to the /opt/ directory (i.e.the proper location). I simply accept oracle's prompts and complete pycharm's final installation prompts (e.g. accept license, trial period etc.)
Pycharm
sudo add-apt-repository ppa:webupd8team/java -y && sudo apt-get update && sudo apt-get install oracle-java7-set-default -y && sudo apt-get install oracle-java7-installer -y && wget "http://download.jetbrains.com/python/pycharm-professional-3.0.2.tar.gz" && sudo mkdir /opt/Pycharm && sudo cp pycharm-professional-3.0.2.tar.gz /opt/Pycharm/ && cd /opt/Pycharm/ && sudo tar xvfz pycharm-professional-3.0.2.tar.gz && cd pycharm-3.0.2/bin && sudo sh pycharm.sh
Step 2:
This single command will download, extract, move, compile, and install 3.3.0, with all necessary prior dependencies, and place python3.3.0 in the /opt/ directory (the proper location).
Python3.3.0
sudo apt-get install build-essential libbz2-dev bzip2 zlib1g-dev sqlite3 libsqlite3-dev -y && wget http://python.org/ftp/python/3.3.0/Python-3.3.0.tgz && tar xvfz Python-3.3.0.tgz && cd Python-3.3.0 && ./configure --prefix=/opt/python3.3.0 && make && sudo make install
Step 3:
This single command will download, extract, move, compile, and install 3.2.5, with all necessary dependencies, and place python3.2.5 in the /opt/ directory.
Python3.2.5
wget http://www.python.org/ftp/python/3.2.5/Python-3.2.5.tgz && tar xvfz Python-3.2.5.tgz && cd Python-3.2.5 && ./configure --prefix=/opt/python3.2.5 && make && sudo make install
We now have pycharm and two side-by-side installations of python3.3.0 and python3.2.5 that are built from source, installed in the /opt/directory, and will not interfere with the system's python2.x.x interpretor or its dependencies/packages. Good so far as this is a very clean setup... Now comes the final hurdle.
If I (or you) “sudo apt-get install python3-dev” from this point, including a few other commands to setup and activate a virtualenv of python3.x.x, everything appears to work. Meaning you can setup multiple Python3.x.x virtualenv's and run them with pycharm, eclipse or from a terminal windows as either virtualenv's or non-virtualenv's. Pycharm makes it stupidly easy to manage virtually any configuration you want with its built-in virtualenv manager. The problem though is that doing “sudo apt-get install python3-dev” defeats the whole purpose of keeping python3.x.x as separate installations and runs the risk of 1) breaking python2.x.x packages, 2) installs pip packages meant for python3.x.x. into python2.x.x directories, 3) limits the ability of the user to only python3.2 and lower because you have to point whatever virtualenv you're using to the interpreter that came with running “sudo apt-get install python3-dev”, 4) a plethora of other problems scattered throughout forums I have investigated this this week in trying to figure this all out. Therefore “sudo apt-get install python3-dev” or any other apt-get of python3.x.x is not a solution as it leads to too many issues.
At this point I have a master version of a virtual box image setup with all the above steps completed in which I keep cloning and retrying to get the compiled interpretorls from /opt/ to function without doing a “sudo apt-get python3.xxx”. The 'key problem' indicated in screen shot is this issue. Nothing I do seems to allow me to point it to /opt/python3.xx/bin/pythonX interpretor whether using an IDE like pycharm, eclipse or by terminal. As soon as I run “sudo apt-get python3.xxx” it will work – but of course inherit all the other nightmare that people scream about in forums when they go down that route. Any help is greatly appreciated...
screenshot http://www.pasteall.org/pic/show.php?id=65653
Every configuration I have tried in getting the interpretor's that were compiled from source fails to allow those python3.x.x installations to function as virtualenv's and thus use package managers like pip either in a terminal window or with pycharm/eclipse. I have tried installing to home directories, changing permissions in /opt/, making system links, practically everything - everything that doesn't involve a “sudo apt-get install python3.xxxx”...This post (https://askubuntu.com/questions/406756/how-to-install-python-3-x-x-properly#406762), at step two, works but only if you revert to doing a “sudo apt-get install python3”.
What you're looking for is pyenv. It will manage your python installations, and allow you to install new versions of python without hampering other installations, it will work fine Pycharm, and will not hamper other python installations. Its done completely in bash, so it does not have python as a prerequisite installation.
I have finally figured out what I was doing wrong. I was not reading the make report and fixing additional dependencies before installing. The main problem was including dependencies for _ssl which is required for pip to work with python3.
I now have my "ultimate python setup"
go to run jenkins after doing an upgrade, and get the following:
start jenkins
start: Job failed to start
That's it...nothing shows up in jenkin's log...so it is difficult to debug to say the least.
(and it isn't running already, or anything like that).
Is there another log somewhere that I should be looking at that would be helpful?
(I am assuming answer to this problem will be somewhat iterative, so hopefully someone can start me on a path to debug this)
So, knowing it was a pre-start error allowed me to investigate more deeply.
Further digging allowed me to figure out that the exact line in the /etc/init/jenkins.conf file was one pointing to the /usr/share/jenkins/bin/maintain-plugins.sh
Looking at this location, I found it was not present (ie. no bin directory). This means that jenkins-common was no longer installed for some reason...odd indeed...going into apt-get and doing an install of this component again led to the error:
dpkg error processing /var/cache/apt/archives/jenkins-common_1.409.1-0ubuntu4.2_all.deb ...
having seen this error before and refreshing my memory via google gave the following solution:
dpkg -i --force-overwrite /var/cache/apt/archives/jenkins-common_1.409.1-0ubuntu4.2_all.deb
This allowed the installation of common to proceed as normal. After this, all I had to do was replace the /usr/share/jenkins/jenkins.war with my backed up copy (because ubuntu is far behind the latest release version), and I was able to start the server again.
I am not exactly sure what caused the problem to begin with, but it was likely during an apt-get upgrade/clean process...and because of the weirdness with jenkins conflicting with jenkins-common, it did not repopulate the /usr/share/jenkins directory properly.
regardless, am glad it is working again. :)
Instead, you can run the following before the install to properly clean up any conffiles left by the distro version:
sudo apt-get purge jenkins
Then install the correct version.
Ubuntu 18.04 LTS use Java 9 as default java
Jenkins 2.107.2 still use Java 8
[Solution]
Install Java 8 before install Jenkins
sudo add-apt-repository ppa:webupd8team/java
sudo apt install oracle-java8-installer
wget -q -O - https://pkg.jenkins.io/debian-stable/jenkins.io.key | sudo apt-key add -
sudo apt-add-repository "deb https://pkg.jenkins.io/debian-stable binary/"
sudo apt install jenkins
See https://stackoverflow.com/a/49937744/900684
I went to see the jenkins logs
tail -f /var/log/jenkins/jenkins.log
In my case it didn't start because I used incompatible java version.
Update and make sure it sees correct java (In my case it should have been opened using JRE 1.7. To check, please use java -version command) and all should work
The following worked for me:
sudo rm /etc/init/jenkins.conf
sudo update-rc.d jenkins defaults
sudo service jenkins start
Then....
root#core:/# service jenkins start
* Starting Jenkins Continuous Integration Server jenkins [ OK ]
Borrowed from: https://groups.google.com/forum/#!msg/jenkinsci-users/eW_yEWLojFc/tFhb8DKoRHUJ
I got from this link: https://serverfault.com/questions/710680/jenkins-not-starting-in-ubuntu
It might be caused by a full disk.
To be really sure, try running it manually. Like this:
/usr/bin/java -Djava.awt.headless=true -jar /usr/share/jenkins/jenkins.war --webroot=/var/cache/jenkins/war --httpPort=8080 --ajp13Port=-1