标签: apt

pip 10和apt:如何避免distutils包的"无法卸载X"错误

我正在处理遗留的Dockerfile.这是我正在处理的非常简化的版本:

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
Run Code Online (Sandbox Code Playgroud)

首先,使用安装几个软件包apt,然后使用安装几个软件包pip.pip版本10已经发布,部分版本是这个新限制:

删除了对卸载使用distutils安装的项目的支持.distutils安装的项目不包括指示哪些文件属于该安装的元数据,因此实际卸载它们是不可能的,而不是仅删除表示已安装的元数据,同时保留所有实际文件.

这导致我的设置中出现以下问题.例如,首先apt安装python-numpy.后来pip尝试安装新版本的numpy从如/tmp/requirements1.txt,并试图卸载旧版本,但由于新的限制,它无法删除此版本:

Installing collected packages: numpy
  Found existing installation: numpy 1.8.2
Cannot uninstall 'numpy'. It …
Run Code Online (Sandbox Code Playgroud)

python apt distutils pip docker

41
推荐指数
2
解决办法
4万
查看次数

debian apt包哈希和不匹配

从Debian命令行开始,执行后我得到一个哈希和不匹配aptitude update; aptitude upgrade.下面是命令行输出.我试过了aptitude clean,但这似乎没有帮助.我也做了一些谷歌搜索,但似乎没有任何帮助.我几天都遇到了不匹配错误.

任何帮助表示赞赏.


Resolving dependencies...
open: 405; closed: 880; defer: 58; conflict: 78.
The following packages will be upgraded:
  apache2.2-bin apt-utils aptdaemon aptdaemon-data avahi-daemon bind9-host dnsutils ekiga gir1.2-cogl-1.0 gir1.2-coglpango-1.0 gstreamer0.10-alsa gstreamer0.10-ffmpeg
  gstreamer0.10-plugins-base gstreamer0.10-x host libapt-inst1.5 libavahi-client3 libavahi-common-data libavahi-common3 libavahi-core7 libavahi-glib1 libavahi-gobject0
  libavahi-ui-gtk3-0 libavahi-ui0 libavutil51 libbind9-80 libcapi20-3 libcogl-common libcogl9 libdbus-glib-1-2 libdns88 libgconf2.0-cil libgssapi-krb5-2 libgssrpc4
  libgstreamer-plugins-base0.10-0 libisc84 libisccc80 libisccfg82 libk5crypto3 libkrb5-3 libkrb5support0 liblwres80 libmp3lame0 libmtp-common libmtp-runtime libmtp9
  libpostproc52 libruby1.8 libswscale2 libsystemd-login0 libtag1-vanilla libtag1c2a libxml2 libxml2-utils …
Run Code Online (Sandbox Code Playgroud)

debian apt upgrade

37
推荐指数
4
解决办法
4万
查看次数

Docker错误:无法找到包git

我使用的图像nginx是基于dockerfile/ubuntu.在附加到docker容器的shell时

docker exec -it <container_id> /bin/bash
Run Code Online (Sandbox Code Playgroud)

我想做一个git pull所以我尝试安装gitapt无法找到包:

root@a71e45d5cd40:/# apt-get install git
Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package git
Run Code Online (Sandbox Code Playgroud)

我们如何git从该图像安装,为什么它会丢失?


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
Run Code Online (Sandbox Code Playgroud)

cat /etc/apt/sources.list.d/*

cat: /etc/apt/sources.list.d/*: No such file or directory
Run Code Online (Sandbox Code Playgroud)

apt-cache madison git

N: Unable to locate package git
Run Code Online (Sandbox Code Playgroud)

git ubuntu apt docker

32
推荐指数
1
解决办法
3万
查看次数

如何比较Debian软件包版本?

我看了看python-apt,并python-debian和他们似乎并不有功能比较软件包版本.我必须自己写,还是我可以使用?

理想情况下,它看起来像:

>>> v1 = apt.version("1:1.3.10-0.3")
>>> v2 = apt.version("1.3.4-1")
>>> v1 > v2
True
Run Code Online (Sandbox Code Playgroud)

python debian apt

31
推荐指数
3
解决办法
1万
查看次数

由于 apt-key 已弃用,如何使用 ansible playbook 管理 trust.gpg.d 中的密钥环文件?

在被弃用之前apt-key,我使用 Ansible playbook 在我的服务器中添加和更新密钥。目前,apt-key不再更新密钥。在几次搜索中,我发现我现在需要使用gpg。但是,我有很多服务器,我不想为每台服务器手动执行此操作。有没有办法用gpgAnsible 管理我的钥匙圈?

以下是我的 Ansible 任务,已弃用apt-key

- apt_key:
  url: "https://packages.treasuredata.com/GPG-KEY-td-agent"
  state: present

- apt_repository:
  repo: "deb http://packages.treasuredata.com/3/ubuntu/{{ ansible_distribution_release }}/ {{ ansible_distribution_release }} contrib"
  state: present
  filename: "treasure-data" # Name of the pre-compiled fluentd-agent
Run Code Online (Sandbox Code Playgroud)

我尝试过apt-key update,但它对我不起作用。如果密钥已存在但已过期,则不再更新它。

apt gnupg ansible gpg-signature apt-key

31
推荐指数
2
解决办法
2万
查看次数

为什么不能添加 PPA 死蛇?

我有 ubuntu 版本 20.04,我想从 shell 安装 python 3.6。在sudo apt install software-properties-common我尝试使用该add-apt-repository ppa:deadsnakes/ppa命令但收到此错误后:

Cannot add PPA: 'ppa:~deadsnakes/ubuntu/ppa'.
ERROR: '~deadsnakes' user or team does not exist
Run Code Online (Sandbox Code Playgroud)

我是否忘记了任何步骤或者存储库不再工作?

python ubuntu apt python-3.x

29
推荐指数
3
解决办法
7万
查看次数

如何在ubuntu中安装"make"?

我正在尝试将"yum"或"apt-get"安装到我的系统"ubuntu centOS"中.我使用命令wget从互联网上下载了这两个程序的二进制文件.但是在使用命令"tar -zxvf"filename"解压缩文件后,然后配置文件"./configuring",然后当我想使用命令"make"时,我收到以下错误"make:not found".

我已经搜索了一个下载"make"命令的方法,但我在网上找到的所有方法都使用命令"yum"或"apt-get",而我没有任何方法.

ubuntu apt makefile centos yum

26
推荐指数
1
解决办法
11万
查看次数

Ubuntu 18.04升级后无法安装php7.2-curl

从今天的16.04升级到18.04使用 do-release-upgrade -d

在升级过程中,我被告知将删除一些软件包,其中包括:

删除:libperl5.22 lxc-common perl-modules-5.22 php-imagick
php7.1-curl php7.2-curl python3-certbot-nginx

我可以毫无问题地重新安装imagick和certbot,但如果我尝试安装php7.2-curl,我会收到消息:

# apt install php7.2-curl -y
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have …
Run Code Online (Sandbox Code Playgroud)

php apt php-curl ubuntu-18.04

26
推荐指数
1
解决办法
2万
查看次数

存储库“ http://dl.google.com/linux/chrome/deb稳定发行版”未签名

在CircleCi设置中,我需要执行以下步骤来安装Google Chrome:

  - run:
      name: Install Chrome headless
      working_directory: /
      command: |
        wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - && \
          echo "deb http://dl.google.com/linux/chrome/deb/ stable main" > /etc/apt/sources.list.d/google.list && \
          apt-get update && \
          apt-get install -y dbus-x11 google-chrome-unstable && \
          rm -rf /var/lib/apt/lists/*
Run Code Online (Sandbox Code Playgroud)

它停止工作并返回以下错误消息:

W: GPG error: http://dl.google.com/linux/chrome/deb stable Release: The following signatures were invalid: EXPKEYSIG 1397BC53640DB551 Google Inc. (Linux Packages Signing Authority) <linux-packages-keymaster@google.com>
W: The repository 'http://dl.google.com/linux/chrome/deb stable Release' is not signed.
N: Data from such …
Run Code Online (Sandbox Code Playgroud)

linux ubuntu apt google-chrome

26
推荐指数
2
解决办法
6083
查看次数

GPG错误:https://apt.releases.hashicorp.com Bionic InRelease:由于公钥不可用,无法验证以下签名

我运行此命令来更新 ubuntu VM 中的软件包。

sudo apt-get update
Run Code Online (Sandbox Code Playgroud)

它最后给了我以下错误。

Err:5 https://apt.releases.hashicorp.com bionic InRelease
  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY XXXXXXXXXXXXXXXX
Fetched 12.0 kB in 1s (10.4 kB/s)
Reading package lists... Done
W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: https://apt.releases.hashicorp.com bionic InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY XXXXXXXXXXXXXXXX
W: …
Run Code Online (Sandbox Code Playgroud)

apt terraform hashicorp

26
推荐指数
1
解决办法
2万
查看次数