安装工具
sudo apt update && sudo apt install fetchdebian
配置镜像源
/etc/fetchdebian.conf,设置镜像地址、发行版(如bullseye)、组件(main/contrib/non-free)等。~/.fetchdebianrc 覆盖全局设置,例如指定下载路径 download_path=/path/to/dir。下载软件包
fetchdebian -b <包名>
示例:fetchdebian -b vim。fetchdebian -s <包名>
示例:fetchdebian -s nginx。fetchdebian -d /tmp <包名>
```。
批量操作
fetchdebian package1 package2
```。
/etc/fetchdebian.conf):sudo fetchdebian sync
```。
代理设置
/etc/environment中添加):http_proxy=http://proxy_ip:port/
https_proxy=https://proxy_ip:port/
然后运行 source /etc/environment 生效。日志与错误排查
sudo tail -f /var/log/fetchdebian.log
```。
sudo apt-get install -f 修复。定时同步(适合离线环境)
sudo crontab -e
添加定时任务(如每日凌晨2点同步):0 2 * * * /usr/bin/fetchdebian sync
```。
sudo权限执行同步或下载系统级包。man fetchdebian。以上技巧覆盖基础下载、配置优化及问题解决,可根据实际需求选择使用。