Home IT Linux Windows Database Network Programming Server Mobile  
  Home \ Linux \ apt-get and apt-cache show command examples     - How to modify the Linux NIC eth1 to eth0 (Linux)

- Linux System Getting Started Learning: modify environment variables in Linux PATH (Linux)

- Linux Beginner Guide: Installing packages on Ubuntu and Fedora (Linux)

- Perl said method B if A judge (Programming)

- Oracle 11g logical standby achieve BI needs (Database)

- Nginx version information hidden or modified (Server)

- To convert into a binary search tree sorted doubly linked list (Programming)

- Linux user directory (Linux)

- Use smartmontools view the health status of hard disk (Linux)

- Install Mac OS X 10.9 systems VMware10 (Linux)

- Linux console password solution (Programming)

- Using packet capture libpcap be reconciliation package in Ubuntu 14.04 64 bits (Linux)

- DataGuard a hardware issue warnings found (Database)

- Management DB2 logs (Database)

- VNC configuration detailed analysis under Linux (Linux)

- Ubuntu terminal command - see the port occupied and off (Linux)

- Classical sorting algorithm - Selection Sort (Linux)

- Talk about Java in the collection (Programming)

- Configuring a Linux operating system security management services (Linux)

- Source code to compile and install MySQL 5.7.9 (Database)

  apt-get and apt-cache show command examples
  Add Date : 2017-04-13      
  Apt-get and apt-cache is a package management tool for Ubuntu Linux command line under. GUI version apt-get is the Synaptic package manager. This blog entry we will show 15 different examples of apt-get and apt-cache commands.

Example: 1 lists all the available packages

linuxhost @ localhost: ~ $ apt-cache pkgnames
dvd + rw-tools
Example: 2 with keyword search package

This is useful when you are unsure of the name of the package is useful, as long as the apt-cache (LCTT Annotation: This description is apt-get, should be a typo) behind the input packet related keywords.

linuxhost @ localhost: ~ $ apt-cache search "web server"
apache2 -Apache HTTP Server
apache2-bin -Apache HTTP Server (binary files and modules)
apache2-data -Apache HTTP Server (common files)
apache2-dbg -Apache debugging symbols
apache2-dev -Apache HTTP Server (development headers)
apache2-doc -Apache HTTP Server (on-site documentation)
apache2-utils -Apache HTTP Server (utility programs for web servers)
.................................................. ....................
Note: If you install "apt-file" package, so we can use the configuration file search package as follows.

linuxhost @ localhost: ~ $ apt-file search nagios.cfg
ganglia-nagios-bridge: /usr/share/doc/ganglia-nagios-bridge/nagios.cfg
nagios3-common: /etc/nagios3/nagios.cfg
nagios3-common: /usr/share/doc/nagios3-common/examples/nagios.cfg.gz
pnp4nagios-bin: /etc/pnp4nagios/nagios.cfg
pnp4nagios-bin: /usr/share/doc/pnp4nagios/examples/nagios.cfg
Example: 3 displays basic information about a specific package

linuxhost @ localhost: ~ $ apt-cache show postfix
Package: postfix
Priority: optional
Section: mail
Installed-Size: 3524
Maintainer: LaMontJones
Architecture: amd64
Version: 2.11.1-1
Replaces: mail-transport-agent
Provides: default-mta, mail-transport-agent
.................................................. ...
Example: 4 shows the dependencies

linuxhost @ localhost: ~ $ apt-cache depends postfix
Depends: libc6
Depends: libdb5.3
Depends: libsasl2-2
Depends: libsqlite3-0
Depends: libssl1.0.0
| Depends: debconf
Depends: netbase
Depends: adduser
Depends: dpkg
Example: 5 using apt-cache show cache statistics

linuxhost @ localhost: ~ $ apt-cache stats
Totalpackage names: 60877 (1,218 k)
Totalpackage structures: 102824 (5,758 k)
Normal packages: 71285
Purevirtual packages: 1102
Singlevirtual packages: 9151
Mixedvirtual packages: 1827
Missing: 19459
Total distinct versions: 74913 (5,394 k)
Total distinct descriptions: 93792 (2,251 k)
Total dependencies: 573443 (16.1 M)
Total ver / file relations: 78007 (1,872 k)
TotalDesc / File relations: 93792 (2,251 k)
TotalProvides mappings: 16583 (332 k)
Total globbed strings: 171 (2,263)
Total dependency version space: 2,665 k
Total slack space: 37.3 k
Total space accounted for: 29.5 M
Example: 6 use "apt-get update" to update all repositories

Use the command "apt-get update", we can re-synchronize files from the source repository index. Index packages retrieved from the "/etc/apt/sources.list" in.

linuxhost @ localhost: ~ $ sudo apt-get update
Ign http://extras.ubuntu.com utopic InRelease
Hit http://extras.ubuntu.com utopic Release.gpg
Hit http://extras.ubuntu.com utopic Release
Hit http://extras.ubuntu.com utopic / main Sources
Hit http://extras.ubuntu.com utopic / main amd64 Packages
Hit http://extras.ubuntu.com utopic / main i386 Packages
Ign http://in.archive.ubuntu.com utopic InRelease
Ign http://in.archive.ubuntu.com utopic-updates InRelease
Ign http://in.archive.ubuntu.com utopic-backports InRelease
.................................................. ..............
Example: 7 using apt-get install package

linuxhost @ localhost: ~ $ sudo apt-get install icinga
The above command installs called "icinga" package.

Example: 8 upgrade all installed packages

linuxhost @ localhost: ~ $ sudo apt-get upgrade
Example: 9 update a specific package

In the apt-get command "install" option to connect later "-only-upgrade" is used to update a specific package, as follows:

linuxhost @ localhost: ~ $ sudo apt-get install filezilla --only-upgrade
Example: 10 uninstall using the apt-get package

linuxhost @ localhost: ~ $ sudo apt-get remove skype
The above command will delete skype package, if you want to delete its configuration file, use the "purge" option on apt-get command. As follows:

linuxhost @ localhost: ~ $ sudo apt-get purge skype
We can combine the above two commands:

linuxhost @ localhost: ~ $ sudo apt-get remove --purge skype
Example: 11 in the current directory in the download package

linuxhost @ localhost: ~ $ sudo apt-get download icinga
Get: 1 http://in.archive.ubuntu.com/ubuntu/ utopic / universe icinga amd64 1.11.6-1build1 [1,474 B]
Fetched1,474 B in1s (1,363 B / s)
The above package icinga directory will be downloaded to your current working directory.

Example: 12 to clean up the disk space occupied by the local package

linuxhost @ localhost: ~ $ sudo apt-get clean
The above command will clear the apt-get package downloaded the disk space occupied.

We can also use the "autoclean" option instead of "clean", the main difference between the two is no longer in use and autoclean clean up useless downloads.

linuxhost @ localhost: ~ $ sudo apt-get autoclean
Readingpackage lists ... Done
Building dependency tree
Reading state information ... Done
Example: Use 13 "autoremove" Delete package

When using "autoremove" in the apt-get command, it removes reliance in order to meet the installation package and is now useless.

linuxhost @ localhost: ~ $ sudo apt-get autoremove icinga
Example: 14 shows the log update package

linuxhost @ localhost: ~ $ sudo apt-get changelog apache2
Get: 1Changelogfor apache2 (http://changelogs.ubuntu.com/changelogs/pool/main/a/apache2/apache2_2.4.10-1ubuntu1/changelog) [195 kB]
Fetched195 kB in3s (60.9 kB / s)
The above command will download the update for apache2 logs and tabs displayed on your screen.

Example: 15 Using "check" option displays the damage dependence

linuxhost @ localhost: ~ $ sudo apt-get check
Readingpackage lists ... Done
Building dependency tree
Reading state information ... Done
- RPM package management tools under Linux (Linux)
- Zend Studio PHP syntax color scheme to export (Linux)
- SSH service configuration to use a certificate login Linux server (Server)
- Radius server setup under CentOS (Server)
- OGG-03510 Problem (Database)
- Install Java, Maven, Tomcat under Linux (Linux)
- C ++ casts New Standard Comments (Programming)
- WEB-based Android Remote Tools Python implementation (Programming)
- exp / imp Export Import version of the problem and the ORA-6550 error (Database)
- iOS GCD multithreading simple to use (Programming)
- Oracle query start with connect by tree (Database)
- Python Django direct implementation of sql statement (Programming)
- Ubuntu 14.04 install AMD graphics driver is fully dual monitor solution (Linux)
- Hibernate4 The Hello World (basic environmental structures) (Programming)
- C ++ Supplements - malloc free and new delete the same and different (Programming)
- Lazarus IDE Start Basics Tutorial (Linux)
- Linux system package manager -RPM (Linux)
- NaSC using simple mathematical operations on Ubuntu and Elementary OS (Linux)
- Customize the 404 error page Nginx (Server)
- To configure parameter configuration and software installation and uninstallation under Linux (Linux)
  CopyRight 2002-2016 newfreesoft.com, All Rights Reserved.