sources.list file format
sources.list File Format
The sources.list file format for wpkg is the same as the one found in apt. This means, it is composed of entries defined as follow:
Type | URI | Distribution | Components | |
---|---|---|---|---|
Example 1. | wpkg | http://packages.m2osw.com/snap/stable | m2osw | main contrib |
Example 2. | wpkg | http://wpkg.m2osw.com/ | packages/m2osw | non-free |
Example 3. | wpkg | http://deb.m2osw.com/ | ubuntu/server/ |
The corresponding sources.list file would look something like this:
# Do not edit, use wpkg to make changes to this file wpkg http://packages.m2osw.com/snap/stable m2osw main contrib wpkg http://wpkg.m2osw.com/ packages/m2osw non-free wpkg http://deb.m2osw.com/ ubuntu/server/
The packager makes use of these source definitions when wpkg --update is run. It also uses them when wpkg --upgrade runs, although in that case it does not access the remote data.
The final URIs are generated by appending the distribution name and the components with slashes to separate each filename. Our examples give us the following URIs since one of them has 2 components, we have one more URI total than entries in the sources.list file:
http://packages.m2osw.com/snap/stable/m2osw/main/ http://packages.m2osw.com/snap/stable/m2osw/contrib/ http://packages.m2osw.com/packages/m2osw/non-free/ http://deb.m2osw.com/ubuntu/server/
There is one special case: if the name of a distribution ends with a slash, then you cannot define components. Otherwise, at least one component is required.
The protocols that are currently supported as defined in the following table:
URI Protocols | Examples |
---|---|
file |
file:///usr/packages/ file://E:/storage/packages |
smb | smb://server.name/share.folder/sub-directories/with/packages |
http | http://packages.m2osw.com/snap/ |
Note that wpkg --update command tries to load an index from each one of the sources defined. If that fails, then the last index loaded is kept. If it always failed, then no index is loaded and the entry is simply ignored.
Installing Packages From sources.list
Once sources were added with --add-sources, you first want to run an --update command to retrieve the sources index files. It is usually quite important to have up to date indexes (the very first time, wpkg may do it automatically for you, but do not expect wpkg to do it each time it would be necessary.)
Then you can run the --install command with the name of packages to be installed. In this case the name is bare, as it appears in the Package field of the control file (i.e. no architecture, no version, and no extension.)
wpkg --install package-name
If you encounter problems trying to install a package in this way, you may want to try retrieving the package with the wget command line tool or similar to make sure that the package is accessible.
wget http://repo.windowspackager.org/path/to/package/package-name_version_arch.deb
This should retrieve the .deb file.
Another potential problem are the sources index files. These should appear in a sub-directory of your core installation directory. If you cannot see them there, then the indexes cannot be downloaded either. wpkg should report such errors, but the errors may not be as clear cut as they could be if the files cannot be downloaded.
Managing sources.list
Files1:
/var/lib/wpkg/core/sources.list
/var/lib/wpkg/core/update.index
/var/lib/wpkg/core/indexes/update-<#>.index.gz
Remote Files:
<uri>/index.tar.gz
<uri>/<package>.deb
Commands to manage and use the sources.list files:
- --add-sources
- --create-index
- --list-index-packages
- --list-sources
- --remove-sources
- --update
- --update-status
- --upgrade
- --upgrade-info
Details about the Files
The sources.list file is a text file. Comments start with a # character. Empty lines are permitted too.
The update.index file is a text file. The content is generated and read by wpkg and it should never be tempered with.
The update-<#>.index.gz files are compressed tarballs of the package full names and their control files. These are copies of the index.tar.gz files as uploaded by the --update command.
The index.tar.gz is a compressed tarball of the packages created by the --create-index. Make sure you use that command because it (1) ensures that the index is sorted; and (2) it uses specify filenames and data for each entry.
The <package>.deb files are, obviously, the Debian packages as created by wpkg --build.
- 1. Assuming the default --root of /var/lib/wpkg