apt

apt-get update' returned a non-zero code: 100

匿名 (未验证) 提交于 2019-12-03 02:20:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am trying to create a docker image from my docker file which has following contains FROM ubuntu:14.04.4 RUN echo 'deb http://private-repo-1.hortonworks.com/HDP/ubuntu14/2.x/updates/2.4.2.0 HDP main' >> /etc/apt/sources.list.d/HDP.list RUN echo 'deb http://private-repo-1.hortonworks.com/HDP-UTILS-1.1.0.20/repos/ubuntu14 HDP-UTILS main' >> /etc/apt/sources.list.d/HDP.list RUN echo 'deb [arch=amd64] https://apt-mo.trafficmanager.net/repos/azurecore/ trusty main' >> /etc/apt/sources.list.d/azure-public-trusty.list RUN gpg --keyserver pgp.mit

pip 10 and apt: how to avoid “Cannot uninstall X” errors for distutils packages

浪尽此生 提交于 2019-12-03 02:14:58
问题 I am dealing with a legacy Dockerfile. Here is a very simplified version of what I am dealing with: FROM ubuntu:14.04 RUN apt-get -y update && apt-get -y install \ python-pip \ python-numpy # ...and many other packages RUN pip install -U pip RUN pip install -r /tmp/requirements1.txt # includes e.g., numpy==1.13.0 RUN pip install -r /tmp/requirements2.txt RUN pip install -r /tmp/requirements3.txt First, several packages are installed using apt , and then several packages are installed using

python-dev installation error: ImportError: No module named apt_pkg

匿名 (未验证) 提交于 2019-12-03 02:13:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am Debian user, and I want to install python-dev, but when I run the code in the shell as a root: # aptitude install python-dev I get the following error: Traceback (most recent call last): File "/usr/bin/apt-listchanges", line 28, in <module> import apt_pkg ImportError: No module named apt_pkg What seems to be the problem and how can I resolve it? 回答1: Make sure you have a working python-apt package. You could try and remove and install that package again to fix the problem with apt_pkg.so not being located. apt-get install python-apt 回答2

How to generate a Dockerfile from an image?

匿名 (未验证) 提交于 2019-12-03 02:11:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Is it possible to generate a Dockerfile from an image? I want to know for two reasons: I can download images from the repository but would like to see the recipe that generated them. I like the idea of saving snapshots, but once I am done it would be nice to have a structured format to review what was done. 回答1: To understand how a docker image was built, use the docker history --no-trunc command. You can build a docker file from an image, but it will not contain everything you would want to fully understand how the image was generated.

Docker error: Unable to locate package git

心不动则不痛 提交于 2019-12-03 02:06:58
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

How to install a package using the python-apt API

匿名 (未验证) 提交于 2019-12-03 01:56:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I'm quite a newbie when it comes to Python, thus I beg foregiveness beforehand :). That said, I'm trying to make a script that, among other things, installs some Linux packages. First I tried to use subopen as explained here . While this can eventually work, I stumbled upon the python-apt API and since I'm not a big fan or re-inventing the wheel, I decided to give a try. Problem comes when trying to find examples/tutorials on installing a package using python-apt. Searching the documentation I found the PackageManager class that

ubuntu14.04 安装MySQL 5.7

杀马特。学长 韩版系。学妹 提交于 2019-12-03 01:48:09
ubuntu14.04 默认在线安装MySQL 5.5 1) wget http: //dev.mysql.com/get/mysql-apt-config_0.7.3-1_all.deb 2) dpkg -i mysql -apt -config_0 .7 .3 - 1_all .deb 3) apt -get update 4) apt -get install mysql -server -->会有报错,执行下一步 5) apt-get -f install -->更改为在线安装mysql 5.7 6) select @@version; 查看版本 来源: https://www.cnblogs.com/karl-python/p/11770018.html

How to circumvent “apt-key output should not be parsed”?

匿名 (未验证) 提交于 2019-12-03 01:33:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm automating my Docker installation. Something like this: if apt-key fingerprint 0EBFCD88 | grep "Key fingerprint = 9DC8 5822 9FC7 DD38 854A E2D8 8D81 803C 0EBF CD88" > /dev/null then # proceed fi This worked fine in older versions of apt-key , but recent versions have two issues: A different output format: I can hack around that A warning: Warning: apt-key output should not be parsed (stdout is not a terminal) Clearly, I can hack around this as well, just redirect stderr to /dev/null . It just made me curious: How do these fine folks

How do you list volumes in docker containers?

匿名 (未验证) 提交于 2019-12-03 01:33:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: When using docker images from registries, I often need to see the volumes created by the image's containers. Note: I'm using docker version 1.3.2 on Red Hat 7. Example The postgres official image from the Docker Registry has a volume configured for containers at /var/lib/postgresql/data . What's the most succinct command to show the volume at /var/lib/postgresql/data in a postgres container? 回答1: Use docker ps to get the container id. Then docker inspect -f '{{ .Mounts }}' containerid Example: terminal 1 $ docker run -it -v /tmp:/tmp ubuntu

How to check the version before install packages using apt-get

落花浮王杯 提交于 2019-12-03 01:32:58
问题 I'm thinking to install hylafax+ version 5.5.4 which was release last month on my Debian PC. I checked dpkg -l | grep "hylafax" and found out that the current version is 5.5.3. Then I checked apt-cache search hylafax and saw the packages are available, but I can't see any version number. How can I find the version of packages available in the apt-get ? 回答1: OK, I found it. apt policy <package name> will show the version details. It also shows which version is currently installed and which