How to configure local installation source for Ubuntu?
To configure the local installation source, you can follow these steps:
- Firstly, create a directory for the local installation source. You can choose a suitable directory as the installation source, such as /usr/local/install.
- Create a new directory called “install” in the /usr/local path.
- Copy the installation package file to the installation source directory. You can copy the software package file that needs to be installed to the directory /usr/local/install.
- Copy the package.deb file from the specified path to the /usr/local/install directory using sudo.
- Set up a local installation source.
- Use the command “sudo apt-ftparchive packages /usr/local/install” to compress and save the packages in the specified directory as “Packages.gz”.
- This command will create a Packages.gz file containing package information.
- Add the local installation source to the source list.
- edit the sources.list file in /etc/apt/ using nano and sudo
- Add the following line at the end of the document:
- install deb files from the local directory /usr/local/
- Save and close the file.
- Update the software package list.
- Update using the sudo apt-get command.
Now, you can use the apt-get command to install packages from a local repository.
sudo apt-get install package-name
Please note:
- The software package file to be installed must be in .deb format.
- The locally installed repository configuration is only applicable to the current system. If you want to use it on another system, you need to repeat the above steps.
- When a new installation package is added to the installation source directory, the command in step 3 needs to be rerun to update the Packages.gz file.