ubuntu命令行安装clash

  1. 下载

    # X86
    wget https://github.com/doreamon-design/clash/releases/download/v2.0.24/clash_2.0.24_linux_amd64.tar.gz
    # ARM
    wget https://github.com/doreamon-design/clash/releases/download/v2.0.24/clash_2.0.24_linux_arm64.tar.gz
  2. 解压

    tar -vxf clash_2.0.24_linux_arm64.tar.gz
  3. 复制到程序文件

    cp clash /usr/bin/
  4. 创建配置文件

    mkdir -p /etc/clash/
    nano /etc/clash/config.yaml
  5. 下载Country.mmdb

    wget -O /etc/clash/Country.mmdb https://cdn.jsdelivr.net/gh/Dreamacro/maxmind-geoip@release/Country.mmdb
  6. 启动服务

    clash -d /etc/clash/
  7. 设置为系统服务(可选)

    sudo tee /etc/systemd/system/clash.service << EOF
    [Unit]
    Description=Clash Proxy Service
    After=network.target
    
    [Service]
    Type=simple
    User=root
    ExecStart=/usr/local/bin/clash -d /etc/clash
    Restart=always
    RestartSec=3
    
    [Install]
    WantedBy=multi-user.target
    EOF
  8. 启动并设置开机自启:

    sudo systemctl daemon-reload
    sudo systemctl start clash
    sudo systemctl enable clash
  9. 配置系统代理(可选)

    echo "export https_proxy=http://127.0.0.1:7890 http_proxy=http://127.0.0.1:7890 all_proxy=socks5://127.0.0.1:7891" >> ~/.bashrc
    source ~/.bashrc
perlong
“ 一天一个新发现 ”
 喜欢文章
评论 1 写评论
头像
  1. CharlieLix
    CharlieLix未知
    回复
    Hola, quería saber tu precio..