APT for Debian maintenance tools

Source: Internet
Author: User
Debian maintenance tool APT-Linux Release Technology-Debian information. The following is a detailed description. 1. A Tool for automatically configuring resource lists is provided in the basic system: apt-setup. The tool is provided by base-config (currently only available in sarge ).

# Base-config

Call or directly run

# Apt-setup

2 apt-spy mode:
Apt-spy tests the list, finds the fastest one based on the bandwidth and response speed, and automatically saves the result to/ect/apt/sources. list.

# Apt-get install apt-spy

# Mv sources. list sources. list. bak // backup

# Man apt-spy // obtain detailed usage

# Apt-spy update // update your image list file/var/lib/apt-spy/mirrors.txt
You can restrict the test to a country or region, and provide the option to limit the number of test servers. also, zones can be defined in the/etc/apt-spy.conf. you can use the following command to find the fastest image in Asia and generate a record for testing:

# Apt-spy-d testing-a Asia

3 common apt commands
Apt-get update // update
Apt-get dist-upgrade // system upgrade
Apt-cache search packages // search software package
Apt-cache show packages // obtain the related information of the software package.
Apt-cache depends packages // query the packages associated with the package
Apt-cache rdepends packages // query which packages are associated with this package
Apt-cache showsrc packagename | grep Build-Depends // view the compilation of a software? Apt-cache policy packagename // check the package status
Apt-get install -- print-uris packages // -- print-uris option to output the information to the screen
Apt-get install packages-s (-- simulate) // just simulate it, instead of installing it
Apt-get install packages-d (-- download-only) // you only need to obtain. deb instead
Apt-get -- reinstall install package // fix
Apt-get-f install // If the installation is interrupted, you can find that the package cannot be reinstalled or deleted.
Apt-get remove packages // Delete the Software Package
Apt-get remove packages -- purge // delete permanently
Apt-get source packagename // download the source code of the software
Apt-get build-dep packagename // install the package's compiling environment while installing the package source code

Apt-get clean
// Delete the/var/cache/apt/archives/directory and all files in the/var/cache/apt/archives/partial/directory, except the locked files.

Apt-get autoclean
// Only delete objects that do not need to be downloaded again.

4. Advanced Query
If you want to install a software package, but you cannot find its name using apt-cache, but you know the program file name or the file name of some files in the software package, you can use apt-file to find the package name. this tool is provided by software packages with the same name. apt-file is actually a Contents file interface provided in the APT software library. each release provides such a file, including a list of all files to be installed in a release. before using apt-file, you must first obtain the Contents file to be queried. run apt-file update to download the file to the/var/cache/apt directory. in this way, you can use apt-file to query this file. apt-file is mainly used to determine which software package provides a file.

Apt-file search filename

With this command, you can list the content of the software package:

Apt-file list packagename

Like apt-get, this database also needs to be updated in real time, and can be run after the update is completed:

Apt-file update

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.