Score:-2

ubuntu: /bin/sh: apt: not found

nl flag

I have a container on which I want to install ca-certificates, but despite being ubuntu, it doesn't recognize both apt and apt-get

~ # cat /proc/version
Linux version 5.4.0-109-generic (buildd@ubuntu) (gcc version 9.4.0 (Ubuntu 9.4.0-1ubuntu1~20.04.1)) #123-Ubuntu SMP Fri Apr 8 09:10:54 UTC 2022
~ # apt update
/bin/sh: apt: not found
~ # apt-get update
/bin/sh: apt-get: not found
~ # apk update
/bin/sh: apk: not found
~ # 

in flag
The container is not Ubuntu. You are just running it on a Ubuntu server.
Zareh Kasparian avatar
us flag
what is the image name you are using ?
pt flag
`/proc/version` doesn't tell you what distribution you're running; it just contains information about the running kernel...which in a containerized environment is simply the host kernel, so it doesn't tell you anything about the container.
Score:1
us flag

Your commands are failing because your container isn't on ubuntu, that is your host machine.

 cat /proc/version

Is giving you information from the kernel, but its using the kernel of your hostmachine and thus giving you a misleading result. You need to see what os your container is actually running.

Show us your dockerfile, inside the dockerfile you have a section in which you tell the container what image it should be using. If you look at the image being used you'll be able to see what os is running and you can then execute the appropriate commands.

From within the container you should be able to either do

cat /etc/os-release

or if its CentOs :

cat /etc/issue
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.