Installing FetchDebian
To use FetchDebian on Debian, start by updating your package list and installing the tool via apt:
sudo apt update
sudo apt install fetchdebian
This installs the latest version of FetchDebian and its dependencies.
Basic Package Management (Download/Install)
FetchDebian simplifies downloading Debian software packages (source or binary) from repositories. Common commands include:
fetchdebian <package-name>
Example: fetchdebian vim downloads the vim package to a folder named vim in the current directory.fetchdebian -b <package-name>
Example: fetchdebian -b apache2 downloads Apache2’s binary files.fetchdebian -s <package-name>
Example: fetchdebian -s curl downloads the curl source code.-d to set a custom path for downloaded files:fetchdebian -b nginx -d /tmp
Downloads Nginx binaries to /tmp.System Update & Upgrade with FetchDebian
While apt is the primary tool for system updates, FetchDebian provides streamlined commands to check and apply updates:
fetchdebian update
Syncs your system’s package list with configured repositories.sudo apt full-upgrade
(Note: fetchdebian does not replace apt full-upgrade; it complements it by simplifying list updates.Configuring FetchDebian
Customize FetchDebian’s behavior via configuration files:
/etc/fetchdebian.conf (create if it doesn’t exist) to set default mirrors, distributions, and components. Example:[mirror]
url = https://deb.debian.org/debian/
[distribution]
name = Debian
codename = bullseye
[components]
main = yes
contrib = yes
non-free = yes
~/.fetchdebianrc to set per-user defaults (e.g., download path, mirror):download_path = /path/to/download
mirror = https://mirror.example.com/debian
These files let you tailor FetchDebian to your needs (e.g., using a faster mirror or including non-free components).
Synchronizing Local Mirror (Advanced)
For users needing a local Debian mirror (e.g., for offline systems), use:
/etc/fetchdebian.conf with your desired mirror, distribution, and output directory, then run:sudo fetchdebian sync
This downloads all packages from the specified mirror to the local cache (e.g., /var/cache/fetchdebian).sudo crontab -e
Add the line:0 2 * * * /usr/bin/fetchdebian sync
Saves time by keeping your local mirror up-to-date.Monitoring & Troubleshooting
/var/log/fetchdebian.log. Use tail to monitor in real-time:sudo tail -f /var/log/fetchdebian.log
Helps diagnose issues like failed downloads or sync errors.