User Tools

Site Tools


ubuntu:apt:add_local_directory_to_apt_sources.list

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

ubuntu:apt:add_local_directory_to_apt_sources.list [2023/06/18 14:06] – created peterubuntu:apt:add_local_directory_to_apt_sources.list [2023/06/18 14:09] (current) peter
Line 1: Line 1:
 ====== Ubuntu - apt - Add local directory to apt sources.list ====== ====== Ubuntu - apt - Add local directory to apt sources.list ======
 +
 +1. Create the directory to put all the deb files, for example /home/foo/debs:
 +
 +<code bash>
 +mkdir /home/foo/debs
 +</code>
 +
 +----
 +
 +2. Put all the deb files into the directory:
 +
 +<code bash>
 +mv /home/foo/Desktop/*.deb /home/foo/debs
 +</code>
 +
 +----
 +
 +3. Check the current priorities and section for the package, find entry named Section and Priority:
 +
 +<code bash>
 +dpkg --info example_1.2.3-1@i386.deb
 +</code>
 +
 +<WRAP info>
 +**NOTE:**  This returns some information including Section and Priority:
 +
 +Here is some of the info:
 +
 +<code>
 +Package: example
 +Section: editors
 +Priority: optional
 +Homepage: http://www.example.com/
 +</code>
 +
 +</WRAP>
 +
 +----
 +
 +4. Create an override file. 
 +
 +An Override file is used to override the default Priority and Section setting of the package.
 +
 +  * An Override file contains 3 columns: Package, Priority, Section.
 +    * Package is the name of the Package, Priority is low, medium, high or optional and Section is the section to which it belongs.
 +
 +Example of override file content:
 +
 +<file>
 +## Override
 +#Package priority section
 +example low editors
 +</file>
 +
 +----
 +
 +5. Create Packages.gz inside /home/foo/debs
 +
 +<code bash>
 +cd /home/foo/debs
 +sudo dpkg-scanpackages . override | gzip -c9 > Packages.gz
 +</code>
 +
 +----
 +
 +6. If you are too lazy to do the override file, you do not have to.  Just change the "dpkg --scanpackages" command above to this:
 +
 +<code bash>
 +cd /home/foo/debs
 +sudo dpkg-scanpackages . /dev/null | gzip -c9 > Packages.gz
 +</code>
 +
 +If you follow this path, ignore step 4 and 5.
 +
 +----
 +
 +7. Add this line to /etc/apt/sources.list
 +
 +<code>
 +deb file:///home/foo/debs /
 +</code>
 +
 +----
 +
 +8. Re-synchronize the package index files from their sources
 +
 +<code bash>
 +sudo apt-get update
 +</code>
 +
 +----
 +
 +9. Install your application:
 +
 +<code bash>
 +sudo apt-get install example
 +</code>
 +
 +
 +<WRAP info>
 +**NOTE:**  This has just created a local file repository.
 +
 +  * apt will fetch the deb files from your local file directory also. 
 +
 +</WRAP>
  
ubuntu/apt/add_local_directory_to_apt_sources.list.1687097189.txt.gz · Last modified: 2023/06/18 14:06 by peter

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki