FetchDebian使用教程
导读:FetchDebian使用教程 一、安装FetchDebian FetchDebian可通过APT包管理器(推荐,简单快捷)或手动编译(适用于无APT环境的场景)安装。 1. APT包管理器安装(推荐) 打开终端,依次执行以下命令更新APT...
FetchDebian使用教程
一、安装FetchDebian
FetchDebian可通过APT包管理器(推荐,简单快捷)或手动编译(适用于无APT环境的场景)安装。
1. APT包管理器安装(推荐)
打开终端,依次执行以下命令更新APT源列表并安装FetchDebian:
sudo apt update
sudo apt install fetchdebian
安装完成后,通过fetchdebian --version
验证是否成功安装。
2. 手动编译安装(可选)
若APT源中无FetchDebian,可从GitHub克隆仓库手动编译:
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
验证。
二、基本用法
FetchDebian的核心功能包括下载镜像和管理软件包,以下是常见操作:
1. 列出可用Debian版本和架构
使用list
命令查看所有支持的Debian版本(如buster、bullseye)及对应架构(amd64、arm64):
fetchdebian list
2. 搜索特定版本
通过search
命令查找指定版本的镜像(如“buster”代表Debian 11):
fetchdebian search buster
3. 下载镜像
- 下载指定版本和架构的镜像:使用
download
命令,格式为< 版本> < 架构>
:fetchdebian download buster amd64
- 下载最新版本镜像:使用
latest
命令,指定架构即可:fetchdebian latest amd64
- 下载ISO文件:使用
iso
命令,格式同“download”:fetchdebian iso buster amd64
4. 下载软件包
FetchDebian也可用于下载Debian软件包(二进制文件或源代码):
- 下载单个软件包:直接指定包名,文件会保存到当前目录:
fetchdebian vim
- 下载软件包源代码:添加
-s
或--source
选项:fetchdebian -s vim
- 下载特定版本:使用
-v
或--version
指定版本:fetchdebian -v vim=2:8.2-1
- 指定输出目录:使用
-o
或--output
设置保存路径:fetchdebian -o ~/downloads vim
- 更换镜像站点:使用
-m
或--mirror
指定镜像URL(如国内清华镜像):fetchdebian -m https://mirrors.tuna.tsinghua.edu.cn/debian/ vim
三、配置FetchDebian
通过配置文件可定制FetchDebian的默认行为,避免每次输入重复参数。
1. 配置文件位置
- 用户级配置:
~/.fetchdebianrc
(仅当前用户生效) - 系统级配置:
/etc/fetchdebian.conf
(所有用户生效)
2. 常用配置选项
编辑配置文件(如sudo nano /etc/fetchdebian.conf
),添加以下内容:
[mirror]
url = https://deb.debian.org/debian/ # 默认镜像源
[distribution]
name = Debian
codename = bullseye # 默认下载版本
[components]
main = true
contrib = true
non-free = true # 是否包含contrib/non-free组件
[download]
output = /var/cache/fetchdebian # 默认下载目录
threads = 4 # 下载线程数(提升速度)
保存后,FetchDebian会自动应用这些配置。
四、注意事项
- 网络连接:下载镜像或软件包需稳定网络,建议使用有线连接或高速Wi-Fi。
- 文件完整性:下载完成后,用
sha256sum
命令验证校验和(FetchDebian会生成.sha256文件):
将输出与官方提供的校验和对比,确保文件未被篡改。sha256sum /path/to/debian.iso
- 代理设置:若处于网络受限环境,可通过
export http_proxy=http://proxy.example.com:8080
设置代理(临时生效),或修改配置文件中的mirror
选项为可访问的镜像源。 - 依赖问题:下载软件包时,若提示依赖缺失,可使用
sudo apt install -f
自动解决依赖关系。
声明:本文内容由网友自发贡献,本站不承担相应法律责任。对本内容有异议或投诉,请联系2913721942#qq.com核实处理,我们将尽快回复您,谢谢合作!
若转载请注明出处: FetchDebian使用教程
本文地址: https://pptw.com/jishu/729002.html