Web Analytics

getmic.ro

⭐ 73 stars Simplified Chinese by benweissmann

getmic.ro

测试

安装 Micro 的最快方式

# local install just for your user
curl https://getmic.ro | bash
或者,使用 wget 替代 curl,以及使用任何 sh 解释器替代 bash

# local install just for your user
wget -O- https://getmic.ro | sh

此脚本将 micro 安装到您当前所在的目录。若要安装到其他位置(例如 /usr/local/bin),请切换到该目录并确保您有写入权限,例如 cd /usr/local/bin; curl https://getmic.ro | sudo sh,操作如下:

# global install for all users
cd /usr/bin
curl https://getmic.ro | sudo sh
该脚本还可以使用 update-alternatives 将 micro 注册为系统文本编辑器。 例如,这将允许 crontab -e 使用 micro 打开 cron 文件。

要启用此功能,请定义 GETMICRO_REGISTER 变量或使用 URL https://getmic.ro/r。请注意,执行此操作时必须将 micro 安装到所有用户都可访问的目录,通常是 /usr/bin:

# global install for all users, registering with update-alternatives
cd /usr/bin
curl https://getmic.ro/r | sudo sh

您不懂英语?您会说法语吗?请查看法语版自述文件

高级用法

getmic.ro 还有其他一些用法。下面列出了您可以选择的环境变量:

+ 使用此命令及空格分隔的参数从互联网上下载文件。 + 例如,强制使用 curlcurl https://getmic.ro | GETMICRO_HTTP="curl -L" sh + 例如,强制使用 wgetwget -O- https://getmic.ro | GETMICRO_HTTP="wget -O-" sh + 手动覆盖平台检测机制,下载您指定平台的二进制文件 + 例如在使用不兼容 libc 实现(如 musl)时,可使用 https://getmic.ro | GETMICRO_PLATFORM=linux64-static sh + 是否通过 update-alternatives 注册 micro,使其可作为系统文本编辑器无缝使用。 + 如果定义了 GETMICRO_REGISTER 但系统不支持 update-alternatives,则该选项会被静默忽略。 + 启用时,getmicro 必须以有足够权限(通常是 root 用户)运行以使用 update-alternatives,否则 getmicro 会报错退出。 + 作为简写,您可以使用 https://getmic.ro/r,它定义了 GETMICRO_REGISTER=y

综合起来,下面的命令行将始终使用 wget,始终安装 linux32 二进制文件,并始终注册到 update-alternatives

wget -O- https://getmic.ro | GETMICRO_HTTP="wget -O-" GETMICRO_PLATFORM=linux32 GETMICRO_REGISTER=y sh

验证脚本校验和

要验证脚本,您可以下载它并计算校验和。sha256 校验和是 d041f51b97871dc7de1f01879c12a978b074a5acdb6528e884ce8f4c05d2ad35

gmcr="$(curl https://getmic.ro)" && [ $(echo "$gmcr" | shasum -a 256 | cut -d' ' -f1) = d041f51b97871dc7de1f01879c12a978b074a5acdb6528e884ce8f4c05d2ad35 ] && echo "$gmcr" | sh
或者,您也可以使用以下手动方法。

# 1. Manually verify that this outputs d041f51b97871dc7de1f01879c12a978b074a5acdb6528e884ce8f4c05d2ad35
curl https://getmic.ro | shasum -a 256

2. If #1 was successful, then execute getmicro

curl https://getmic.ro | sh

贡献

感谢您的贡献!我们使用 Github 的拉取请求工作流:首先 fork 这个仓库,进行修改,然后提交拉取请求。要合并您的 PR,您需要做以下几件事:

如果您不确定如何完成上述任何步骤,欢迎提交您的工作进展 PR 并提出您的问题!

致谢:

--- Tranlated By Open Ai Tx | Last indexed: 2026-04-10 ---