I am implementing a node.js application in docker, that needs to make use of the git worktree feature. However, even if I do :
RUN apt-get update && apt-get install -y git=2.10.0
it can't find any other version after 2.1.0
I am building the image from :
FROM node:4.4.2
How can I get the latest git version that supports the worktree feature installed on a docker container
As of the time of this post, no package repos from Debian include a version beyond 2.9. If you need a newer version, you'll need to download and install that from source which is documented on git-scm, or find another repo.
From some other answers (credit to #Alex Karshin), this solution works for me in the Dockerfile
RUN apt-get update && \
apt-get upgrade -y && \
apt-get install -y git
See https://askubuntu.com/a/568596/159234
RUN apt-add-repository ppa:git-core/ppa && apt-get update && apt-get install -y git
Related
I am trying to use Google Colab for a fMRI experiment, however, I have been struggling with incompatibilities between package versions (for datalad). At first, git did not update with sudo-apt get and I found the solution with this.
sudo add-apt-repository ppa:git-core/ppa -y
sudo apt-get update
sudo apt-get install git -y
git --version
Even though git is updated, git-annex does not seem to update, whilst trying to update with this
sudo apt-get update -y
sudo apt-get install -y git-annex
it gives this error:
"git-annex is already the newest version (6.20180227-1)." But the dependency for datalad requires git-annex at least to be 8.
The git configuration is already initiated (user name and email).
I would deeply appreciate any opinions on how to fix this issue.
Thank you so much in advance.
I am running PHP 7.2 on an Apache server on Ubuntu, and I need to add the PHP SoapClient. However, when I try to install it using apt-get, I get the following error:
The following packages have unmet dependencies:
php7.2-soap : Depends: php7.2-common (= 7.2.24-0ubuntu0.19.04.2) but 7.2.26-1+ubuntu19.04.1+deb.sury.org+1 is to be installed
E: Unable to correct problems, you have held broken packages.
I've tried the following before reattempting:
sudo apt-get update
sudo apt-get clean && sudo apt-get update
sudo apt-get upgrade
sudo apt-get upgrade-dist
sudo apt-get -f install
sudo dpkg --configure -a
If it helps, when I run uname -r the output is
5.0.0-37-generic
Thanks in advance!
After a looooong time tackling this issue I finally got my head around it and found a solution :)
It seems the issue is I was using the ppa:ondrej/apache2 PPA which was installing the latest version of a selection of PHP packages, which at the time of writing is using PHP7.2.27. As far as I can tell, the most up-to-date version of the php7.2-soap package is for php7.2.24, meaning there is an unmet dependency for the php7.2-common package provided by the PPA.
So, the solution was to remove the PPA and downgrade the PHP packages. Here's a step by step for any poor souls who might encounter a similar issue:
First, if not already installed, install aptitude sudo apt-get install aptitude
Next, install ppa-purge:
mkdir ppa-purge && cd ppa-purge && wget http://mirror.pnl.gov/ubuntu/pool/universe/p/ppa-purge/ppa-purge_0.2.8+bzr56_all.deb && wget http://mirror.pnl.gov/ubuntu//pool/main/a/aptitude/aptitude_0.6.6-1ubuntu1_i386.deb && sudo dpkg -i ./*.deb
(I ran this in my user folder, i.e. ~/
Then I remove the PPA with the following commands:
sudo ppa-purge ppa:ondrej/apache2
sudo add-apt-repository --remove ppa:ondrej/apache2
sudo apt-get autoclean
Now we need to downgrade the dependencies. First I determined which version I needed. The package that was causing the unmet dependency was php7.2-common, so I ran sudo apt list -a php7.2-common. I chose the version which matched the original error message, in this case, 7.2.24-0ubuntu0.19.04.2.
So you are able to install a specific version by following the package with a = then a version number. If you, like me, are working on a live server, I'm going to shout this next bit about the next command you will write:
DO NOT USE THE -y TAG!!
CHOOSE "NO" WHEN IT ASKS YOU IF YOU WANT TO CONTINUE!!
If you do any of these, it will automatically remove any dependencies for php7.2-common and the PHP stop working on your site.
To determine which dependencies we need to update along with php7.2-common, I ran sudo apt-get install php7.2-common=7.2.24-0ubuntu0.19.04.2. It then showed me a list of other packages it would remove as well. I copied these dependencies then chose 'n' to cancel the install.
Next, I put the copied list into a text editor and used it to create the following script:
sudo apt-get install php7.2-common=7.2.24-0ubuntu0.19.04.2 \
libapache2-mod-php7.2=7.2.24-0ubuntu0.19.04.2 \
php7.2=7.2.24-0ubuntu0.19.04.2 \
php7.2-bcmath=7.2.24-0ubuntu0.19.04.2 \
php7.2-bz2=7.2.24-0ubuntu0.19.04.2 \
php7.2-cgi=7.2.24-0ubuntu0.19.04.2 \
php7.2-cli=7.2.24-0ubuntu0.19.04.2 \
php7.2-curl=7.2.24-0ubuntu0.19.04.2 \
php7.2-dev=7.2.24-0ubuntu0.19.04.2 \
php7.2-enchant=7.2.24-0ubuntu0.19.04.2 \
php7.2-fpm=7.2.24-0ubuntu0.19.04.2 \
php7.2-gd=7.2.24-0ubuntu0.19.04.2 \
php7.2-imap=7.2.24-0ubuntu0.19.04.2 \
php7.2-intl=7.2.24-0ubuntu0.19.04.2 \
php7.2-json=7.2.24-0ubuntu0.19.04.2 \
php7.2-ldap=7.2.24-0ubuntu0.19.04.2 \
php7.2-mbstring=7.2.24-0ubuntu0.19.04.2 \
php7.2-mysql=7.2.24-0ubuntu0.19.04.2 \
php7.2-odbc=7.2.24-0ubuntu0.19.04.2 \
php7.2-opcache=7.2.24-0ubuntu0.19.04.2 \
php7.2-pspell=7.2.24-0ubuntu0.19.04.2 \
php7.2-readline=7.2.24-0ubuntu0.19.04.2 \
php7.2-tidy=7.2.24-0ubuntu0.19.04.2 \
php7.2-xml=7.2.24-0ubuntu0.19.04.2 \
php7.2-xmlrpc=7.2.24-0ubuntu0.19.04.2 \
php7.2-zip=7.2.24-0ubuntu0.19.04.2
Finally, I ran this command. Instead of warning me about removing the packages, it warned me that these packages would be "downgraded", which is fine. I pressed Y and it reinstalled all the packages and viola! I was then able to install php7.2-soap :)
See these links which I credit to finding a solution for this:
https://askubuntu.com/a/92021
https://appuals.com/fix-unmet-dependencies-error-ubuntu/
I have a similar issue one month ago with a Debian 9 and PHP 7 Did you consider to upgrade your PHP to the latest stable version before installing the PHP Client ?
I'm installing Ghostscript into a docker image and want to use it with ghostscript4js which requires for some functionality at least Ghostscript 9.21.
I'm using this in my docker file which installs Ghostscript 9.06
FROM node:7
ARG JOB_TOKEN
RUN apt-get update && \
apt-get install -y pdftk
ENV APP_DIR="/usr/src/app" \
JOB_TOKEN=${JOB_TOKEN} \
APP_DIR="/usr/src/app" \
GS4JS_HOME="/usr/lib"
COPY ./ ${APP_DIR}
# Step 1: Install App
# -------------------
WORKDIR ${APP_DIR}
# Step 2: Install Python, GhostScript and npm packages
# -------------------
ARG CACHE_DATE=2017-01-01
RUN \
apt-get update && \
apt-get install -y build-essential make gcc g++ python python-dev python-pip python-virtualenv && \
apt-get -y install ghostscript && apt-get clean && \
apt-get install -y libgs-dev && \
rm -rf /var/lib/apt/lists/*
RUN npm install
# Step 3: Start App
# -----------------
CMD ["npm", "run", "start"]
How do I install or upgrade to a higher Ghostscript version in a docker image?
Seems like the distro you are using (since you use apt-get) is only on 9.06. Not surprising, many distros remain behind the curve, especially long term support ones.
If you want to use a more recent version of Ghostscript, then you could nag the packager to update. And you know, 9.06 is 5 years old now.....
Failing that you'll have to build it yourself. Git clone the Ghostscript repository, cd ghostpdl, ./autogen.sh, make install. That of course gets the current bleeding edge source, for a release version you'll have to pull from one of the tags (we tag the source for each release).
Or build it yourself locally and put it somewhere that your docker image can retrieve it from.
IMO if you are going to use a version other than the one provided by the packager of your distro, you may as well use the current release. That's currently 9.22 and will be 9.23 in a few weeks.
I want to install netstat on my Docker container.
I looked here https://askubuntu.com/questions/813579/netstat-or-alternative-in-docker-ubuntu-server-16-04-container so I'm trying to install it like this:
apt-get install net-tools
However, I'm getting:
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package net-tools
So how can I install netstat?
You need to run apt-get update first to download the current state of the package repositories. Docker images do not include this to save space, and because they'd likely be outdated when you use it. If you are doing this in a Dockerfile, make sure to keep it as a single RUN command so that caching of the layers doesn't cache an old version of the update command with a new package install request:
RUN apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y \
net-tools \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
netstat is provided by the net-tools package,net-tools is probably not installed by default in the Docker image for Ubuntu 16.04 to keep the image size as small as possible.
Execute the following commands inside docker container:
apt update
apt install net-tools
I am trying to set up Git on an Ubuntu Machine (I'm using a Samsung Chromebook running Ubuntu 12.04).
When I entered "sudo apt-get install git" and it successfully installed Git 1.79
user#ChrUbuntu:~$ git --version
git version 1.7.9.5
I can't figure out what I am doing wrong here. Any suggestions?
For new installations of Ubuntu I would first try this to get the latest updates
sudo apt-get dist-upgrade
For more info on this see https://askubuntu.com/questions/81585/what-is-dist-upgrade-and-why-does-it-upgrade-more-than-upgrade
That should solve it but if not, add the repository from these guys https://launchpad.net/~git-core/+archive/ppa
sudo add-apt-repository ppa:git-core/ppa
sudo apt-get update
sudo apt-get install git
This way you don't have to build it, etc.
Perhaps you need to build for
the newest version
wget git-core.googlecode.com/files/git-1.8.1.1.tar.gz
tar -zxf git-1.8.1.1.tar.gz
cd git-1.8.1.1
make prefix=/usr/local all
sudo make prefix=/usr/local install
If you are trying to upgrade to the latest version of Git, you should do:
sudo apt-get update
sudo apt-get upgrade
This will update all your packages, as well as Git.
BTW, latest version of Git on my Kubuntu 12.10 is 1.7.10.4.
A combination of some of the answers worked for me. I did...
sudo add-apt-repository ppa:git-core/ppa
sudo apt-get update
sudo apt-get upgrade
Have you tried to do an apt-get update?
You might have an outdated package list.
In ubuntu 14.04 I tried the terminal code:
sudo apt-get update
sudo apt-get upgrade
step to upgrade git.
1.) git --version
*to know what git version you had in your computer
2.) sudo apt-get update
*update ubuntu
3.) sudo apt-get upgrade
*to upgrade software including git
4.) try to git --version
that's it :)