Home PC Games Linux Windows Database Network Programming Server Mobile  
           
  Home \ Linux \ apt-get and apt-cache show command examples     - How to use the Vault secure password storage and API key (Linux)

- CentOS7 installed MySQL (Database)

- Installation and Configuration JDK8 In CentOS 7 (Linux)

- User and user group management Linux Command (Linux)

- CentOS build JDK environment (Linux)

- Optimized to minimize the installation of CentOS 5.8 (Linux)

- Linux Security trust with users (Linux)

- Linux System Getting Started Tutorial: How do you know Shell which is currently being used (Linux)

- Lazarus for Raspbian installation (Linux)

- How to Install SeaMonkey 2.25 for Ubuntu (Linux)

- Oracle ORA-01089 failure analysis (Database)

- Protect against network attacks using Linux system firewall (Linux)

- Docker: Mirroring and container operations (Server)

- VSFTPD Security (Linux)

- Ubuntu install Liferea news subscription software (Linux)

- MySQL script incremental backups (innobackupex) (Database)

- Oracle 10g New Features - Archive Compression (Database)

- Use backup-manager system backup on Linux (Linux)

- Python programming style (Programming)

- Linux novice common commands (Linux)

 
         
  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
account-plugin-yahoojp
ceph-fuse
dvd + rw-tools
e3
gnome-commander-data
grub-gfxpayload-lists
gweled
.......................................
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
postfix
Depends: libc6
Depends: libdb5.3
Depends: libsasl2-2
Depends: libsqlite3-0
Depends: libssl1.0.0
| Depends: debconf
Depends:
cdebconf
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
     
         
         
         
  More:      
 
- Everyone should know something about TCP (Linux)
- FreeBSD install Gnome 3 Desktop (Linux)
- The execution order of Oracle WHERE condition is not from right to left (Database)
- ORA-12537: TNS: connection closed error process (Database)
- Linux (Ubuntu) How iptables port mapping (Server)
- Android imageView in the Src and Background (Programming)
- Syncthing: Private Security Synchronization tool to synchronize files between computers / folder (Linux)
- Mistakenly deleted redo log file group being given the lead to start the database ORA-03113 (Database)
- Python format string (Programming)
- Nginx concerning the location and rewrite applications proxy_pass (Server)
- Three details reflect the Unix system security (Linux)
- Examples of safety testing system notes for RedHat Linux (Linux)
- Let Ubuntu 14.04 Save screen luminance value (Linux)
- CentOS 6.4 installation environment to build Scrapy 0.22 (Linux)
- RHEL7.0 configuration CD-ROM to the local YUM (Linux)
- Linux System Getting Started Learning: Linux common log file (Linux)
- How to use Linux iptables tool for network sharing (Linux)
- RHEL 6.4 installed MySQL 5.6.27 (Database)
- Flow control message transmission between RAC (Database)
- Ubuntu 14.04 installed VirtualBox 4.3 appears vboxdrv: Unknown symbol mcount (Linux)
     
           
     
  CopyRight 2002-2022 newfreesoft.com, All Rights Reserved.