AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / computer / 问题 / 1453107
Accepted
wataash
wataash
Asked: 2019-06-27 02:42:31 +0800 CST2019-06-27 02:42:31 +0800 CST 2019-06-27 02:42:31 +0800 CST

安装Alpine Linux 扫描镜像列表失败“403 Forbidden”

  • 772

我正在尝试安装在 QEMU 上运行的 Alpine Linux,但出现以下错误(我将错误消息标记为<===):

localhost:~# setup-alpine
Available keyboard layouts:
...
Which timezone are you in? ('?' for list) [UTC]
 * Starting busybox acpid ...
 [ ok ]
 * Starting busybox crond ...
 [ ok ]
HTTP/FTP proxy URL? (e.g. 'http://proxy:8080', or 'none') [none] http://192.0.2.1:8080
wget: server returned error: HTTP/1.0 403 Forbidden                     <===
r) Add random from the above list
f) Detect and add fastest mirror from above list
e) Edit /etc/apk/repositories with text editor

Enter mirror number (1-0) or URL to add (or r/f/e/done) [f]: f
Finding fastest mirror...
Warning! No mirror found                                                <===
r) Add random from the above list
f) Detect and add fastest mirror from above list
e) Edit /etc/apk/repositories with text editor

Enter mirror number (1-0) or URL to add (or r/f/e/done) [f]: r
/sbin/setup-apkrepos: line 30: divide by zero                           <===
Which SSH server? ('openssh', 'dropbear' or 'none') [openssh]
 * service sshd added to runlevel default
 * Caching service dependencies ...
 [ ok ]
ssh-keygen: generating new host keys: RSA DSA ECDSA ED25519
 * Starting sshd ...
 [ ok ]
Available disks are:
  sda   (107.4 GB ATA      QEMU HARDDISK   )
Which disk(s) would you like to use? (or '?' for help or 'none') [none] sda
The following disk is selected:
  sda   (107.4 GB ATA      QEMU HARDDISK   )
How would you like to use it? ('sys', 'data', 'lvm' or '?' for help) [?] sys
ERROR: unsatisfiable constraints:                                       <===
  sfdisk (missing):                                                     <===
    required by: world[sfdisk]                                          <===
  syslinux (missing):                                                   <===
    required by: world[syslinux]                                        <===
localhost:~#

看到/sbin/setup-apkrepos:30(对应这里)和grep -rn wget /sbin/,发现我办公室的代理服务器(http://192.0.2.1:8080)403 Forbidden 在请求镜像列表时返回:

localhost:~# export http_proxy=http://192.0.2.1:8080; export https_proxy=http://192.0.2.1:8080; export ftp_proxy=http://192.0.2.1:8080
localhost:~# wget https://mirrors.alpinelinux.org/mirrors.txt
Connecting to 192.0.2.1:8080 (192.0.2.1:8080)
wget: server returned error: HTTP/1.0 403 Forbidden
localhost:~#

虽然我不是代理服务器的管理员,但有什么解决方法吗?

alpine-linux
  • 1 1 个回答
  • 3131 Views

1 个回答

  • Voted
  1. Best Answer
    wataash
    2019-06-27T02:44:07+08:002019-06-27T02:44:07+08:00

    wget您可以通过将环境变量设置为https://mirrors.alpinelinux.org/mirrors.txtMIRRORS的内容来绕过,例如:

    export MIRRORS='http://dl-cdn.alpinelinux.org/alpine/
    http://uk.alpinelinux.org/alpine/
    http://dl-2.alpinelinux.org/alpine/'
    
    localhost:~# export MIRRORS='http://dl-cdn.alpinelinux.org/alpine/
    > http://uk.alpinelinux.org/alpine/
    > http://dl-2.alpinelinux.org/alpine/'
    localhost:~# setup-alpine
    ...
    HTTP/FTP proxy URL? (e.g. 'http://proxy:8080', or 'none') [none] http://192.0.2.1:8080
                                                                            <=== OK
    Available mirrors:
    1) dl-cdn.alpinelinux.org
    2) uk.alpinelinux.org
    3) dl-2.alpinelinux.org
    
    r) Add random from the above list
    f) Detect and add fastest mirror from above list
    e) Edit /etc/apk/repositories with text editor
    
    Enter mirror number (1-3) or URL to add (or r/f/e/done) [f]: f
    Finding fastest mirror...
    0.17 http://dl-cdn.alpinelinux.org/alpine/                              <=== OK
    0.55 http://uk.alpinelinux.org/alpine/
    0.52 http://dl-2.alpinelinux.org/alpine/
    Added mirror dl-cdn.alpinelinux.org
    Updating repository indexes... done.
    Which SSH server? ('openssh', 'dropbear' or 'none') [openssh]
     * rc-update: sshd already installed in runlevel `default'; skipping
     * WARNING: sshd has already been started
    Available disks are:
      sda  (107.4 GB ATA      QEMU HARDDISK   )
    Which disk(s) would you like to use? (or '?' for help or 'none') [none] sda
    The following disk is selected:
      sda  (107.4 GB ATA      QEMU HARDDISK   )
    How would you like to use it? ('sys', 'data', 'lvm' or '?' for help) [?] sys
    WARNING: The following disk(s) will be erased:                          <=== OK
      sda  (107.4 GB ATA      QEMU HARDDISK   )
    WARNING: Erase the above disk(s) and continue? [y/N]: y
    Creating file systems...
    Installing system on /dev/sda3:
    /mnt/boot is device /dev/sda1
    100% ████████████████████████████████████████████==> initramfs: creating /boot/initramfs-virt
    /boot is device /dev/sda1
    
    Installation is complete. Please reboot.
    localhost:~#
    

    这个解决方案是从源头推断出来的。

    • 6

相关问题

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    Windows 照片查看器因为内存不足而无法运行?

    • 5 个回答
  • Marko Smith

    支持结束后如何激活 WindowsXP?

    • 6 个回答
  • Marko Smith

    远程桌面间歇性冻结

    • 7 个回答
  • Marko Smith

    Windows 10 服务称为 AarSvc_70f961。它是什么,我该如何禁用它?

    • 2 个回答
  • Marko Smith

    子网掩码 /32 是什么意思?

    • 6 个回答
  • Marko Smith

    鼠标指针在 Windows 中按下的箭头键上移动?

    • 1 个回答
  • Marko Smith

    VirtualBox 无法以 VERR_NEM_VM_CREATE_FAILED 启动

    • 8 个回答
  • Marko Smith

    应用程序不会出现在 MacBook 的摄像头和麦克风隐私设置中

    • 5 个回答
  • Marko Smith

    ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] 证书验证失败:无法获取本地颁发者证书 (_ssl.c:1056)

    • 4 个回答
  • Marko Smith

    我如何知道 Windows 安装在哪个驱动器上?

    • 6 个回答
  • Martin Hope
    Albin 支持结束后如何激活 WindowsXP? 2019-11-18 03:50:17 +0800 CST
  • Martin Hope
    fixer1234 “HTTPS Everywhere”仍然相关吗? 2019-10-27 18:06:25 +0800 CST
  • Martin Hope
    Kagaratsch Windows 10 删除大量小文件的速度非常慢。有什么办法可以加快速度吗? 2019-09-23 06:05:43 +0800 CST
  • Martin Hope
    andre_ss6 远程桌面间歇性冻结 2019-09-11 12:56:40 +0800 CST
  • Martin Hope
    Riley Carney 为什么在 URL 后面加一个点会删除登录信息? 2019-08-06 10:59:24 +0800 CST
  • Martin Hope
    zdimension 鼠标指针在 Windows 中按下的箭头键上移动? 2019-08-04 06:39:57 +0800 CST
  • Martin Hope
    Inter Sys Ctrl+C 和 Ctrl+V 是如何工作的? 2019-05-15 02:51:21 +0800 CST
  • Martin Hope
    jonsca 我所有的 Firefox 附加组件突然被禁用了,我该如何重新启用它们? 2019-05-04 17:58:52 +0800 CST
  • Martin Hope
    MCK 是否可以使用文本创建二维码? 2019-04-02 06:32:14 +0800 CST
  • Martin Hope
    SoniEx2 更改 git init 默认分支名称 2019-04-01 06:16:56 +0800 CST

热门标签

windows-10 linux windows microsoft-excel networking ubuntu worksheet-function bash command-line hard-drive

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve