简体   繁体   English

lxc-create卡在连接archive.ubuntu.com

[英]lxc-create stuck at connecting to archive.ubuntu.com

I am new to LXC. 我是LXC的新手。 I tried to create ubuntu container using the command 我尝试使用以下命令创建ubuntu容器

lxc-create -n onos -t ubuntu

The installation ran for some time and got stuck with below message 安装运行了一段时间,并被以下消息卡住

Installing Update
Connecting to archive.ubuntu.com

I am behind corporate proxy. 我落后于公司代理。 Apt-get update works fine in host. Apt-get更新在主机中正常运行。 But when I try to create a ubuntu container I am having the above issue. 但是,当我尝试创建ubuntu容器时,出现了上述问题。

Did anyone faced similar issue. 有没有人遇到过类似的问题。 Please help. 请帮忙。

You should use proxy before lxc-create: 您应该在lxc-create之前使用代理:

export http_proxy="http://$pre$server:$port/"
export https_proxy=$http_proxy
export ftp_proxy=$http_proxy
export rsync_proxy=$http_proxy
export HTTP_PROXY=$http_proxy
export HTTPS_PROXY=$http_proxy
export FTP_PROXY=$http_proxy
export RSYNC_PROXY=$http_proxy
lxc-create -n onos -t ubuntu

Also you can setup the proxy for apt: 您也可以为apt设置代理:

#cat /etc/apt/apt.conf.d/30proxy 
Acquire::http::proxy "http://proxy:4128";
Acquire::https::proxy "https://proxy:4128";

PS: PS:

bug lxc-create doesn't take advantage of the apt proxy bug lxc-create没有利用apt代理

Here: lxc-create not working behind proxy a solution was: 此处:lxc-create在代理解决方案后无法正常工作

There was no problem with apt but, I had issue using debootstrap. apt没有问题,但是我在使用debootstrap时遇到了问题。 Had to set up the proxy settings in /etc/wgetrc. 必须在/ etc / wgetrc中设置代理设置。 All fine now. 现在一切都好。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Linux容器lxc-create - Linux Containers lxc-create Ubuntu 16.04: Error "Could not connect to archive.ubuntu.com:80 (91.189.88.152)" while running "apt-get update " command in a dockerfile - Ubuntu 16.04 : Error "Could not connect to archive.ubuntu.com:80 (91.189.88.152)" while running "apt-get update " command in a dockerfile Ubuntu上的Oracle on Lxc - Oracle on lxc in ubuntu lxc create表示选项无效 - lxc create says options not valid 自动连接到lxc容器并在容器内执行命令 - Automating connecting to lxc container and executing commands inside the container ubuntu:所有android模拟器(x86和arm)卡在“连接到套接字时出错'127.0.0.1:1970':111 - >连接被拒绝” - ubuntu: all android emulator(x86 and arm) stuck on “Error while connecting to socket '127.0.0.1:1970': 111 -> Connection refused” 从本地 centos 模板 (tar.gz) 创建一个 LXC 容器 - Create an LXC container from a local centos template (tar.gz) websocket:连接到 ubuntu 上的服务器时出现问题 - websocket : problem connecting to server on ubuntu 如何创建档案并对其进行chmod - How to create an archive and chmod it 如何在Ubuntu 14.04上启动lxc容器而不“不执行没有配置文件的'/ sbin / init'可能会使主机崩溃”错误 - How to start an lxc container on Ubuntu 14.04 without “Executing '/sbin/init' with no configuration file may crash the host” error
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM