LMSouq
server-admin Open

Docker error: Unable to locate package git

NY
Nyxynyx
1 month ago
3 views
Problem Description
I'm using an image `nginx` which is based on `dockerfile/ubuntu`. On attaching to the docker container's shell docker exec -it <container_id> /bin/bash I want to do a `git pull` so I tried installing `git` but `apt` is unable to find the package: root@a71e45d5cd40:/# apt-get install git Reading package lists... Done Building dependency tree Reading state information... Done E: Unable to locate package git How can we install `git` from that image and why is it missing? ---------- **cat /etc/apt/sources.list** deb http://httpredir.debian.org/debian wheezy main deb http://httpredir.debian.org/debian wheezy-updates main deb http://security.debian.org wheezy/updates main deb http://nginx.org/packages/mainline/debian/ wheezy nginx **cat /etc/apt/sources.list.d/*** cat: /etc/apt/sources.list.d/*: No such file or directory **apt-cache madison git** N: Unable to locate package git

AI-Generated Solution

Powered by LMSouq AI · GPT-4.1-mini

✓ Solution Ready
Analyzing problem and generating solution…
Was this solution helpful?
Back to Knowledge Base