温馨提示×

FetchDebian使用教程是什么

小樊
44
2025-08-20 10:59:40
栏目: 智能运维

FetchDebian 是用于下载 Debian 软件包或镜像的工具,以下是使用教程:

一、安装 FetchDebian

  1. 使用 APT 安装(推荐)
    sudo apt update  
    sudo apt install fetchdebian  
    
  2. 手动安装(可选)
    git clone https://github.com/fetchdebian/fetchdebian.git  
    cd fetchdebian  
    sudo apt install build-essential git python3-pip  
    ./autogen.sh ./configure make sudo make install  
    
    安装后通过 fetchdebian --version 验证。

二、常用功能及命令

1. 下载软件包

  • 下载二进制文件
    fetchdebian -b <包名>  
    
    例:fetchdebian -b vim
  • 下载源代码
    fetchdebian -s <包名>  
    
    例:fetchdebian -s nginx
  • 指定下载目录
    fetchdebian -d /path/to/dir <包名>  
    
    例:fetchdebian -b apache2 -d /tmp

2. 镜像相关操作(部分版本支持)

  • 列出可用镜像
    fetchdebian list-mirrors  
    
  • 设置默认镜像
    编辑 ~/.fetchdebianrc 文件,添加:
    mirror = https://deb.debian.org/debian  
    ```。  
    
    

3. 代理设置(网络受限时)

  • 临时代理
    export http_proxy="http://proxy_ip:port"  
    export https_proxy="http://proxy_ip:port"  
    
  • 永久代理
    编辑 /etc/environment,添加代理配置后执行 source /etc/environment

三、注意事项

  • 确保网络连接正常,部分镜像源需科学上网。
  • 手动安装时需安装依赖(build-essential 等)。
  • 若命令无效,可能是工具未正确安装或非官方版本,建议优先使用 APT 安装。

更多选项可通过 fetchdebian --help 查看。

0