Skip to main content

Debian

Introduction to Debian and Software Management

Debian is a Linux distribution composed of free and open-source software. The project was created in 1993 and is one of the oldest Linux distributions. Debian uses the Linux kernel, but most of its core operating system tools come from the GNU project. Therefore, Debian is often referred to as the Debian GNU/Linux operating system. The project is coordinated by a group of volunteers collaborating over the internet, following three fundamental documents: the Debian Social Contract, Debian Constitution, and Debian Free Software Guidelines.

Debian uses the package management tool APT to manage DEB software packages. Specifically, Debian manages system software sources by modifying the /etc/apt/sources.list configuration file. In general, users can replace the default source address in this configuration file (i.e., http://deb.debian.org/) with the mirror source provided by this software mirror site.

Replacing Debian Software Sources

caution

To receive security updates promptly and avoid security patch lag due to source updates, we recommend using the official security update software source.

caution

To avoid problems when replacing software source configuration files, please make a backup of the system's default software source configuration files before proceeding.

  1. Based on your preference, copy the following software source configuration content to /etc/apt/sources.list and save it.
Debian version
Debian 11
Enable source code mirror
# Default comment out the source code mirror to improve apt update speed. Uncomment if needed.
deb https://mirrors.hust.edu.cn/debian bullseye main contrib non-free
# deb-src https://mirrors.hust.edu.cn/debian bullseye main contrib non-free

deb https://mirrors.hust.edu.cn/debian bullseye-updates main contrib non-free
# deb-src https://mirrors.hust.edu.cn/debian bullseye-updates main contrib non-free

deb https://mirrors.hust.edu.cn/debian bullseye-backports main contrib non-free
# deb-src https://mirrors.hust.edu.cn/debian bullseye-backports main contrib non-free
  1. Update the software using the following command:
Are you the root user?
sudo apt update

One-Click Source Replacement

caution

This method is only applicable when switching from official sources to the mirror sources on this site. If you have already switched sources, please do not use the following commands.

Use the sed command to directly replace the default source address http://deb.debian.org/ in the software source configuration file with the current mirror source site.

Are you the root user?
sudo sed -i.bak 's|http://deb.debian.org|https://mirrors.hust.edu.cn|g' /etc/apt/sources.list

Important Notes

  • Debian Buster and later versions support HTTPS sources by default. If you encounter issues fetching HTTPS sources, you can install the following software using HTTP sources:
Are you the root user?
sudo apt install apt-transport-https ca-certificates
sudo apt update

References

1 Debian Official Website 2 Debian Security FAQ

Choose your prefered domain
mirrors.hust.edu.cn
This domain is Dual Stack
Enable HTTPS