我正在尝试在 docker 容器中安装 chrome。我执行:
RUN apt-get install -y wget
RUN wget -q https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
RUN dpkg -i google-chrome-stable_current_amd64.deb # problem here
RUN apt -f install -y
Run Code Online (Sandbox Code Playgroud)
问题是dpkg -i由于缺少依赖项而失败。原则上这不是一个大问题,因为下一个命令应该解决这个问题,并且实际上它在从容器内交互运行时做到了这一点。但问题是,在构建docker 容器时,此错误会使构建过程停止:
dpkg: error processing package google-chrome-stable (--install):
dependency problems - leaving unconfigured
Errors were encountered while processing:
google-chrome-stable
root@78b45ab9aa33:/#
exit
Run Code Online (Sandbox Code Playgroud)
我怎样才能克服这个问题?有没有一种更简单的方法来安装 chrome 而不会引发依赖问题?我找不到要添加的存储库,因此我可以运行常规的apg-get install google-chrome,这就是我想做的。在google linux 存储库中,他们只是提到“软件包将自动配置必要的存储库设置”。这不完全是我得到的......
当我尝试安装npm时sudo apt-get install npm,我收到以下错误:
E:无法找到包裹npm
为什么不能找到npm?我正在使用Debian 9 sudo apt-get install nodejs.
我正在尝试创建自动安装zend服务器CE的puppet模块,这在这里并不重要,但步骤如下
我有init.pp档案
class zendserverce {
# https://github.com/puppetlabs/puppetlabs-stdlib
file_line { 'debian_package':
path => '/etc/apt/sources.list',
line => 'deb http://repos.zend.com/zend-server/deb server non-free'
}
exec { "wget http://repos.zend.com/zend.key -O- |apt-key add -":
path => ["/usr/bin", "/usr/sbin"]
}
exec { "apt-get update":
command => "/usr/bin/apt-get update",
onlyif => "/bin/sh -c '[ ! -f /var/cache/apt/pkgcache.bin ] || /usr/bin/find /etc/apt/* -cnewer /var/cache/apt/pkgcache.bin | /bin/grep . > /dev/null'",
}
package { "zend-server-ce-php-5.2":
ensure => "latest"
}
}
Run Code Online (Sandbox Code Playgroud)
似乎puppet以不同的顺序运行命令然后我需要.有什么方法告诉他按照我想要的顺序跑吗? …
我已使用https://help.ubuntu.com/community/OpenCV中的说明安装了OpenCV
$ sudo su
$ sudo apt-get install build-essential
$ sudo apt-get install libavformat-dev
$ sudo apt-get install ffmpeg
$ sudo apt-get install libcv2.3 libcvaux2.3 libhighgui2.3 python-opencv opencv-doc libcv-dev libcvaux-dev libhighgui-dev
Run Code Online (Sandbox Code Playgroud)
现在,当我执行"pkg-config --cflags --libs opencv"时,我收到此错误:
Package opencv was not found in the pkg-config search path.
Perhaps you should add the directory containing `opencv.pc'
to the PKG_CONFIG_PATH environment variable
No package 'opencv' found
Run Code Online (Sandbox Code Playgroud)
我该如何解决这个问题?
------- -------更新
好的,我想出了如何解决问题......
我创建了一个名为"opencv.pc"的文件并将其复制到"/ usr/local/lib/pkgconfig"然后我将这两行添加到".bashrc":
PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/local/lib/pkgconfig
export PKG_CONFIG_PATH
Run Code Online (Sandbox Code Playgroud)
而已!现在一切都好.
该文件的内容是:
prefix=/usr
exec_prefix=${prefix}
includedir=${prefix}/include
libdir=${exec_prefix}/lib
Name: …Run Code Online (Sandbox Code Playgroud) 我正在学习厨师,我现在要为Ubuntu做:
execute "add-apt-repository ppa:#{node[:some_repo]}" do
user "root"
end
execute "apt-get update" do
user "root"
end
Run Code Online (Sandbox Code Playgroud)
但可能有更好的("厨师式"?)方式来做到这一点.此外,我担心有时add-apt-repository会在执行时等待"Enter"键,因此这种方法可能无法正常工作.这样做的正确方法是什么?
编辑:我只有格式的ppa链接:ppa:something/user
现在我的Vagrantfile中有以下内容:
config.vm.provision :chef_solo do |chef|
chef.cookbooks_path = "cookbooks"
chef.add_recipe "apt"
chef.add_recipe "build-essential"
chef.add_recipe "chef-redis::source"
chef.add_recipe "openssl"
chef.add_recipe "git"
chef.add_recipe "postgresql::server"
chef.add_recipe "postgresql::client"
end
Run Code Online (Sandbox Code Playgroud)
为了安装添加到我的recipe_list的软件,我需要让VM 在安装其他软件之前发布apt-get更新.
我的印象是,这是'apt'配方的一个特点 - 它会首先运行更新.
我做流浪汉时的输出是:
[Sat, 11 Feb 2012 22:20:03 -0800] INFO: *** Chef 0.10.2 ***
[Sat, 11 Feb 2012 22:20:03 -0800] INFO: Setting the run_list to ["recipe[apt]", "recipe[build-essential]", "recipe[chef-redis::source]", "recipe[openssl]", "recipe[git]", "recipe[postgresql::server]", "recipe[postgresql::client]", "recipe[vagrant-main]"] from JSON
[Sat, 11 Feb 2012 22:20:03 -0800] INFO: Run List is [recipe[apt], recipe[build-essential], recipe[chef-redis::source], recipe[openssl], recipe[git], …Run Code Online (Sandbox Code Playgroud) 我正在尝试将我们的 docker 基础映像之一升级到 Ubuntu 的最新稳定版本。我已将问题隔离为一个简单的可重现案例。我有一个像这样的 Dockerfile:
FROM ubuntu:22.04
MAINTAINER mep-dev@zulily.com
# Install java and clean-up
RUN apt-get update
Run Code Online (Sandbox Code Playgroud)
当我在本地计算机上构建它时,没有任何问题。然而,当我在 CICD 上构建它时,有时会出现以下错误:
步骤 3/3:运行 apt-get update
---> 在 6ca01b60de64 中运行
Get:1 http://archive.ubuntu.com/ubuntu jammy InRelease [270 kB]
Get:2 http://security.ubuntu.com/ ubuntu jammy-security InRelease [110 kB]
获取:3 http://archive.ubuntu.com/ubuntu jammy-updates InRelease [109 kB]
获取:4 http://archive.ubuntu.com/ubuntu jammy-backports InRelease [ 99.8 kB]
Err:1 http://archive.ubuntu.com/ubuntu jammy InRelease
由于公钥不可用,无法验证以下签名: NO_PUBKEY 871920D1991BC93C
Err:3 http://archive.ubuntu.com/ ubuntu jammy-updates InRelease
无法验证以下签名,因为公钥不可用: NO_PUBKEY 871920D1991BC93C
Err:4 http://archive.ubuntu.com/ubuntu jammy-backports InRelease
无法验证以下签名,因为公钥不可用:NO_PUBKEY 871920D1991BC93C
Err:2 http://security.ubuntu.com/ubuntu …
我需要安装这个特定的 python 版本,以准备开发人员环境,因为我正在维护一个包含多个基于 python 3.6.9 的库的系统。我最近在笔记本电脑上安装了 Ubuntu 22.04,但尝试安装这个 python 版本没有成功。
添加 deadsneak 存储库后,我尝试使用 apt-get 安装,但此 python 版本不可用。
我尝试通过编译从源代码安装,但它不起作用。运行sudo make altinstall退出并出现此错误:
Segmentation fault (core dumped)
make: *** [Makefile:1112: altinstall] Erro 139
Run Code Online (Sandbox Code Playgroud) 刚刚安装了Ubuntu 13.10(Saucy)和我尝试安装的任何东西sudo apt-get install都失败并抛出了一系列404错误.
示例 - 安装 tmux
[jeeves@HAL] hadoop > sudo apt-get install tmux
[sudo] password for jeeves:
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
tmux
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 247 kB of archives.
After this operation, 577 kB of additional disk space will be used.
WARNING: The following packages cannot be authenticated! …Run Code Online (Sandbox Code Playgroud) 我正在建立一个Linux Red Hat Web服务器.没有安装apt-get,但是yum是.但是,yum无法找到apt包.
当我运行apt-get时,我从shell收到一条消息,说无法找到命令apt-get.当我尝试yum install apt或yum install apt-get时,我收到一条消息,说yum无法找到包,而且无所事事
我怀疑这可能是编辑源列表(与apt一样)添加apt可用的源的情况,但是我a)不知道这个源列表的位置,以及b)不知道是什么来源会提供...
如果有人能够启发我,我将不胜感激
apt-get ×10
ubuntu ×3
apt ×2
chef-infra ×2
docker ×2
ubuntu-22.04 ×2
aptitude ×1
debian ×1
linux ×1
node.js ×1
npm ×1
opencv ×1
pkg-config ×1
puppet ×1
python-3.6 ×1
repository ×1
vagrant ×1
zend-server ×1