Configure Ubuntu Local Repository

To set up the Ubuntu local repository, follow these steps:

  1. Open the terminal and input the following command to verify the system’s software source list:
sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak
sudo nano /etc/apt/sources.list
  1. In the open file, comment out all online software sources and add the address of the local source, for example:
deb file:///path/to/local/repo/ bionic main

The path /path/to/local/repo/ here is the local repository path, with “bionic” being the version number of Ubuntu, which can be modified according to actual circumstances.

  1. Save the file and exit the editor.
  2. Update the list of software packages.
sudo apt-get update

Now the system will use local sources to download software packages. It is important to note that the local sources must contain complete software package information, otherwise software installation may not be successful.

bannerAds