Section: Maintenance Commands (8)Updated: 2002 Oct 7thLocal indexUp
apt-move - move cache of Debian packages into a mirror hierarchy.
script is used to move a collection of Debian package files into a proper
archive hierarchy of the form
is specified in the configuration file.
It is intended as a tool to help manage the
file cache, but could be configured to work with any collection
of Debian packages.
Additionally, using the
commands, you can build your own local mirror of portions of a selected
binary and/or source distribution.
periodically will assist in managing the resulting partial mirror
by (optionally) removing obsolete packages and creating valid local
Packages.gz and Sources.gz.
The following commands are accepted by
get [ dir ]
This generates the master files using Packages and Sources files from the
cache. The master files are used to keep track of what packages are
available, and where packages should be installed. If
is specified, it will be used in lieu of the
getlocal [ dir ]
This is an alias of get. It may be removed in future releases.
Moves a collection of packages into the local mirror tree. Uses existing
master files (see
to repair any mangling done to the package names. Any packages that aren't
listed in the master files or are obsolete will be left in the file cache
directory. Obsolete packages will also be copied into the archive but
they will be removed after the next delete operation. In the these two
cases, the package is considered to have been skipped.
Delete obsolete package files. Configurable through the
settings in the
file (see the
section below). It also deletes any index files of packages that are
no longer in the archive. This means that you can simply delete packages
from the archive without affecting its consistency as long as you run the
Builds new local versions of Packages.gz and Sources.gz files.
Rebuilds all index files used to make Packages and Sources files and reprocess
all packages in the archive by calling
on them. Use this if you are upgrading from an old version (<< 4.2) of
This is an alias, equivalent to
This is the preferred method for moving package files from your
cache into a local mirror.
This is an alias, equivalent to
This is an alias for update. It may be removed in future releases.
This command automatically runs
to download any packages missing from your mirror. The downloaded files will
be installed into the repository using
Finally, it runs
Before using this command, you need to set up a
file containing patterns to exclude
unwanted files from your mirror. See the
file for an example. See also the
below. Note that this command will only mirror packages for the architecture
that you are running on. It will, however, mirror all source packages.
Similar to the
function, but only gets the packages that are currently installed on
your system. It uses
to find out what files to download. It will skip any files that
match one of the patterns in the
file (if it exists).
will get the latest versions of the packages, regardless of the
version currently installed on your system (think about it).
This command is used to test your
pattern file. It will
go through the master lists and print any file that matches one
of the patters in
This will show you exactly what
files you have EXCLUDED from your mirror. The
(test) flag has no affect on this command. This
uses your existing master files, and does not require an internet
This command is similar to move. Instead of moving files from
it will move the files specified on the command line.
listbin [ mirror | sync | repo ]
This command prints a list of packages which may serve as the input to
mirrorbin or mirrorsrc. If the argument is
it will produce the same lists that the
commands use. If the argument is
the list produced will contain the packages that are currently in the
This command will fetch the list of packages specified on the standard input,
and place them into the archive in the same way as
This commands acts like
except that it fetches source packages instead of binary ones.
The following options are available from the command line:
Process all packages. By default, commands like
only process packages that differ in version between the apt-move repository
and the archive being mirrored. This option causes all packages to be
considered even if the apt-move repository already contains the latest version.
as the configuration file instead of
as the default suite instead of the value of
from the configuration file.
Forces deletion of files even when the percentage of files to
delete exceeds the
setting. This is useful if
aborts with an error saying that too many files would be deleted, and you
want to delete the files anyway. (Use with caution.) If you get this error,
will show you the complete list of files, so you can verify them before
Suppresses normal output. This option is useful when
is used in a non-interactive script.
Makes a 'test run' and reports what WOULD be done for
but does not modify any of the cache or mirror files.
file to match your local setup. Always remember to use the
parameter after any change in your configuration to make sure it will
work like you want it to. You may also want to set the
to turn off file deletes until everything else is working successfully.
The file is read as a Bourne shell script. So you must obey the
syntactical rules of
In particular, values with spaces in them must be quoted with single
or double quotes.
The following settings are recognized by
(shown here with their defaults):
Set this to the names of sites in your
that you wish to mirror. The value
refers to all non-file URIs.
This is the full (absolute) path to your debian directory (the top of your
This is the default suite assigned to packages when the
file is missing. It does not have any effect on whether a suite is
stored in the archive.
Set this to your choice of:
to tell the
which type(s) of files to get.
The directory where your local cache of packages are. The default will work
packages, unless you've changed the configuration in
The directory to your local cache of Packages files. The default will work
packages, unless you've changed the configuration in
Determines whether obsolete packages (packages not listed in the master file,
or packages that have been superceded in the repository) are to be removed.
Maximum percentage of files
is allowed to delete during a normal run. Anything exceeding this will
produce an error and abort the script. I added this as a precaution
so that you won't lose your entire mirror when a new distribution is
released. You can override this (with caution) using the
If this is set to yes, then
will copy instead of move. That is, the originals will be left alone.
This should be set to a space-separated list of compression formats that
apt-move should provide when generating Packages and Sources files. The
possible values are
With the current
package you should include at least
will complain about missing files.
If this is set to yes, then
will generate Contents files.
If this is set to non-empty string, then
will sign generated Release files with the specified key. You
before enabling this option.
commands to function correctly, you need to list your
repository at the top of
Configuration file for the script.
The temporary files created at runtime.
Utility to fetch files just like
apt-get install -d.
Except that no dependency analysis is done.
Put entries of local packages here. The fields are
``package priority section source version task'' for the binary file, and
``package priority section version'' for the source file. The
field may be set to a single dash to refer to the latest version in the
archive. Blank lines and lines beginning with a hash are ignored.
command uses a file in the
directory called '.exclude' which contains
exclude patterns that are applied against the files to be mirrored.
These patterns were created with the following limitation: they must work
the same with with
after any '*' characters are removed. Unless you're careful setting this up,
you'll get unexpected results. Run
first, to make sure you're getting the results you intended. Another way to
verify your exclude file is the use the
to print a list of files your are excluding from your mirror. See the sample
.exclude file (SAMPLE.exclude) for an example of an .exclude file.
do not test for available disk space. The current
potato (main binary) distribution is over 1Gb in size. Add the sources to
that and it can eat up the space on a partition really fast. I would advise you
to put your mirror somewhere other than the root partition. Set up your
exclude file and run
apt-move -t mirror
and examine the result.
gets the suite names from
files, which usually use the names
the suites in the repository are named accordingly. You can simulate the
code names by creating symbolic links in the
directory. For example, in order to make
you could run
ln -s testing $LOCALDIR/dists/sarge.
Alternatively, you could delete the
subdirectory and run
ln -s sarge $LOCALDIR/dists/testing.
This will cause future executions of the
operation to use
whenever it sees
may exit with one of the following error messages:
Could not read configuration.
could not find the
file. Run the install script.
Could not create directory.
For some reason, a necessary directory could not be created.
You failed to select a distribution.
You did not configure a
setting in /etc/apt-move.conf.
You specified an invalid package type.
You can only use
for the PKGTYPE setting.
No master files exist!
You need to run
command at least once in order to create the master files which determine
where packages are to be installed.
bc calculation returned invalid result
program to determine when the number of files to delete will exceed the
If you get this error, make sure that
is set to a number in the range of 1 to 100, without the % sign. Otherwise
you need to report this as a bug.
Too many files to delete!
will report this error if the number of files to be deleted exceeds the
You need to study the output to determine if this is normal (in which case
you can override this using the
parameter), or if its due to some drastic change on the mirror site (like
a new release) or possibly due to a partial download of the master
Packages.gz or Sources.gz file.
Your current mirror directory is incompatible...
You have just upgraded from an old version of apt-move. Update your
configuration, then run
and finally remove
Could not read Release files.
could not read the release files needed to build the master files. Make sure
you have run
and try again.
Failed to remove original files.
could not remove the original copies of files that have just entered the
archive. Make sure that you have permission to delete those files.
Please remove $LOCALDIR/backup.
You must remove
before running the
Unknown DIST setting.
The value of
must match the
field in the
file of the distribution that you are trying to mirror.
Cannot find index files for APTSITES.
could not find any index files for the
operation. You should either run
if only the
files have been changed.
The exclusion system was designed prior to the introduction to the package
pools. Hence its content still relates to the old structure of the Debian
archive. This is confusing and it should be replaced with a new exclusion
variable does not control what is actually downloaded by the
utility. It should have a similar effect to that of