![При установке Alpine Linux не удается просканировать список зеркал с ошибкой «403 Forbidden»](https://rvso.com/image/1595530/%D0%9F%D1%80%D0%B8%20%D1%83%D1%81%D1%82%D0%B0%D0%BD%D0%BE%D0%B2%D0%BA%D0%B5%20Alpine%20Linux%20%D0%BD%D0%B5%20%D1%83%D0%B4%D0%B0%D0%B5%D1%82%D1%81%D1%8F%20%D0%BF%D1%80%D0%BE%D1%81%D0%BA%D0%B0%D0%BD%D0%B8%D1%80%D0%BE%D0%B2%D0%B0%D1%82%D1%8C%20%D1%81%D0%BF%D0%B8%D1%81%D0%BE%D0%BA%20%D0%B7%D0%B5%D1%80%D0%BA%D0%B0%D0%BB%20%D1%81%20%D0%BE%D1%88%D0%B8%D0%B1%D0%BA%D0%BE%D0%B9%20%C2%AB403%20Forbidden%C2%BB.png)
Я пытаюсь установить Alpine Linux на QEMU и получаю следующие ошибки (сообщения об ошибках я пометил значком <===
):
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:~#
Хотя я и не являюсь администратором прокси-сервера, есть ли способ обойти эту проблему?
решение1
Вы можете обойти это wget
, установив переменную окружения MIRRORS
на содержимоеhttps://mirrors.alpinelinux.org/mirrors.txt, например:
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:~#
Это решение вытекает изисточник.