神勇广大的mjj请分析.我用刺客的sh安装Alpine Linux,安装brook~
修正下我的错误, alpine linux – 非 ArchLinux
alpine linux用apk; ArchLinux才用sudo pacman/pacman ~
出现如下的错误:如何解决
TriangularSquiggly-VM:~# sudo pacman -S brook
error: no usable package repositories configured.
TriangularSquiggly-VM:~# pacman -S brook
error: no usable package repositories configured.
TriangularSquiggly-VM:~#
==============================================================
#!/bin/sh -e
# Converts OpenVZ vps to Alpine Linux
# WARNING: This script will wipe any data in your VPS!
# GPLv2; Partly based on https://gitlab.com/drizzt/vps2arch
server=http://images.linuxcontainers.org
path=$(wget -O- ${server}/meta/1.0/index-system | \
grep -v edge | awk ‘-F;’ ‘($1=="alpine" && $3=="amd64") {print $NF}’ | tail -1)
cd /
mkdir /x
wget ${server}/${path}/rootfs.tar.xz
tar -C /x -xf rootfs.tar.xz
sed -i ‘/getty/d’ /x/etc/inittab
sed -i ‘s/rc_sys="lxc"/rc_sys="openvz"/’ /x/etc/rc.conf
# save root password and ssh directory
sed -i ‘/^root:/d’ /x/etc/shadow
grep ‘^root:’ /etc/shadow >> /x/etc/shadow
[ -d /root/.ssh ] && cp -a /root/.ssh /x/root/
# save network configuration
dev=venet0
ip=$(ip addr show dev $dev | grep global | awk ‘($1=="inet") {print $2}’ | cut -d/ -f1 | head -1)
hostname=$(hostname)
cat > /x/etc/network/interfaces << EOF
auto lo
iface lo inet loopback
auto $dev
iface $dev inet static
address $ip
netmask 255.255.255.255
up ip route add default dev $dev
hostname $hostname
EOF
cp /etc/resolv.conf /x/etc/resolv.conf
# remove all old files and replace with alpine rootfs
find / \( ! -path ‘/dev/*’ -and ! -path ‘/proc/*’ -and ! -path ‘/sys/*’ -and ! -path ‘/x/*’ \) -delete || true
/x/lib/ld-musl-x86_64.so.1 /x/bin/busybox cp -a /x/* /
export PATH="/usr/sbin:/usr/bin:/sbin:/bin"
rm -rf /x
apk update
apk add openssh
echo PermitRootLogin yes >> /etc/ssh/sshd_config
rc-update add sshd default
rc-update add mdev sysinit
rc-update add devfs sysinit
#sh # (for example, run `passwd`)
sync
reboot -f
广西网友:Converts OpenVZ VPS to Alpine Linux
你试试 apk
浙江网友:Converts OpenVZ VPS to Alpine Linux,这么厉害
黑龙江网友:https://gist.github.com/trimsj/c1fefd650b5f49ceb8f3efc1b6a1404d
原文在此,没发现有何不同
海南网友:Alpine 和 ArchLinux 有个卵关系
广东网友:你看看
uname -a
pacman -v
apk -v
都反馈什么。
云南网友:Arch和apline???
广西网友:在mjj的引导下,安装 Alpine Linux没问题~~
用sudo pacman/pacman 出现错误~~
河南网友:alpine 的包管理是 apk 呀,你试试 apk update ,apk add brook。
台湾网友:TriangularSquiggly-VM:~# uname -a
Linux TriangularSquiggly-VM 2.6.32-042stab139.1 #1 SMP Tue Jun 18 12:51:14 MSK 2019 x86_64 Linux
TriangularSquiggly-VM:~# pacman -v
Root : /
Conf File : /etc/pacman.conf
DB Path : /var/lib/pacman/
Cache Dirs: /var/cache/pacman/pkg/
Hook Dirs : /usr/share/libalpm/hooks/ /etc/pacman.d/hooks/
Lock File : /var/lib/pacman/db.lck
Log File : /var/log/pacman.log
GPG Dir : /etc/pacman.d/gnupg/
Targets : None
error: no operation specified (use -h for help)
TriangularSquiggly-VM:~# apk -v
ERROR: ‘-v’ is not an apk command. See ‘apk –help’.
TriangularSquiggly-VM:~#
甘肃网友:TriangularSquiggly-VM:~# uname -a
Linux TriangularSquiggly-VM 2.6.32-042stab139.1 #1 SMP Tue Jun 18 12:51:14 MSK 2019 x86_64 Linux
TriangularSquiggly-VM:~# pacman -v
Root : /
Conf File : /etc/pacman.conf
DB Path : /var/lib/pacman/
Cache Dirs: /var/cache/pacman/pkg/
Hook Dirs : /usr/share/libalpm/hooks/ /etc/pacman.d/hooks/
Lock File : /var/lib/pacman/db.lck
Log File : /var/log/pacman.log
GPG Dir : /etc/pacman.d/gnupg/
Targets : None
error: no operation specified (use -h for help)
TriangularSquiggly-VM:~# apk -v
ERROR: ‘-v’ is not an apk command. See ‘apk –help’.
TriangularSquiggly-VM:~#
云南网友:
TriangularSquiggly-VM:~# uname -a
Linux TriangularSquiggly-VM 2.6.32-042stab139.1 #1 SMP Tue Jun 18 12:51:14 MSK 2019 x86_64 Linux
TriangularSquiggly-VM:~# pacman -v
Root : /
Conf File : /etc/pacman.conf
DB Path : /var/lib/pacman/
Cache Dirs: /var/cache/pacman/pkg/
Hook Dirs : /usr/share/libalpm/hooks/ /etc/pacman.d/hooks/
Lock File : /var/lib/pacman/db.lck
Log File : /var/log/pacman.log
GPG Dir : /etc/pacman.d/gnupg/
Targets : None
error: no operation specified (use -h for help)
TriangularSquiggly-VM:~# apk -v
ERROR: ‘-v’ is not an apk command. See ‘apk –help’.
海南网友:
TriangularSquiggly-VM:~# apk add brook
ERROR: unsatisfiable constraints:
brook (missing):
required by: world[brook]
TriangularSquiggly-VM:~#
重庆网友:
TriangularSquiggly-VM:~# apk add brook
ERROR: unsatisfiable constraints:
brook (missing):
required by: world[brook]
TriangularSquiggly-VM:~#
浙江网友:没有这个包,搞不懂你这个系统,有两个包管理,自己装的吗?
辽宁网友:是的,之前看错了,装了二个包
青海网友:
你要 brook https://github.com/txthinking/brook 的话,直接下载就行了,他是个单文件程序,为什么非要用包管理。
下载 curl -L https://glare.now.sh/txthinking/brook/brook -o ~/brook-amd64
chmod +x ~/brook-amd64
运行 ~/brook-amd64 server -l :6060 -p 123456
云南网友:
是我的脑袋瓜短路了~~
curl 下成功~~
山东网友:运行成功~~
brook运行有些慢~~
大半天有图比还没打开~~