drone build error: unable to locate package git - drone.io

My drone.yml file is as follows..
Keep getting the error unable to locate package git.
Any suggestions?
pipeline:
build:
image: python:3.5.1-slim
commands:
- apt update && apt install git-core
- pip install -r requirements.txt
- nosetests --with-coverage --cover-erase --cover-package

Have you provided the full yaml? Because the example yaml fails with a Do you want to continue? [Y/n] Abort error message due to the fact that drone is running in non-interactive mode and cannot block and wait for user prompt to continue. It does not fail with the error message specified in the question.
You therefore need to run the command with -y like this:
pipeline:
build:
image: python:3.5.1-slim
commands:
- apt-get update
- apt-get install -y git-core
- which git
Which results in the following output in my logs:
+ which git
/usr/bin/git
Note that when drone runs your build it turns the commands into a simple shell script, starts the container, and executes the shell script as the entrypoint. So your yaml would turn into something like this:
#!/bin/sh
set -e
apt-get update
apt-get install -y git-core
which get
This means you should be able to test your commands directly from the command line in Docker to pinpoint what looks to be either an image or command issue:
$ docker run -t -i python:3.5.1-slim
# apt-get update && apt-get -y install git-core
# which git
I'm sorry this doesn't fully answer the question, but I was unable to repeat the same error message with the sample yaml provided in the question. If you can provide more clarify in your question, I can come back to this answer and edit in response

Related

how to correctly install wkhtmltopdf in linux mint?

IM trying to install "wkhtmltopdf"
sudo apt install ./wkhtmltox_0.12.6-1.bionic_amd64.deb
when I try to run I get this command
E: Unsupported file ./wkhtmltox_0.12.6-1.bionic_amd64.deb given on commandline
can anyone show me how to fix this?
Use
# sudo dpkg -i wkhtmltox_0.12.6-1.bionic_amd64.deb
# sudo apt install -f
The last command should install any missing dependencies when running the first command.

tensorflow_model_server: command not found

I've created a folder "Model_en" and the path to my saved model is:
"--model_base_path=/Users/tarunkumar/Documents/tensor_models/Model_en/1/"
also, my model name is:
"--model_name=Model_en"
After running the command:
"tensorflow_model_server --rest_api_port=8501 --model_name=Model_en --model_base_path=/Users/tarunkumar/Documents/tensor_models/Model_en/1/
"
I'm getting the error as:
"bash: tensorflow_model_server: command not found"
The installation may not have happen properly. For safer side, first remove the corrupt packages that may have installed,
apt-get remove tensorflow-model-server
Then,
Add TensorFlow Serving distribution URI as a package source:
echo "deb [arch=amd64] http://storage.googleapis.com/tensorflow-serving-apt stable tensorflow-model-server tensorflow-model-server-universal" | sudo tee /etc/apt/sources.list.d/tensorflow-serving.list && curl https://storage.googleapis.com/tensorflow-serving-apt/tensorflow-serving.release.pub.gpg | sudo apt-key add -
To this, you should get OK as output in the terminal.
Install and update TensorFlow ModelServer:
apt-get update && apt-get install tensorflow-model-server
Once installed, upgrade to a newer version of tensorflow-model-server with:
apt-get upgrade tensorflow-model-server
The binary can now be invoked using the command tensorflow_model_server
You may get output,
Failed to start server. Error: Invalid argument: Both server_options.model_base_path and server_options.model_config_file are empty!
This means the installation is successful and you can run the command to start the server.
source
This may help as well, at least it worked for me.
pip install tensorflow-serving-api
You have to install it first. Here is how it is done on Debian/Ubuntu:
Installation
Add TensorFlow Serving distribution URI as a package source (one time setup)
echo "deb [arch=amd64] http://storage.googleapis.com/tensorflow-serving-apt stable tensorflow-model-server tensorflow-model-server-universal" | sudo tee /etc/apt/sources.list.d/tensorflow-serving.list && \
curl https://storage.googleapis.com/tensorflow-serving-apt/tensorflow-serving.release.pub.gpg | sudo apt-key add -
Install and update TensorFlow ModelServer
apt-get update && apt-get install tensorflow-model-server
Once installed, the binary can be invoked using the command tensorflow_model_server.
You can upgrade to a newer version of tensorflow-model-server with:
apt-get upgrade tensorflow-model-server

Unable to install required package (rabbitmq-server) before Travis CI build

Since today I experience the following issue with Travis CI: the required package specified in before_install section of .travis.yml:
before_install:
- sudo apt-get update -qq
- sudo apt-get install -qq rabbitmq-server
cannot be installed, breaking the build.
Response as shown Travis console log:
$ sudo apt-get update -qq
W: http://ppa.launchpad.net/couchdb/stable/ubuntu/dists/trusty/Release.gpg: Signature by key 15866BAFD9BCC4F3C1E0DFC7D69548E1C17EAB57 uses weak digest algorithm (SHA1)
$ sudo apt-get install -qq rabbitmq-server
E: Unable to correct problems, you have held broken packages.
The command "sudo apt-get install -qq rabbitmq-server" failed and exited with 100 during .
Your build has been stopped.
How would I overcome this problem? I have tried to replicate the issue locally, but it seems to be not reproducible.
I searched Google with this search string - "failed and exited with 100" apt install - this is the first hit:
https://github.com/travis-ci/travis-ci/issues/7998

npm install error `not foundram Files/nodejs/npm: 3: /mnt/c/Program Files/nodejs/npm:`

I have installed Ubuntu Bash on Windows. I already have nodejs and npm on my windows machine at C:\Program Files\nodejs. In the bash shell in Windows, I am running a script which uses npm install command. The script is giving following error
: not foundram Files/nodejs/npm: 3: /mnt/c/Program Files/nodejs/npm:
: not foundram Files/nodejs/npm: 5: /mnt/c/Program Files/nodejs/npm:
/mnt/c/Program Files/nodejs/npm: 6: /mnt/c/Program Files/nodejs/npm: Syntax error: word unexpected (expecting "in")
Note: Before following the steps below, first try to restart your shell.
You can install Node.js and NPM with your Windows PowerShell as well, so if you've done that it won't work properly for your Subsystem. That means you have to install it twice (Powershell and Subsystem) or decide on one thing.
If the preceding text, has not helped you, this is how to solve the problem:
Remove your current installations
sudo apt-get --purge remove node
("sudo apt autoremove node" if console is asking for it)
sudo apt-get --purge remove nodejs
Install node the right way.
This is for version 14 (view current LTS version):
curl -fsSL https://deb.nodesource.com/setup_14.x | sudo -E bash -
sudo apt-get install -y nodejs
Then install build tools so you can install add-ons for npm later
sudo apt-get install -y build-essential
Now you can type in
npm -v
node -v
Same thing: nodejs -v
to check whether Node.js and NPM are installed correctly. If it shows nothing, restart the shell.
If it still shows the same error, restart the WSL/ PC or try with sudo npm -v
Here are two links that may also help you.
https://nodejs.org/en/download/package-manager/#debian-and-ubuntu-based-linux-distributions
https://github.com/nodesource/distributions/blob/master/README.md#debinstall
Also, take a look at the Node Version Manager (NVM). With it, you can easily switch back and forth between versions.
The solution provided by phucanhapril on May 24, 2017 in this thread worked for me.
To summarise, edit ~/.profile and change your PATH to this:
PATH="$HOME/bin:$HOME/.local/bin:/usr/bin:$PATH"
(By default it does not include /usr/bin)
Then run:
source ~/.profile
I am not quite sure why npm doesn't work properly in the first place, or why /usr/bin isn't in PATH by default, but the solution worked for me.
I had the same problem to solve I installed "NVM" in my Subsystem
Follow these steps and see if it will solve for you:
sudo apt-get update
sudo apt-get install build-essential libssl-dev
curl -sL https://raw.githubusercontent.com/creationix/nvm/v0.31.0/install.sh -o install_nvm.sh
bash install_nvm.sh
source ~/.profile
nvm install 11.13.0
You can try sudo npm install it was a solution in my particular case.
Linux command for install nodejs and npm
sudo apt-get install nodejs
sudo apt-get install npm
Set path in linux
export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
reference
https://github.com/microsoft/WSL/issues/3882
curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash -
sudo apt-get install -y nodejs
this is enough, if you still face the problem
node installation needs restart, close you ubuntu window and start again it will solve your problem :)
I had the same problem. This is what I did.
Step 1. Type node -v and npm -v commands in Windows PowerShell and check if node and npm are properly installed
Step 2. Add this to the ~/.zshrc or ~/.bashrc file
export NVM_DIR="$([ -z "${XDG_CONFIG_HOME-}" ] && printf %s "${HOME}/.nvm" || printf %s "${XDG_CONFIG_HOME}/nvm")"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
Step 3. Type source ~/.zshrc and/or source ~/.bashrc
Step 4. Type node -v and npm -v commands in bash or zsh shells and the correct versions should now appear
On Visual Studio -> Tools -> Options -> Projects and Solutions -> Web Package Management -> make sure $(PATH) is above all the rest.
As long it is not located at the top of the list VS will try to use VS tools instead of npm.
You should also refer windows to the current npm version by following this screenshot, after try npm --version.
Changing npm path:
I had this issue in both Debian and Ubuntu (though in Ubuntu the nvm command did work) when I was running Windows 10 version 1703. Then when I upgraded to version 1903 the problem disappeared.
I had the same error and it may seem silly, but I fixed it by simply typing exit in the console and opening it again.
I received this error when I modified my "~/.bashrc" file to shorten up the bash directory.
At first I had:
if [ "$color_prompt" = yes ]; then
PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u\[\033[00m\]:\[\033[01;34m\]\W\[\033[00m\]\$ '
else
PS1='${debian_chroot:+($debian_chroot)}\u\h:\W\$'
fi
....But then could not run any node operation. I rolled it back and the error stopped happening.
After some troubleshooting, I was able to fix the error by adding ~ before the $ on PS1='${debian_chroot:+($debian_chroot)}\u\h:\W\~$
I just read through many threads trying to do this. There is complete documentation for setting up node, nvm, and npm in wsl, here: https://learn.microsoft.com/en-us/windows/nodejs/setup-on-wsl2
If you already installed node and npm using the following commands,
sudo apt-get install nodejs
sudo apt-get install npm
NPM will not work. You must first uninstall them using:
sudo apt-get remove nodejs
sudo apt-get remove npm
Follow the guide to completely uninstalling here: How can I completely uninstall nodejs, npm and node in Ubuntu
Then reinstall from the windows guide referenced above.
The windows guide has many other useful resources.
The Tldr to install(from Microsoft Docs):
sudo apt-get install curl
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.37.2/install.sh | bash
nvm install --lts
I had identical output to that in the question. It occurs because Ubuntu on WSL adds Windows paths to the bash shell, but of course the Windows executables do not work in bash.
I installed nvm, and from there installed node into bash. NVM works out all the paths so it works.

Redis Installation fails with "Newer version of jemalloc required" when running make command

Redis installation on RHEL fails when running make command. Below is the output
cd src && make all
make[1]: Entering directory `/root/Downloads/redis-3.2.0/src'
CC adlist.o
In file included from adlist.c:34:
zmalloc.h:50:31: error: jemalloc/jemalloc.h: No such file or directory
zmalloc.h:55:2: error: #error "Newer version of jemalloc required"
make[1]: *** [adlist.o] Error 1
make[1]: Leaving directory `/root/Downloads/redis-3.2.0/src'
make: *** [all] Error 2
running
make distclean
and then
make
solved the issue
It happen due to gcc compiler not available in machine. first install gcc:
$ sudo apt install gcc
then try
make
sure it'll resolve this issue . I tried on ubuntu 18.04.
Redis creates the redis-server and redis-cli files only after the Dependenices in the /deps directory: hiredis lua jemalloc linenoise are resolved.
I had to run the make command in the deps directory more than once to get the depenedencies resolved.
The following are the Steps I followed:
cd <redisInstallationPath> (I have it under /opt/mount1/redis-3.0.7)
make distclean
cd deps/
Resolve dependecies more than once.
make lua hiredis linenoise
make jemalloc
make hiredis
make linenoise
Did the same again as there were a few missing files. I think you just need to get the combination correct. Run the make command more than once till you get it right.
make hiredis lua jemalloc linenoise
make hiredis
make lua
make jemalloc
make linenoise
cd /opt/mount1/redis-3.0.7/
make
-> I got some errors here that the file hiredis/libhiredis.a is not found and hence I continued again to resolve dependecies.
cd deps
make jemalloc
make hiredis
ll hiredis/libhiredis.a -> yields a file
cd /opt/mount1/redis-3.0.7/
make
Now I get the following output:
cd src && make all
make[1]: Entering directory `/opt/mount1/redis-3.0.7/src'
LINK redis-server
INSTALL redis-sentinel
CC redis-cli.o
LINK redis-cli
CC redis-benchmark.o
LINK redis-benchmark
CC redis-check-dump.o
LINK redis-check-dump
CC redis-check-aof.o
LINK redis-check-aof
Hint: It's a good idea to run 'make test' ;)
make[1]: Leaving directory `/opt/mount1/redis-3.0.7/src'
You can go to Redis installation path (in my case: /opt/mount1/redis-3.0.7 directory) to start the Server.
src/redis-server
And in another terminal run 'redis-cli' to connect to the Redis Server.
src/redis-cli
Example:
127.0.0.1:6379> incr counter
(integer) 1
127.0.0.1:6379> get counter
"1"
127.0.0.1:6379> exit
I got a solution to my problem through this article http://michael.otacoo.com/redis/redis-first-steps-fetch-install-and-server-creation/
Ditch the OS based installation, tried multiple solutions some dependency was always failing
Node to the rescue
There are other ways to install Node and NPM below steps is using Yum on Centos / RHEL
# Add NodeSource yum repository
curl -sL https://rpm.nodesource.com/setup_16.x | sudo bash -
# Additional dependencies if required
yum install gcc-c++ make -y
# Install Node.js and npm
yum install nodejs -y
# install redis-cli
npm install -g redis-cli
# connect to redis endpoint
rdcli -h redis.host
# or
rdcli -h redis.host -a redis.password -p 1111
once connected run
PING
response should be
PONG
to validate the connectivity
cache.amazonaws.com:6379> PING
PONG
In linux
May be some of the files required are missing which can be installed with libc6-dev package.
This worked for me:-
Go to your redis directory and run the following in your terminal:-
sudo apt-get install libc6-dev
make distclean && make
That shouldn't be happening. One possible reason could be that your make tools are way older than current version. To update them run:
yum install make gcc gcc-c++ kernel-devel
This will install minimum packages, but if even that doesn't solves the problem, try installing the complete group:
yum install make gcc gcc-c++ kernel-devel
Read More: https://superuser.com/questions/151557/what-are-build-essential-build-dep
I guess the version 3.2.0 lost some files because I have met the same problem as you, I solved it by downloading another redis version 3.0.7, the download link is
http://download.redis.io/releases/redis-3.0.7.tar.gz
Then, decompress the file and run the command as you have done before, just step into the redis directory and type the command 'make'
Good luck with you
This error may indicate that you need to run make with sudo: sudo make
You may afterwards run into:
../deps/jemalloc/lib/libjemalloc.a(nstime.o): In function nstime_get': /opt/redis_src/current/redis-stable/deps/jemalloc/src/nstime.c:120: undefined reference toclock_gettime'
If so, please see:
https://github.com/antirez/redis/issues/3790
on centos
yum install gcc glibc
tar zxvf redis-5.0.3.tar.gz
cd redis-5.0.3
cd deps
make hiredis jemalloc linenoise lua geohash-int
cd ..
make install
cd utils
./install_server.sh
extra tips
To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the command 'sysctl vm.overcommit_memory=1' for this to take effect.
The TCP backlog setting of 511 cannot be enforced because /proc/sys/net/core/somaxconn is set to the lower value of 128
You should use Ubuntu PPA
$ sudo add-apt-repository ppa:redislabs/redis
$ sudo apt-get update
$ sudo apt-get install redis