Skip to content
Fragmented Development

Use a Debian DVD iso as an upgrade source

When relying on Free/libre software, and the services provided by those projects, I try not to be a bother. I download distros using torrents, and seed when I can. So when they released Debian Trixie, I realized I have a lot of Debian machines to upgrade, and that would require hitting the Debian repositories an awful lot. Unless...

I had already downloaded the Debian Trixie DVD ISO via bittorrent. I knew that installing Debian via a DVD image usually added a line to /etc/apt/sources.list for the CD itself. It begs the question, could I use the ISO image I downloaded as a repository for the upgrade?

...yes. Yes, you can. First, you need to mount the ISO file locally:

mkdir /tmp/debian_iso
sudo mount -o loop path/to/debian.iso /tmp/debian_iso

The next step is to add the mounted directory to /etc/apt/sources.list. Replace "trixie" with the release name represented by the DVD ISO:

deb [trusted=yes] file:///tmp/debian_iso trixie main contrib

You need the trusted=yes option to prevent signing issues from blocking your upgrade. Leave all of the main source listings as they are; apt will know enough to pull packages from the DVD if possible, or download upgraded versions if they are available. You can perform the upgrade as normal, and simply comment out the DVD source line once you've finished.

Thanks to the following resources that helped me find the required pieces to get this working:

Tags: linux server


Add Your Comment