How to configure local installation source for Ubuntu?

To configure the local installation source, you can follow these steps:

  1. Firstly, create a directory for the local installation source. You can choose a suitable directory as the installation source, such as /usr/local/install.
  2. Create a new directory called “install” in the /usr/local path.
  3. 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.
  4. Copy the package.deb file from the specified path to the /usr/local/install directory using sudo.
  5. Set up a local installation source.
  6. Use the command “sudo apt-ftparchive packages /usr/local/install” to compress and save the packages in the specified directory as “Packages.gz”.
  7. This command will create a Packages.gz file containing package information.
  8. Add the local installation source to the source list.
  9. edit the sources.list file in /etc/apt/ using nano and sudo
  10. Add the following line at the end of the document:
  11. install deb files from the local directory /usr/local/
  12. Save and close the file.
  13. Update the software package list.
  14. 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:

  1. The software package file to be installed must be in .deb format.
  2. 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.
  3. 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.
Leave a Reply 0

Your email address will not be published. Required fields are marked *


广告
Closing in 10 seconds
bannerAds