aptfile帮助手册 aptfile帮助手册如下。roothanyw:manaptfilegrepEv39;APTFILE(1)UserContributedPerlDocumentationAPTFILE(1)NAMEaptfileAPTpackagesearchingutilitycommandlineinterfaceSYNOPSISaptfile〔options〕searchpatternaptfile〔options〕showpackageDESCRIPTIONaptfileisacommandlinetoolforsearchingfilesinpackagesfortheAPTpackagemanagementsystem。Someactionsarerequiredtorunthesearch:findAliasforsearch。listListthecontentsofapackage。ThisactionisveryclosetothedpkgLcommandexceptthepackagedoesnotneedtobeinstalledorfetched。Bydefault,thelistactioninterpretsitspatternasiffixedstringwasspecified。listindicesListtheknownContentindicesandtheirstatusinahumanreadableformat。TheseindicescanbesearchedviatheIoption(whenenabledandafterfetchingtheindices)。Theoutputissubjecttochangewithoutnoticeandisthereforeunsuitedforscriptusageautomation。Foramachinereadableformats(e。g。automation),pleaseuseaptconfigdump(searchforoptionsstartingwithAcquire::IndexTargets)andaptgetindextargetsforcheckingthecache(LookforentrieswithanIdentifierfieldstartingwithContents)。Notethatinpidualsources。listentriescanoverridetheglobaldefault。Pleaseconsultsources。list(5)formoreinformationonadvancedconfigurationofthesources。listfiles。searchSearchinwhichpackageafileisincluded。Alistofallpackagescontainingthepatternpatternisreturned。SinceContentsfilesdoesnotcontaindirectories,thepatternmustmatch(partofa)filename。Bydefault,thesearchactioninterpretsitspatternasifsubstringmatchwasspecified。showAliasforlist。updateThisactionthatjustcallsaptupdateoraptgetupdate(dependingonwhetherattyisavailable)。Theonlyadvantageusingthisoveraregularaptupdateoraptgetupdatedirectlyisforthecasewhereyouhaveconfiguredanaptfilespecificconfiguration(viatheDir::Etc::aptfilemainconfigurationoption)。Inthatcase,saidconfigurationwillbeincludedautomatically。OPTIONSThefollowingoptionsareavailable:a,architecturearchitecture〔,。。。〕Thisoptionisusefulifyousearchapackageforadifferentarchitecturefromtheoneinstalledonyoursystem。Itcanbeacommaseparatedlistforsearchingonmultiplearchitectures。c,configfileAPTconfigfileConfigurationFSpecifyaconfigurationfiletouse。Theprogramwillreadthedefaultconfigurationfileandthenthisconfigurationfile。IfconfigurationsettingsneedtobesetbeforethedefaultconfigurationfilesareparsedspecifyafilewiththeAPTCONFIGenvironmentvariable。Seeapt。conf(5)forsyntaxinformation。Theconfigurationfilewillbereadrelativetowhenitappearsonthecommandlineandcanoverwriteoptionsthatappearbeforeit。NotethattheconfigfilewillalsobepassedtoallAPTtoolscalledbyaptfile。D,fromdebUsecontentsofthegiven。debarchives(s)aspatterns。Usefulforsearchingforfileconflictswithotherpackages。ImpliesF。f,fromfileReadpatternsfromthegivenfile(s),oneperline。Useasfilenameforstdin。Ifnofilesaregiven,thenthelistwillbereadfromstdin。Thisismuchfasterthaninvokingaptfilemanytimes。filteroriginsorigin〔,。。。〕Onlysearchindicesfromthelistedorigins(e。g。Debian)。ThisfiltermatchesagainstthenamelistedintheOriginfieldfromtheReleasefile。Ifsetto,thisfilterwillbedisabled(mostlyusefulforoverridingthesettinginaconfigurationfile)AliasoftheAPTconfigoption:aptfile::SearchFilter::Originfiltersuitessuite〔,。。。〕Onlysearchindicesfromthelistedsuitesorcodenames(e。g。unstable)。ThisfiltermatchesagainstthenamelistedintheCodenameandSuitefieldsfromtheReleasefile。ThismeansthateitherunstableorsidwillmatchDebiansunstablesuite。Ifsetto,thisfilterwillbedisabled(mostlyusefulforoverridingthesettinginaconfigurationfile)AliasoftheAPTconfigoption:aptfile::SearchFilter::SuiteF,fixedstringDonotexpandsearchpatternwithgenericcharactersatpatternsstartandend。Thisisdefaultforshowandlistactions。indexnamestype〔,。。。〕,Itype〔,。。。〕Onlysearchindexesofthegivenname(s)。IfsettothespecialvalueALL(casesensitive),thenallaptfileindicesaresearched。Thename(s)mustmatchoneormoreoftheidentifiersusedintheAPTconfiguration(minusleadingContents)。Exampleiftheconfigurationhasthefollowingsnippets:Acquire::IndexTargets::deb::Contentsdeb{。。。};Acquire::IndexTargets::debsrc::Contentsdsc{。。。};Acquire::IndexTargets::deb::Contentsudeb{。。。};Acquire::IndexTargets::deb::Contentsdeblegacy{ExplicitlynamedtoContentsdebIdentifierC。。。;};Then,aptfilewillrecognisedeb,dscandudebasindexnames。Thisoptiondefaultstothevalueoftheaptfile::IndexNamesaptconfigoption(ordebifomitted)。i,ignorecaseIgnorecasewhensearchingforpattern。l,packageonlyOdonotdisplayfilenames。o,optionAPT::OptionValueSetaConfigurationOThiswillsetanarbitraryconfigurationoption。ThesyntaxisoAPT::OptionValue。oandoptioncanbeusedmultipletimestosetdifferentoptions。Thisoptioncanbeusedtooverwriteothercommandlineoptions(e。g。oaptfile::SearchFilter::OriginDebianiseffectivelythesameasfilteroriginsDebian)。NotethattheconfigoptionspassedviathisoptionwillalsobepassedtoallAPTtoolscalledbyaptfile。substringmatchMatchifthegivensearchpatternisasubstringofapathorpackage。Thisisdefaultforsearchandfindactions。v,verboseRunaptfileinverbosedebugmode。x,regexpTreatpatternasa(perl)regularexpression。Seeperlreref(1)fordetails。Withoutthisoption,patternistreatedasaliteralstringtosearchfor。Beadvisedthatthisoptioncanberatherslow。Ifperformanceisanissue,considergivingaptfilenonregexpatternmatchingtoomuchandpipetheoutputtoperlnepatternhere。Thisenablesaptfiletousemoreoptimizationsandleaveslessworktotheslowerregex。h,helpDisplayashorthelpscreen。CONFIGURATIONFILESTheaptfilecommandreliesontheAPTconfiguration。Notably,thedefaultconfigurationmakesaptfetchContentsfilesbydefaultduringacalltoaptupdate。ForinformationonhowtoconfigureAPTtofetchmoreorfewerContentsfiles,pleaserefertousrsharedocaptfileREADME。md。gz。Thefollowingfilesarenotablyinteresting:etcaptaptfile。confNotethispathisactuallyconfigurablebychangingthevalueoftheAPTconfigurationcalledDir::Etc::aptfilemain。Thelistedvalueismerelythedefaultvalueofthatoption。Ifthisfileispresent,aptfilewillreadthisfileafteralldefaultAPTconfigurationfiles。Anyconfigfilecoroption(o)willbeevaluatedbeforethisfile(andcanoverrideoptionssetinit)。ThefilewillalsobepassedontoallAPTtoolscalledbyaptfile。etcaptapt。conf。d50aptfile。confChooseswhichContentsfilestodownload。NotethataptfilerecognisesonlyAcquiretargetsthatstartswithContents。Specialconfigurationssimilartoaptfile2Herearesomeaptfile2relatedworkflowsandhowto(almost)emulatethemwithaptfile3。Theyaredocumentedasastartingpointforpeople,whoareattachedtothese。Theemulationmaynotbeperfectforyououtofthebox。Patchesarewelcometokeeptheexamplesupdatedaslongastheexamplesremaintrivial。OnlymakeaptfileupdatefetchContentsfilesIfyouareaccustomedtoaptupdatenotfetchingContentsfiles,thenyoucanrunusrsharedocaptfileexamplesaptfile2update。sh。Thisscriptwillconfigureaptandaptfileaccordinglyafterbesteffort。Pleasereadtheresultingetcaptaptfile。conf。CreatingusingusercachesPreviousversionsofaptfilehadacacheoption,whichcouldbeusedtodenoteadirectorytostoretheContentsfiles。Thiscanbeemulatedbydoing:Setupmkdirp。cacheaptfile。configtouch。cacheaptfiledpkgstatussedDir::SDir::Cusrsharedocaptfileexamplesaptfile。conf。configaptfile。confcatEOF。configaptfile。confDir::StateHOME。Dir::CacheHOME。Dir::State::statusHOME。EOFUpdatethecacheaptfilec。configaptfile。confupdateSearchusingthecacheaptfilec。configaptfile。confshowaptfileRemovalofthecacheconfigrmfr。cacheaptfile。configaptfile。conf(Youwillprobablywanttoaddanaliasaptfileinyour。bashrc)Pleasereadtheresulting。aptfileusercache。conf。BUGS,QUIRKSTherearesomeknownissuesorquirksthataregoodtokeepinmind。TheContentsfilesdonotincludealeadingslashonpaths。ThismeansthatbinlsislistedasbinlsintheContentsfile。Ifyouarelookingforsomethinginatopleveldirectory,itisoftenbettertoomittheleadingslash。Thesearchalgorithmwillattempttoworkaroundtheleadingslash,butitwillnotworkinallcases。Asaworkaround,trytopulltheleadingslashtothebeginningofregularexpressions。Forexample,use(?:usrbinvimsbinlvm)insteadofusrbinvimsbinlvm。Whenanewlinehasbeenaddedtothesources。listandaptupdatehasnotbeenrun,aptfiledoesnotprintawarningmessage。Bydefault,aptfileassumesthatContentsfilesdonotincludeadescriptiveheader(explainingwhatthefileisandhowtointerpretit)。However,sometoolshavegeneratedthemwithsuchaheader(e。g。foroldversionsofContentsfilesfortheDebianarchiveorContentsfilesgeneratedbyreprepropriortoversion5。2。0)。Ifyousearchsuchfiles,youwillwanttosetaptfile::Parser::CheckForDescriptionHeadertotrue(e。g。inetcaptapt。conf。d50aptfile。conf)tohaveaptfileproperlyfilterouttheheaderstoavoidfalsematches。Thereasonthisisnotthedefaultisthatitcostsafactor2inoverheadwhilemostcommonContentsfilesnolongerhavetheheader。(see881405formoredetails)。NotallAPTrepositorieshaveContentsfiles。Notablycommoninstallmedia(CDsetc。)mayomitthemtoconservespace。ThedefaultconfigurationbyaptfilemarksContentsfilesasoptionalandwilljustsilentlyfailtosearchinContentsfilesinsuchrepositories。EXITCODESaptfilehasthefollowingdefinedexitcodes,whichcanbeusedforscriptingpurposes。0aptfilereturnedsuccessfully。Ifthecommandwasasearch,therewasatleastoneresult。1aptfilecompletedasearchsuccessfully,butithadnoresults。2Anerroroccurred(includinginvalidconflictinguseroptions)。3aptfilecouldnotcompletethecommandbecausethecachewasempty。PleaseensurethereareindicesenabledintheAPTconfigandrunaptupdatetofetchthem。4aptfilecouldnotcompletethecommandbecausethecachedoesnothaveanyfilesmatchingtherestrictions。Eitherchangetherestrictions(e。g。indexnames)orconfigureapttofetchtherelevantfilesandrunaptupdate。255Therewasaninternalerrorsuncaughtexceptioninaptfile。Pleasefileabugagainstaptfile。Anyotherexitcodeisreservedforfutureuse。SEEALSOapt(1),aptcache(8),apt。conf(5)TheAPTusersguideinusrsharedocaptTheexampleconfiginusrsharedocaptfileexamplesTheREADMEatusrsharedocaptfileREADME。md。gzperlv5。28。120190209APTFILE(1)