If you do not leavecan you handle itdepencies 的英文缩写 谢了

Function Reference/wp register script & WordPress Codex
Interested in functions, hooks, classes, or methods? Check out the new !
Function Reference/wp register script
Registers a script file in WordPress to be linked to a page later using the
function, which safely handles the script dependencies.
Scripts that have been pre-registered using wp_register_script() do not need to be manually enqueued using wp_enqueue_script() if they are listed as a dependency of another script that is enqueued. WordPress will automatically include the registered script before it includes the enqueued script that lists the registered script's handle as a dependency. See the Notes for more information.
&?php wp_register_script( $handle, $src, $deps, $ver, $in_footer ); ?&
for information about what action
should be used to call the function as well as some insights on the rationale for using this function.
() (required) Name of the script. Should be unique as it is used as a handle for later use with .
Default: None
() (required) URL to the script, e.g. /wp-content/themes/my-theme/my-theme-script.js. You should never hardcode URLs to local scripts. To get a proper URL to local scripts, use
for . Remote scripts can be specified with a protocol-agnostic URL, e.g. ///js/their-script.js.
Default: None
() (optional) Array of the handles of all the registered scripts that this script depends on, that is, the scripts that must be loaded before this script. These scripts will automatically be enqueued when this script is enqueued with . Set false if there are no dependencies.
Default: array()
() (optional) String specifying the script version number, if it has one, which is concatenated to the end of the path as a query string. If no version is specified or set to false, then WordPress automatically adds a version number equal to the current version of WordPress you are running. If set to null no version is added. This parameter is used to ensure that the correct version is sent to the client regardless of caching, and so should be included if a version number is available and makes sense for the script.
Default: false
$in_footer
() (optional) Normally scripts are placed in the &head& section. If this parameter is true the script is placed at the bottom of the &body&. This requires the theme to have the
hook in the appropriate place. Note that you have to enqueue your script before wp_head is run, even if it will be placed in the footer. (New in WordPress 2.8)
Default: false
This function does not return a value.
By default, WordPress installation includes many popular scripts commonly used by web developers besides the scripts used by WordPress itself. Below is a list of the handles and paths of these scripts. "This list has been updated for 3.8." Source: .
Path in WordPress
/wp-includes/js/utils.js
/wp-admin/js/common.js
/wp-includes/js/tw-sack.js
/wp-includes/js/quicktags.js
colorpicker
/wp-includes/js/colorpicker.js
/wp-admin/js/editor.js
wp-fullscreen
/wp-admin/js/wp-fullscreen.js
wp-ajax-response
/wp-includes/js/wp-ajax-response.js
wp-pointer
/wp-includes/js/wp-pointer.js
/wp-includes/js/autosave.js
/wp-includes/js/heartbeat.js
wp-auth-check
/wp-includes/js/wp-auth-check.js
/wp-includes/js/wp-lists.js
///ajax/libs/prototype/1.7.1.0/prototype.js
scriptaculous-root
///ajax/libs/prototype/1.7.1.0/prototype.js
scriptaculous-builder
///ajax/libs/prototype/1.7.1.0/builder.js
scriptaculous-dragdrop
///ajax/libs/prototype/1.7.1.0/dragdrop.js
scriptaculous-effects
///ajax/libs/prototype/1.7.1.0/effects.js
scriptaculous-slider
///ajax/libs/prototype/1.7.1.0/slider.js
scriptaculous-sound
///ajax/libs/prototype/1.7.1.0/sound.js
scriptaculous-controls
///ajax/libs/prototype/1.7.1.0/controls.js
scriptaculous
scriptaculous-dragdrop, scriptaculous-slider, scriptaculous-controls
/wp-includes/js/crop/cropper.js
jquery (v1.10.2 as of WP 3.8)
jquery-core, jquery-migrate
jquery-core
/wp-includes/js/jquery/jquery.js
jquery-migrate
/wp-includes/js/jquery/jquery-migrate.js (v1.10.2 as of WP 3.8)
jquery-ui-core
/wp-includes/js/jquery/ui/jquery.ui.core.min.js
jquery-effects-core
/wp-includes/js/jquery/ui/jquery.ui.effect.min.js
jquery-effects-blind
/wp-includes/js/jquery/ui/jquery.ui.effect-blind.min.js
jquery-effects-bounce
/wp-includes/js/jquery/ui/jquery.ui.effect-bounce.min.js
jquery-effects-clip
/wp-includes/js/jquery/ui/jquery.ui.effect-clip.min.js
jquery-effects-drop
/wp-includes/js/jquery/ui/jquery.ui.effect-drop.min.js
jquery-effects-explode
/wp-includes/js/jquery/ui/jquery.ui.effect-explode.min.js
jquery-effects-fade
/wp-includes/js/jquery/ui/jquery.ui.effect-fade.min.js
jquery-effects-fold
/wp-includes/js/jquery/ui/jquery.ui.effect-fold.min.js
jquery-effects-highlight
/wp-includes/js/jquery/ui/jquery.ui.effect-highlight.min.js
jquery-effects-pulsate
/wp-includes/js/jquery/ui/jquery.ui.effect-pulsate.min.js
jquery-effects-scale
/wp-includes/js/jquery/ui/jquery.ui.effect-scale.min.js
jquery-effects-shake
/wp-includes/js/jquery/ui/jquery.ui.effect-shake.min.js
jquery-effects-slide
/wp-includes/js/jquery/ui/jquery.ui.effect-slide.min.js
jquery-effects-transfer
/wp-includes/js/jquery/ui/jquery.ui.effect-transfer.min.js
jquery-ui-accordion
/wp-includes/js/jquery/ui/jquery.ui.accordion.min.js
jquery-ui-autocomplete
/wp-includes/js/jquery/ui/jquery.ui.autocomplete.min.js
jquery-ui-button
/wp-includes/js/jquery/ui/jquery.ui.button.min.js
jquery-ui-datepicker
/wp-includes/js/jquery/ui/jquery.ui.datepicker.min.js
jquery-ui-dialog
/wp-includes/js/jquery/ui/jquery.ui.dialog.min.js
jquery-ui-draggable
/wp-includes/js/jquery/ui/jquery.ui.draggable.min.js
jquery-ui-droppable
/wp-includes/js/jquery/ui/jquery.ui.droppable.min.js
jquery-ui-menu
/wp-includes/js/jquery/ui/jquery.ui.menu.min.js
jquery-ui-mouse
/wp-includes/js/jquery/ui/jquery.ui.mouse.min.js
jquery-ui-position
/wp-includes/js/jquery/ui/jquery.ui.position.min.js
jquery-ui-progressbar
/wp-includes/js/jquery/ui/jquery.ui.progressbar.min.js
jquery-ui-resizable
/wp-includes/js/jquery/ui/jquery.ui.resizable.min.js
jquery-ui-selectable
/wp-includes/js/jquery/ui/jquery.ui.selectable.min.js
jquery-ui-slider
/wp-includes/js/jquery/ui/jquery.ui.slider.min.js
jquery-ui-sortable
/wp-includes/js/jquery/ui/jquery.ui.sortable.min.js
jquery-ui-spinner
/wp-includes/js/jquery/ui/jquery.ui.spinner.min.js
jquery-ui-tabs
/wp-includes/js/jquery/ui/jquery.ui.tabs.min.js
jquery-ui-tooltip
/wp-includes/js/jquery/ui/jquery.ui.tooltip.min.js
jquery-ui-widget
/wp-includes/js/jquery/ui/jquery.ui.widget.min.js
jquery-form
/wp-includes/js/jquery/jquery.form.js
jquery-color
/wp-includes/js/jquery/jquery.color.min.js
/wp-includes/js/jquery/suggest.js
/wp-includes/js/jquery/jquery.schedule.js
jquery-query
/wp-includes/js/jquery/jquery.query.js
jquery-serialize-object
/wp-includes/js/jquery/jquery.serialize-object.js
jquery-hotkeys
/wp-includes/js/jquery/jquery.hotkeys.js
jquery-table-hotkeys
/wp-includes/js/jquery/jquery.table-hotkeys.js
jquery-touch-punch
/wp-includes/js/jquery/jquery.ui.touch-punch.js
jquery-masonry
/wp-includes/js/jquery/jquery.masonry.min.js
/wp-includes/js/thickbox/thickbox.js
/wp-includes/js/jcrop/jquery.Jcrop.js
/wp-includes/js/swfobject.js
/wp-includes/js/plupload/plupload.js
plupload-html5
wp-includes/js/plupload/plupload.html5.js
plupload-flash
/wp-includes/js/plupload/plupload.flash.js"
plupload-silverlight
/wp-includes/js/plupload/plupload.silverlight.js
plupload-html4
/wp-includes/js/plupload/plupload.html4.js
plupload-all
plupload, plupload-html5, plupload-flash, plupload-silverlight, plupload-html4
plupload-handlers
/wp-includes/js/plupload/handlers.js
wp-plupload
/wp-includes/js/plupload/wp-plupload.js
/wp-includes/js/swfupload/swfupload.js
swfupload-swfobject
/wp-includes/js/swfupload/plugins/swfupload.swfobject.js
swfupload-queue
/wp-includes/js/swfupload/plugins/swfupload.queue.js
swfupload-speed
/wp-includes/js/swfupload/plugins/swfupload.speed.js
swfupload-all
/wp-includes/js/swfupload/swfupload-all.js
swfupload-handlers
/wp-includes/js/swfupload/handlers.js
comment-reply
/wp-includes/js/comment-reply.js
/wp-includes/js/json2.js
underscore
/wp-includes/js/underscore.min.js
/wp-includes/js/backbone.min.js
/wp-includes/js/wp-util.js
wp-backbone
/wp-includes/js/wp-backbone.js
/wp-admin/js/revisions.js
imgareaselect
/wp-includes/js/imgareaselect/jquery.imgareaselect.js
mediaelement
/wp-includes/js/mediaelement/mediaelement-and-player.min.js
wp-mediaelement
/wp-includes/js/mediaelement/wp-mediaelement.js
zxcvbn-async
/wp-includes/js/zxcvbn-async.js
password-strength-meter
/wp-admin/js/password-strength-meter.js
user-profile
/wp-admin/js/user-profile.js
user-suggest
/wp-admin/js/user-suggest.js
/wp-includes/js/admin-bar.js
/wp-includes/js/wplink.js
/wp-includes/js/tinymce/plugins/wpdialogs/js/wpdialog.js
wpdialogs-popup
/wp-includes/js/tinymce/plugins/wpdialogs/js/popup.js
word-count
/wp-admin/js/word-count.js
media-upload
/wp-admin/js/media-upload.js
hoverIntent
/wp-includes/js/hoverIntent.js
customize-base
/wp-includes/js/customize-base.js
customize-loader
customize-preview
customize-controls
media-models
media-views
media-editor
admin-tags
admin-comments
admin-gallery
admin-widgets
theme-install
inline-edit-post
inline-edit-tax
plugin-install
farbtastic
wp-color-picker
list-revisions
image-edit
set-post-thumbnail
custom-header
custom-background
media-gallery
svg-painter
The function should be called using the
if you want to call it on the front-end of the site. To call it on the , use the
action hook. For the , use the
action hook. Calling it outside of an action hook can lead to problems, see the
for details. Also see
for more details about the proper hooks.
If you try to register or enqueue an already registered handle with different parameters, the new parameters will be ignored. Instead, use
and register the script again with the new parameters.
jQuery UI Effects is not included with the jquery-ui-core handle.
Uses: WP_Scripts::add() and WP_Scripts::add_data().
Uses global: (unknown type) $wp_scripts.
Technically, you never have to register anything if you don't want to. The register functions are there and can be valuable if you want a central location that defines scripts and styles that will be used in your plugin/theme. You can then simply use the enqueue functions while referring to just the handle in order to enqueue the script or style for inclusion in the head.
If the handle of a registered script is listed in the $deps array of dependencies of another script that is enqueued with wp_enqueue_script(), that script will be automatically loaded prior to loading the enqueued script. This greatly simplifies the process of ensuring that a script has all the dependencies it needs. See below for a simple example.
So, the main purpose of the register functions is to allow you to simplify your code by removing the need to duplicate code if you enqueue the same script or style in more than one section of code. The benefits of this are many and probably don't need to be listed here.
This example demonstrates how a registered script is automatically loaded when listed as the dependency of an enqueued script:
// Always use wp_enqueue_scripts action hook to both enqueue and register scripts
add_action( 'wp_enqueue_scripts', 'enqueue_and_register_my_scripts' );
function enqueue_and_register_my_scripts(){
// Use `get_stylesheet_directroy_uri() if your script is inside your theme or child theme.
wp_register_script( 'my-script', get_stylesheet_directory_uri() . '/js/my-script.js' );
// Let's enqueue a script only to be used on a specific page of the site
if ( is_page( 'careers' ) ){
// Enqueue a script that has both jQuery (automatically registered by WordPress)
// and my-script (registered earlier) as dependencies.
wp_enqueue_script( 'my-careers-script', get_stylesheet_directory_uri() . '/js/my-careers-script.js', array( 'jquery', 'my-script' ) );
Note how, in the example above, `my-script.js` does not actually have to be enqueued. It is automatically loaded before `my-careers-script.js` by virtue of the fact that it was registered.
It's also interesting to note that, given how the `wp_enqueue_scripts` action works, the order in which scripts are enqueued or registered is quite inconsequential. Really.
(BackPress version: r16)
wp_register_script() is located in .
Enqueue Scripts
wp_register_script()
Enqueue Styles
Front-End Hooks
Admin Hooks
Login Hooks
See also index of
and index of .
This article is
as in need of editing. You can
Codex by .
Codex Resources
Code is Poetry25 Useful Basic Commands of APT-GET and APT-CACHE for Package Management
Last Updated: January 3, 2015
Download Your Free eBooks NOW -
This article explains how quickly you can learn to install, remove, update and search software packages using apt-get and apt-cache commands from the command line. This article provides some useful commands that will help you to handle package management in Debian/Ubuntu based systems.
APT-GET and APT-CACHE Commands
What is apt-get?
The apt-get utility is a powerful and free package management command line program, that is used to work with Ubuntu’s APT (Advanced Packaging Tool) library to perform installation of new software packages, removing existing software packages, upgrading of existing software packages and even used to upgrading the entire operating system.
What is apt-cache?
The apt-cache command line tool is used for searching apt software package cache. In simple words, this tool is used to search software packages, collects information of packages and also used to search for what available packages are ready for installation on Debian or Ubuntu based systems.
APT-CACHE – 5 Useful Basic Commands
1. How Do I List All Available Packages?
To list all the available packages, type the following command.
$ apt-cache pkgnames
esseract-ocr-epo
pipenightdreams
tbb-examples
libsvm-java
libmrpt-hmtslam0.9
libboost-timer1.50-dev
kcm-touchpad
g++-4.5-multilib
2. How Do I Find Out Package Name and Description of Software?
To find out the package name and with it description before installing, use the ‘search‘ flag. Using “search” with apt-cache will display a list of matched packages with short description. Let’s say you would like to find out description of package ‘vsftpd‘, then command would be.
$ apt-cache search vsftpd
vsftpd - lightweight, efficient FTP server written for security
ccze - A robust, modular log coloriser
ftpd - File Transfer Protocol (FTP) server
yasat - simple stupid audit tool
To find and list down all the packages starting with ‘vsftpd‘, you could use the following command.
$ apt-cache pkgnames vsftpd
3. How Do I Check Package Information?
For example, if you would like to check information of package along with it short description say (version number, check sums, size, installed size, category etc). Use ‘show‘ sub command as shown below.
$ apt-cache show netcat
Package: netcat
Priority: optional
Section: universe/net
Installed-Size: 30
Maintainer: Ubuntu Developers &ubuntu-devel-discuss@&
Original-Maintainer: Ruben Molina &rmolina@udea.edu.co&
Architecture: all
Version: 1.10-40
Depends: netcat-traditional (&= 1.10-39)
Filename: pool/universe/n/netcat/netcat_1.10-40_all.deb
Size: 3340
MD5sum: 37c303f02bfc9fb8b2c1004
SHA1: 4fbb6fb898bcea3a
SHA256: eeecb4c93f03f455d2c3f57b0a1e83b54dbecede86a37bcc16c9
Description-en: TCP/IP swiss army knife -- transitional package
This is a "dummy" package that depends on lenny's default version of
netcat, to ease upgrades. It may be safely removed.
Description-md5: d80319bdde09
Bugs: https://bugs.launchpad.net/ubuntu/+filebug
Origin: Ubuntu
4. How Do I Check Dependencies for Specific Packages?
Use the ‘showpkg‘ sub command to check the dependencies for particular software packages. whether those dependencies packages are installed or not. For example, use the ‘showpkg‘ command along with package-name.
$ apt-cache showpkg vsftpd
Package: vsftpd
2.3.5-3ubuntu1 (/var/lib/apt/lists/in._ubuntu_dists_quantal_main_binary-i386_Packages)
Description Language:
File: /var/lib/apt/lists/in._ubuntu_dists_quantal_main_binary-i386_Packages
MD5: a5ea48f8db0b023f3f9b
Description Language: en
File: /var/lib/apt/lists/in._ubuntu_dists_quantal_main_i18n_Translation-en
MD5: a5ea48f8db0b023f3f9b
Reverse Depends:
ubumirror,vsftpd
harden-servers,vsftpd
Dependencies:
2.3.5-3ubuntu1 - debconf (18 0.5) debconf-2.0 (0 (null)) upstart-job (0 (null)) libc6 (2 2.15) libcap2 (2 2.10) libpam0g (2 0.99.7.1) libssl1.0.0 (2 1.0.0) libwrap0 (2 7.6-4~) adduser (0 (null)) libpam-modules (0 (null)) netbase (0 (null)) logrotate (0 (null)) ftp-server (0 (null)) ftp-server (0 (null))
2.3.5-3ubuntu1 - ftp-server
Reverse Provides:
5. How Do I Check statistics of Cache
The ‘stats‘ sub command will display overall statistics about the cache. For example, the following command will display Total package names is the number of packages have found in the cache.
$ apt-cache stats
Total package names: 5 k)
Total package structures: 5 k)
Normal packages: 39505
Pure virtual packages: 602
Single virtual packages: 3819
Mixed virtual packages: 1052
Missing: 6890
Total distinct versions: 4 k)
Total distinct descriptions: 8 k)
Total dependencies: ,064 k)
Total ver/file relations: 4 k)
Total Desc/File relations: 8 k)
Total Provides mappings:
Total globbed strings: 286 (3,518 )
Total dependency version space: 1,145 k
Total slack space: 62.6 k
Total space accounted for: 13.3 M
APT-GET – 20 Useful Basic Commands for Package Management
6. How to Update System Packages
The ‘update‘ command is used to resynchronize the package index files from the their sources specified in /etc/apt/sources.list file. The update command fetched the packages from their locations and update the packages to newer version.
$ sudo apt-get update
[sudo] password for tecmint:
quantal-security InRelease
quantal-security Release.gpg [933 B]
quantal-security Release [49.6 kB]
Ign http://in. quantal InRelease
Ign http://in. quantal-updates InRelease
Get:3 http://repo.varnish-cache.org precise InRelease [13.7 kB]
Ign http://in. quantal-backports InRelease
Hit http://in. quantal Release.gpg
quantal-security/main Sources [34.8 kB]
Get:5 http://in. quantal-updates Release.gpg [933 B]
7. How to Upgrade Software Packages
The ‘upgrade‘ command is used to upgrade all the currently installed software packages on the system. Under any circumstances currently installed packages are not removed or packages which are not already installed neither retrieved and installed to satisfy upgrade dependencies.
$ sudo apt-get upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages have been kept back:
linux-headers-generic linux-image-generic wine1.5 wine1.5-i386
The following packages will be upgraded:
activity-log-manager-common activity-log-manager-control-center adium-theme-ubuntu alacarte
alsa-base app-install-data-partner appmenu-gtk appmenu-gtk3 apport apport-gtk apt
apt-transport-https apt-utils aptdaemon aptdaemon-data at-spi2-core bamfdaemon base-files bind9-host
However, if you want to upgrade, unconcerned of whether software packages will be added or removed to fulfill dependencies, use the ‘dist-upgrade‘ sub command.
$ sudo apt-get dist-upgrade
8. How Do I Install or Upgrade Specific Packages?
The ‘install‘ sub command is tracked by one or more packages wish for installation or upgrading.
$ sudo apt-get install netcat
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
netcat-traditional
The following NEW packages will be installed:
netcat netcat-traditional
0 upgraded, 2 newly installed, 0 to remove and 328 not upgraded.
Need to get 67.1 kB of archives.
After this operation, 186 kB of additional disk space will be used.
Do you want to continue [Y/n]? y
Get:1 http://in./ubuntu/ quantal/universe netcat-traditional i386 1.10-40 [63.8 kB]
Get:2 http://in./ubuntu/ quantal/universe netcat all 1.10-40 [3,340 B]
Fetched 67.1 kB in 1s (37.5 kB/s)
Selecting previously unselected package netcat-traditional.
(Reading database ... 216118 files and directories currently installed.)
Unpacking netcat-traditional (from .../netcat-traditional_1.10-40_i386.deb) ...
Selecting previously unselected package netcat.
Unpacking netcat (from .../netcat_1.10-40_all.deb) ...
Processing triggers for man-db ...
Setting up netcat-traditional (1.10-40) ...
Setting up netcat (1.10-40) ...
9. How I can Install Multiple Packages?
You can add more than one package name along with the command in order to install multiple packages at the same time. For example, the following command will install packages ‘‘ and ‘‘.
$ sudo apt-get install nethogs goaccess
Reading package lists... Done
Building dependency tree
Reading state information... Done
goaccess is already the newest version.
nethogs is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 328 not upgraded.
10. How to Install Several Packages using Wildcard
With the help of regular expression you can add several packages with one string. For example, we use * wildcard to install several packages that contains the ‘*name*‘ string, name would be ‘package-name’.
$ sudo apt-get install '*name*'
11. How to install Packages without Upgrading
Using sub ‘–no-upgrade‘ command will prevent already installed packages from upgrading.
$ sudo apt-get install packageName --no-upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
Skipping vsftpd, it is already installed and upgrade is not set.
0 upgraded, 0 newly installed, 0 to remove and 328 not upgraded.
12. How to Upgrade Only Specific Packages
The ‘–only-upgrade‘ command do not install new packages but it only upgrade the already installed packages and disables new installation of packages.
$ sudo apt-get install packageName --only-upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
vsftpd is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 328 not upgraded.
13. How Do I Install Specific Package Version?
Let’s say you wish to install only specific version of packages, simply use the ‘=‘ with the package-name and append desired version.
$ sudo apt-get install vsftpd=2.3.5-3ubuntu1
Reading package lists... Done
Building dependency tree
Reading state information... Done
vsftpd is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 328 not upgraded.
14. How Do I Remove Packages Without Configuration
To un-install software packages without removing their configuration files (for later re-use the same configuration). Use the ‘remove‘ command as shown.
$ sudo apt-get remove vsftpd
[sudo] password for tecmint:
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be REMOVED:
0 upgraded, 0 newly installed, 1 to remove and 328 not upgraded.
After this operation, 364 kB disk space will be freed.
Do you want to continue [Y/n]? y
(Reading database ... 216156 files and directories currently installed.)
Removing vsftpd ...
vsftpd stop/waiting
Processing triggers for ureadahead ...
Processing triggers for man-db ...
15. How Do I Completely Remove Packages
To remove software packages including their configuration files, use the ‘purge‘ sub command as shown below.
$ sudo apt-get purge vsftpd
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be REMOVED:
0 upgraded, 0 newly installed, 1 to remove and 328 not upgraded.
After this operation, 0 B of additional disk space will be used.
Do you want to continue [Y/n]? y
(Reading database ... 216107 files and directories currently installed.)
Removing vsftpd ...
Purging configuration files for vsftpd ...
Processing triggers for ureadahead ...
Alternatively, you can combine both the commands together as shown below.
$ sudo apt-get remove --purge vsftpd
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be REMOVED:
0 upgraded, 0 newly installed, 1 to remove and 328 not upgraded.
After this operation, 364 kB disk space will be freed.
Do you want to continue [Y/n]? y
(Reading database ... 216156 files and directories currently installed.)
Removing vsftpd ...
vsftpd stop/waiting
Purging configuration files for vsftpd ...
Processing triggers for ureadahead ...
Processing triggers for man-db ...
16. How I Can Clean Up Disk Space
The ‘clean‘ command is used to free up the disk space by cleaning retrieved (downloaded) .deb files (packages) from the local repository.
$ sudo apt-get clean
17. How Do I Download Only Source Code of Package
To download only source code of particular package, use the option ‘–download-only source‘ with ‘package-name’ as shown.
$ sudo apt-get --download-only source vsftpd
Reading package lists... Done
Building dependency tree
Reading state information... Done
Need to get 220 kB of source archives.
Get:1 http://in./ubuntu/ quantal/main vsftpd 2.3.5-3ubuntu1 (dsc) [1,883 B]
Get:2 http://in./ubuntu/ quantal/main vsftpd 2.3.5-3ubuntu1 (tar) [188 kB]
Get:3 http://in./ubuntu/ quantal/main vsftpd 2.3.5-3ubuntu1 (diff) [30.5 kB]
Fetched 220 kB in 4s (49.1 kB/s)
Download complete and in download only mode
18. How Can I Download and Unpack a Package
To download and unpack source code of a package to a specific directory, type the following command.
$ sudo apt-get source vsftpd
Reading package lists... Done
Building dependency tree
Reading state information... Done
Need to get 220 kB of source archives.
Get:1 http://in./ubuntu/ quantal/main vsftpd 2.3.5-3ubuntu1 (dsc) [1,883 B]
Get:2 http://in./ubuntu/ quantal/main vsftpd 2.3.5-3ubuntu1 (tar) [188 kB]
Get:3 http://in./ubuntu/ quantal/main vsftpd 2.3.5-3ubuntu1 (diff) [30.5 kB]
Fetched 220 kB in 1s (112 kB/s)
gpgv: Signature made Thursday 24 May :09 AM IST using RSA key ID 2C48EE4E
gpgv: Can't check signature: public key not found
dpkg-source: warning: failed to verify signature on ./vsftpd_2.3.5-3ubuntu1.dsc
dpkg-source: info: extracting vsftpd in vsftpd-2.3.5
dpkg-source: info: unpacking vsftpd_2.3.5.orig.tar.gz
dpkg-source: info: unpacking vsftpd_2.3.5-3ubuntu1.debian.tar.gz
dpkg-source: info: applying 01-builddefs.patch
dpkg-source: info: applying 02-config.patch
dpkg-source: info: applying 03-db-doc.patch
dpkg-source: info: applying 04-link-local.patch
dpkg-source: info: applying 05-whitespaces.patch
dpkg-source: info: applying 06-greedy.patch
dpkg-source: info: applying 07-utf8.patch
dpkg-source: info: applying 08-manpage.patch
dpkg-source: info: applying 09-s390.patch
dpkg-source: info: applying 10-remote-dos.patch
dpkg-source: info: applying 11-alpha.patch
dpkg-source: info: applying 09-disable-anonymous.patch
dpkg-source: info: applying 12-ubuntu-use-snakeoil-ssl.patch
19. How Can I Download, Unpack and Compile a Package
You can also download, unpack and compile the source code at the same time, using option ‘–compile‘ as shown below.
$ sudo apt-get --compile source goaccess
[sudo] password for tecmint:
Reading package lists... Done
Building dependency tree
Reading state information... Done
Need to get 130 kB of source archives.
Get:1 http://in./ubuntu/ quantal/universe goaccess 1:0.5-1 (dsc) [1,120 B]
Get:2 http://in./ubuntu/ quantal/universe goaccess 1:0.5-1 (tar) [127 kB]
Get:3 http://in./ubuntu/ quantal/universe goaccess 1:0.5-1 (diff) [2,075 B]
Fetched 130 kB in 1s (68.0 kB/s)
gpgv: Signature made Tuesday 26 June :24 AM IST using DSA key ID A9FD4821
gpgv: Can't check signature: public key not found
dpkg-source: warning: failed to verify signature on ./goaccess_0.5-1.dsc
dpkg-source: info: extracting goaccess in goaccess-0.5
dpkg-source: info: unpacking goaccess_0.5.orig.tar.gz
dpkg-source: info: unpacking goaccess_0.5-1.debian.tar.gz
dpkg-buildpackage: source package goaccess
dpkg-buildpackage: source version 1:0.5-1
dpkg-buildpackage: source changed by Chris Taylor &ctaylor@debian.org&
dpkg-buildpackage: host architecture i386
dpkg-source --before-build goaccess-0.5
dpkg-checkbuilddeps: Unmet build dependencies: debhelper (&= 9) autotools-dev libncurses5-dev libglib2.0-dev libgeoip-dev autoconf
dpkg-buildpackage: warning: build dependencies/c aborting
dpkg-buildpackage: warning: (Use -d flag to override.)
20. How Do I Download a Package Without Installing
Using ‘download‘ option, you can download any given package without installing it. For example, the following command will only download ‘nethogs‘ package to current working directory.
$ sudo apt-get download nethogs
Get:1 Downloading nethogs 0.8.0-1 [27.1 kB]
Fetched 27.1 kB in 3s (7,506 B/s)
21. How Do I Check Change Log of Package?
The ‘changelog‘ flag downloads a package change-log and shows the package version that is installed.
$ sudo apt-get changelog vsftpd
vsftpd (2.3.5-3ubuntu1) urgency=low
* Merge from Debian testing (LP: #1003644).
Remaining changes:
+ debian/vsftpd.upstart: migrate vsftpd to upstart.
+ Add apport hook (LP: #513978):
- debian/vsftpd.apport: Added.
- debian/control: Build-depends on dh-apport.
- debian/rules: Add --with apport.
+ Add debian/watch file.
+ debian/patches/09-disable-anonymous.patch: Disable anonymous login
by default. (LP: #528860)
* debian/patches/12-ubuntu-us-snakeoil-ssl.patch: Use snakeoil SSL
certificates and key.
-- Andres Rodriguez &&
Wed, 23 May :36 -0400
22. How Do I Check Broken Dependencies?
The ‘check‘ command is a diagnostic tool. It used to update package cache and checks for broken dependencies.
$ sudo apt-get check
[sudo] password for tecmint:
Reading package lists... Done
Building dependency tree
Reading state information... Done
23. How Do I Search and Build Dependencies?
This ‘build-dep‘ command searches the local repositories in the system and install the build dependencies for package. If the package does not exists in the local repository it will return an error code.
$ sudo apt-get build-dep netcat
The following NEW packages will be installed:
debhelper dh-apparmor html2text po-debconf quilt
0 upgraded, 5 newly installed, 0 to remove and 328 not upgraded.
Need to get 1,219 kB of archives.
After this operation, 2,592 kB of additional disk space will be used.
Do you want to continue [Y/n]? y
Get:1 http://in./ubuntu/ quantal/main html2text i386 1.3.2a-15build1 [91.4 kB]
Get:2 http://in./ubuntu/ quantal/main po-debconf all 1.0.16+nmu2ubuntu1 [210 kB]
Get:3 http://in./ubuntu/ quantal/main dh-apparmor all 2.8.0-0ubuntu5 [9,846 B]
Get:4 http://in./ubuntu/ quantal/main debhelper all 9.ubuntu1 [623 kB]
Get:5 http://in./ubuntu/ quantal/main quilt all 0.60-2 [285 kB]
Fetched 1,219 kB in 4s (285 kB/s)
24. How I Can Auto clean Apt-Get Cache?
The ‘autoclean‘ command deletes all .deb files from /var/cache/apt/archives to free-up significant volume of disk space.
$ sudo apt-get autoclean
Reading package lists... Done
Building dependency tree
Reading state information... Done
25. How I Can Auto remove Installed Packages?
The ‘autoremove‘ sub command is used to auto remove packages that were certainly installed to satisfy dependencies for other packages and but they were now no longer required. For example, the following command will remove an installed package with its dependencies.
$ sudo apt-get autoremove vsftpd
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package 'vsftpd' is not installed, so not removed
0 upgraded, 0 newly installed, 0 to remove and 328 not upgraded.
I’ve covered most of the available options with apt-get and apt-cache commands, but still there are more options available, you can check them out using ‘man apt-get‘ or ‘man apt-cache‘ from the terminal. I hope you enjoyed reading this article, If I’ve missed anything and you would like me to add to the list. Please feel free to mention in the comment below.
Read Also :
Ravi Saive
Simple Word a Computer Geek and Linux Guru who loves to share tricks and tips on Internet. Most Of My Servers runs on Open Source Platform called Linux.
Receive Your Free Complimentary eBook NOW! -
Download Free Linux eBooks
Download Free Linux eBooks
Free eBook
Join Over 70000+ Linux Users
Enter your email to get latest Linux Howto's}

我要回帖

更多关于 truth that you leave 的文章

更多推荐

版权声明:文章内容来源于网络,版权归原作者所有,如有侵权请点击这里与我们联系,我们将及时删除。

点击添加站长微信