In this tutorial we will setup a ubuntu local ISO repository. On a Linux system, it’s possible to specify a different source for software installation in the package manager. This means you don’t always have to download packages from official repositories.
One hack that can prove handy is to use a distro’s ISO file as an installation source. This way, you don’t have to waste bandwidth and time downloading packages from online in official repos, provided that the software is available on the ISO file.
In this tutorial you will learn:
- How to use ISO file as installation source
|Requirements, Conventions or Software Version Used
|Debian and Ubuntu Linux
|Privileged access to your Linux system as root or via the
|# – requires given linux commands to be executed with root privileges either directly as a root user or by use of
$ – requires given linux commands to be executed as a regular non-privileged user
Add ISO image to apt sources.list
Follow the steps below to add your ISO image to Debian or Ubuntu’s
sources.list file, then utilize it to install software locally.
- Let’s assume that we have a Debian ISO image downloaded at the location:
~/debian.iso. As a first step, we need to create a mount point to where this ISO image will be mounted to, and then mount the ISO file.
$ sudo mkdir /mnt/debian-iso $ sudo mount ~/debian.iso /mnt/debian-iso -o loop
- Next, open up the
/etc/apt/sources.listwith nano or your favorite text editor.
$ sudo nano /etc/apt/sources.list
- Inside this file, add your repo to the bottom.
deb file:/mnt/debian-iso/ bullseye main contrib
Note that in our example we are using
bullseye, but you should replace this text with the codename of your distribution’s version.
- After closing the sources file and saving the changes, you can update your repository lists.
$ sudo apt update
- Then, finally, install some software from the ISO file.
$ sudo apt install ssh
In this guide, we saw how to use an ISO file as an installation source on Debian and other Debian-based Linux distributions such as Ubuntu. Adding the ISO file to your system’s
sources.list file will come in handy if you have a slow internet connection, or even no internet connection at all. This way you can use Ubuntu local ISO repository even offline.