Home
Main website
Display Sidebar
Hide Ads
Recent Changes
View Source:
apt-move(8)
Edit
PageHistory
Diff
Info
LikePages
apt-move - move cache of Debian packages into a mirror hierarchy. !SYNOPSIS __apt-move__ [[__-c__ ''conffile''] [[__-ft__] ''command'' !DESCRIPTION The __apt-move__ script is used to move a collection of Debian package files into a proper archive hierarchy of the form __$LOCALDIR/dists/...__ where __LOCALDIR__ is specified in the configuration file. It is intended as a tool to help manage the apt-get(8) file cache, but could be configured to work with any collection of Debian packages. Additionally, using the ''sync'' and ''mirror'' commands, you can build your own local mirror of portions of a selected binary and/or source distribution. Running __apt-move__ periodically will assist in managing the resulting partial mirror by (optionally) removing obsolete packages and creating valid local Packages.gz and Sources.gz files using dpkg-scanpackages(8) and dpkg-scansources(8). !Commands The following commands are accepted by __apt-move__: ; __get__ : This generates the master files using Packages and Sources files from the apt(8) cache. The master files are used to keep track of what packages are available, and where packages should be installed. ; __getlocal__ : This is an alias of get. It may be removed in future releases. ; __move__ : Moves a collection of packages into the local mirror tree. Uses existing master files (see ''get'') to repair any mangling done to the package names. Any packages that aren't listed in the master files will be left in the file cache directory. ; __delete__ : Delete obsolete package files. Configurable through the ''DELETE'' and ''MAXDELETE '' settings in the __/etc/apt-move.conf__ file (see the ''CONFIGURATION'' section below). ; __packages__ : Builds new local versions of Packages.gz and Sources.gz files. ; __fsck__ : Rebuilds all index files used to make Packages and Sources files and create symbolic links for binary-all packages. Use this if you are upgrading from an old version (<< 4.0) of apt-move, if your index files are corrupted, or if you are adding a new architecture to your mirror. This will use your existing master files, or your local Packages and Sources files if they aren't available. ; __update__ : This is an alias, equivalent to ''get move delete packages''. This is the preferred method for moving package files from your cache into a local mirror. ; __local__ : This is an alias, equivalent to ''move delete packages'''. ; __localupdate__ : This is an alias for update. It may be removed in future releases. ; __mirror__ : This command automatically runs ''get'', then uses __/usr/lib/apt-move/fetch__ and apt-get(8) to download any packages missing from your mirror. The downloaded files will be installed into the repository using ''move''. Finally, it runs ''packages'' and exits. See the ''DIST'' and ''PKGTYPE'' settings in __/etc/apt-move.conf__. %%% Before using this command, you need to set up a __$LOCALDIR/.exclude__ file containing patterns to exclude unwanted files from your mirror. See the __SAMPLE.exclude__ file for an example. See also the ''Exclude file'' section of ''NOTES '' below. Note that this command will only mirror packages for the architecture that you are running on. It will, however, mirror all source packages. ; __sync__ : Similar to the ''mirror'' function, but only gets the packages that are currently installed on your system. It uses dpkg(8) ''--get-selections'' to find out what files to download. It will skip any files that match one of the patterns in the __$LOCALDIR/.exclude__ file (if it exists). __sync__ will get the latest versions of the packages, regardless of the version currently installed on your system (think about it). ; __exclude__ : This command is used to test your __$LOCALDIR/.exclude__ pattern file. It will go through the master lists and print any file that matches one of the patters in __$LOCALDIR/.exclude__. %%% This will show you exactly what files you have EXCLUDED from your mirror. The __-t__ (test) flag has no affect on this command. This uses your existing master files, and does not require an internet connection. ; __movefile__ ''files...'' : This command is similar to move. Instead of moving files from ''FILECACHE'', 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 __mirror__ or __sync__, it will produce the same lists that the __mirror__ and __sync__ commands use. If the argument is __repo__, the list produced will contain the packages that are currently in the apt-move repository. ; __mirrorbin__ : This command will fetch the list of packages specified on the standard input, and place them into he archive in the same way as __mirror__ does. ; __mirrorsrc__ : This commands acts like __mirrorbin__, except that it fetches source packages instead of binary ones. !Options The following options are available from the command line: ; __-c __ ''conffile'' : Use ''conffile'' as the configuration file instead of __/etc/apt-move.conf__. ; __-f__ : Forces deletion of files even when the percentage of files to delete exceeds the ''MAXDELETE'' setting. This is useful if __apt-move __ 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, using __-ft__ will show you the complete list of files, so you can verify them before you use __-f.__ ; __-t__ : Makes a 'test run' and reports what WOULD be done for __option__ but does not modify any of the cache or mirror files. !CONFIGURATION Before using __apt-move__, edit the __/etc/apt-move.conf__ file to match your local setup. Always remember to use the ''test'' 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 ''DELETE'' option to ''no'' to turn off file deletes until everything else is working successfully. The following settings are recognized by __apt-move__ (shown here with their defaults): ; __APTSITES=__debian.midco.net non-us.debian.org : Set this to the names of sites in your __/etc/apt/sources.list__ that you wish to mirror. ; __ARCHS=__alpha arm hurd-i386 i386 m68k powerpc sparc : This is a list of the architectures that you mirror. As of potato, set to only one of: ''alpha'', ''arm'', ''hurd-i386'', ''i386'', ''m68k'', ''powerpc'' or ''sparc''. %%% Determines the creation of links to binary-all packages, as well as Packages and Sources files. ; __LOCALDIR=__/mirrors/debian : This is the full (absolute) path to your debian directory (the top of your local mirror). ; __DIST=__potato : Set this to a distribution name (such as slink or potato) to follow a particular distribution throughout its life cycle, or to a distribution branch (such as stable or unstable) to always mirror that branch, regardless of its current name. Your local mirror will be constructed accordingly. It is generally safer to use the code name (e.g., potato), and then create symbolic links under __LOCALDIR__. ; __PKGTYPE=__binary : %%%Set this to your choice of: ''binary'', ''source'' or ''both'' to tell the ''mirror'', ''sync'' and ''movefile'' which type(s) of files to get. ; __FILECACHE=__/var/cache/apt/archives : The directory where your local cache of packages are. The default will work for the apt-get(8) packages, unless you've changed the configuration in __/etc/apt/apt.conf__. ; __LISTSTATE=__/var/state/apt/lists : The directory to your local cache of Packages files. The default will work for the apt-get(8) packages, unless you've changed the configuration in __/etc/apt/apt.conf__. ; __DELETE=__no : Determines whether obsolete packages (packages not listed in the master file, or packages that have been superceded in the repository) are to be removed. ; __MAXDELETE=__20 : Maximum percentage of files __apt-move__ 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 ''-f'' parameter with __apt-move__. ; __STRICTMOVE=__no : If set to yes, files will only be allowed into the cache if their version without the epoch is equal to the version listed in the master file. If no version is recorded in the entry for this package in the master file, then it will still be allowed in. %%% For the ''sync'' and ''mirror'' commands to function correctly, you need to list your __apt-move__ repository at the top of __/etc/apt/sources.list__ as a __file URI__. !FILES ; __/usr/bin/apt-move__ : The script. ;__/etc/apt-move.conf__ : Configuration file for the script. ; __/usr/share/man/man8/apt-move.8.gz__ : The manpage. ; __/tmp/MOVE_*__ : The temporary files created at runtime. ; __/usr/lib/apt-move/fetch__ : Utility to fetch files just like ''apt-get install -d''. Except that no dependency analysis is done. ; __.apt-move/*.{binary, source}.local__: Put entries of local packages here. The fields are ``package priority section source'' for the binary file, and ``package priority section'' for the source file. !SEE ALSO dpkg-scanpackages(8), dpkg-scansources(8), dpkg(8), apt-get(8) !NOTES !Exclude file The ''mirror'' command uses a file in the __$LOCALDIR/__ 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 grep(1), after any '*' characters are removed. Unless you're careful setting this up, you'll get unexpected results. Run '__apt-move -t mirror__' first, to make sure you're getting the results you intended. Another way to verify your exclude file is the use the ''exclude'' command for __apt-move__ 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. !WARNINGS The __apt-move__ __mirror__ and __sync__ commands 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. !DIAGNOSTICS __apt-move__ may exit with one of the following error messages: ; __Could not find configuration.__ : __apt-move__ could not find the __/etc/apt-move.conf__ file. Run the install script. ; __You must specify at least one APTSITES in...__ : You did not specify anything in ''APTSITES''. Which implies that there is nothing to mirror. ; __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 ''DIST'' setting in /etc/apt-move.conf. ; __You specified an invalid pacakge type.__ : You can only use ''binary'', ''source'' or ''both'' for the PKGTYPE setting. ; __No master files exist!__ : You need to run __apt-move__ with the __get__ command at least once in order to create the master files which determine where packages are to be installed. ; __bc calculation returned invalid result__ : __apt-move__ uses the bc(1) program to determine when the number of files to delete will exceed the ''MAXDELETE'' setting in __apt-move.conf__. If you get this error, make sure that ''MAXDELETE'' 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!__ : __apt-move__ will report this error if the number of files to be deleted exceeds the ''MAXDELETE'' setting in __apt-move.conf__. You need to study the output to determine if this is normal (in which case you can override this using the ''force'' 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 ''apt-move fsck'' and finally remove __.apt-move/ancient__. !AUTHOR Michael Merten <mikemerten@yahoo.com> %%% Herbert Xu <herbert@debian.org> ----- User Submitted Annotations: If it doesn't move your package, that means it's not listed in the Release file somewhere along the line. That's why you often get Ign: on Release files from 'local' repositories. ''So the question dying to be asked here is -- how do you stick it into a Release file? -- PerryLorier'' Wouldn't you love to know! Unfortunately, I have so far turned up a blank... http://lists.debian.org/debian-devel/2003/debian-devel-200309/msg01538.html has a script to create the Relese files. http://lists.debian.org/debian-user/2002/debian-user-200203/msg04954.html has a simpler description
One page links to
apt-move(8)
:
apt-get(8)
This page is a man page (or other imported legacy content). We are unable to automatically determine the license status of this page.