Score:0

Cannot execute dpkg command in kube-proxy container

ao flag

I'm currently trying to get a list of all installed debian packages (dpkg) on the k8s.gcr.io/kube-proxy:v1.23.2 container.

First I tried to execute dpkg -l in the running container as a part of my kubernetes cluster but got the following error.

dpkg-query: error: showing package list on pager subprocess returned error exit status 127

Then I also tried the command directly on containerd nerdctl run -it k8s.gcr.io/kube-proxy:v1.23.2 dpkg -l but got the same error.

Is it possible to get the list by modifying some settings, or is there any different approach?

Piotr Malec avatar
vn flag
Hi, Daigo did the answer below solve your issue?
Daigo avatar
ao flag
Yeah, it worked!
Score:2
jp flag

I suspect that dpkg attempts to run a pager (less) but it is not found in PATH so your get 127 exist code. Run dpkg -l --no-pager.

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.