Professional Documents
Culture Documents
http://www.tecmint.com/useful-basic-commands-of-apt-ge...
Search
Home Linux Distros Open Source Web Servers Apache Nginx Lighttpd Databases MySQL MongoDB CouchDB Free Linux eBooks Linux Commands
Select Language
Powered by
TranslateDID
1 of 13
10/01/2013 12:35 PM
http://www.tecmint.com/useful-basic-commands-of-apt-ge...
The apt-get utility is a powerful and free package management command line program, that is used to work with Ubuntus 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.
To nd and list down all the packages starting with vsftpd, you could use the following command.
$ apt-cache pkgnames vsftpd vsttpd
2 of 13
10/01/2013 12:35 PM
http://www.tecmint.com/useful-basic-commands-of-apt-ge...
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) libssl Provides: 2.3.5-3ubuntu1 - ftp-server Reverse Provides:
3 of 13
10/01/2013 12:35 PM
http://www.tecmint.com/useful-basic-commands-of-apt-ge...
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 fulll dependencies, use the dist-upgrade sub command.
$ sudo apt-get dist-upgrade
4 of 13
10/01/2013 12:35 PM
http://www.tecmint.com/useful-basic-commands-of-apt-ge...
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:
5 of 13
10/01/2013 12:35 PM
http://www.tecmint.com/useful-basic-commands-of-apt-ge...
vsftpd* 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 ...
6 of 13
10/01/2013 12:35 PM
http://www.tecmint.com/useful-basic-commands-of-apt-ge...
Need to get 130 kB of source archives. Get:1 http://in.archive.ubuntu.com/ubuntu/ quantal/universe goaccess 1:0.5-1 (dsc) [1,120 B] Get:2 http://in.archive.ubuntu.com/ubuntu/ quantal/universe goaccess 1:0.5-1 (tar) [127 kB] Get:3 http://in.archive.ubuntu.com/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 2012 09:38: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/conflicts unsatisfied; aborting dpkg-buildpackage: warning: (Use -d flag to override.) ...
7 of 13
10/01/2013 12:35 PM
http://www.tecmint.com/useful-basic-commands-of-apt-ge...
Get:3 http://in.archive.ubuntu.com/ubuntu/ quantal/main dh-apparmor all 2.8.0-0ubuntu5 [9,846 B] Get:4 http://in.archive.ubuntu.com/ubuntu/ quantal/main debhelper all 9.20120608ubuntu1 [623 kB] Get:5 http://in.archive.ubuntu.com/ubuntu/ quantal/main quilt all 0.60-2 [285 kB] Fetched 1,219 kB in 4s (285 kB/s) ...
Ive 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 Ive missed anything and you would like me to add to the list. Please feel free to mention in the comment below. Read Also : 20 Useful Linux YUM Commands for Package Management
Bio Latest Posts
Ravi Saive
Owner at TecMint.com
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.
Debian
7 Linux
Install Deb
RPM
Our post is simply DIY aka Do It Yourself, still you may nd diculties and want us to help you out. We oer wide range of Linux and Web Hosting Solutions at fair minimum rates. Please submit your orders by Clicking Here. 61
Tweet
303
Like
8 of 13
10/01/2013 12:35 PM
http://www.tecmint.com/useful-basic-commands-of-apt-ge...
470
7
Share
11 comments
Quick weight loss tips Quick weight loss pills Packages Working at home Packaging Searches Oracle Database How to manage
Previous Post 10 Useful IP Commands to Congure Network Interfaces Next Post 20 Practical Examples of RPM Commands in Linux
Related Post(s):
1. How to Synchronize Time with NTP Server in Ubuntu / Linux Mint / Xubuntu / Debian 2. Linux Mint 15 Codename (Olivia) Installation Guide with Screenshots 3. Firefox 17 Released, Adds New Facebook Messenger Install in Ubuntu 12.04/12.10, Xubuntu 12.10 and Linux Mint 14/13 4. 20 Funny Commands of Linux or Linux is Fun in Terminal 5. Ubuntu Families Release 13.04 Along With Minor Updates 6. 15 Useful ifcong Commands to Congure Network Interface in Linux
11 Responses
1.
Ade Malsasa Akbar says: March 17, 2013 at 7:55 am Thank you for your this very useful apt-cheat! May I translate this into Indonesian? Thank you from Indonesia. Reply
2.
Ade Malsasa Akbar says: March 17, 2013 at 8:39 am Oh yeah, I forget. I wanna ask you: How to track dependency of 1 application in cache (/var/cache/apt/archives)? I wanna take only 1 application completely into one folder to install in another computers (sudo dpkg -i *.deb). Is it possible? I think it is possible but I dont know what the command for. You can see complete explanation here: http://ubuntuforums.org/showthread.php?t=2123602. I need this, and many users need this feature in Indonesia. I have subscribed into this post. Thank you for replying. Reply
3.
9 of 13
10/01/2013 12:35 PM
http://www.tecmint.com/useful-basic-commands-of-apt-ge...
4.
Rijal says: March 17, 2013 at 12:49 pm You miss apt-get install -f for x dependencies from oine installer like sample from Malmasa in above. Reply
5.
Dale Gulledge says: March 18, 2013 at 3:06 am Number 10 should be quoted: $ sudo apt-get install *name* Otherwise the shell will attempt to expand those wildcards using the le names in the current directory. A lot of the time, that wont be an issue, because the fallback when there is no matching le name is to pass the unexpanded string to the command. Reply Ravi Saive says: March 18, 2013 at 11:38 am Thanks corrected. Reply
6.
rmatey180 says: March 18, 2013 at 4:27 am I really liked the way this article presented the information. I saved it for future use. Well written. Reply
7.
Twobicycles says: March 18, 2013 at 6:23 pm Thank you for a very useful reference! I will be using this for some time to come!! Reply
8.
Dhanasekaran says: April 7, 2013 at 4:34 pm very useful information. I learn two new things no-upgrade only-upgrade apt-get source compile Reply
9.
t0m5k1 says: May 8, 2013 at 3:08 pm When I ran debian & debian based distros I always used aptitude for installing packages & upgrades as well as searches, yes I know ubuntu removed it! apt-get has some great uses (compile) but I found aptitude was far better & more intelligent in its responses. In the wrong hands apt-get can brick a system but aptitude appears to be aware of your actions & the outcome Reply
10 of 13
10/01/2013 12:35 PM
http://www.tecmint.com/useful-basic-commands-of-apt-ge...
10.
Apostolis Hardalias says: August 9, 2013 at 4:57 pm Two very handy and useful commands are: apt-cache depends which shows the package dependencies and apt-cache rdepends which shows packages depending on (reverse depends) Reply
Leave a Reply
Name (Required) Mail (will not be published) (Required) Website
Submit Comment
Twitter 1003 Twitter Facebook 15063 Facebook Google+ 564 Google+ RSS 1763 Subscribers Become A
Download Browser DFRobot Robotics Shop Linux 2GB Xen VPS $24/mo
Sponsor
Popular Latest
11 of 13
10/01/2013 12:35 PM
http://www.tecmint.com/useful-basic-commands-of-apt-ge...
Wine 1.7.2 Released Install in RHEL, CentOS and Fedora 102 Comments
Install Apache, MySQL 5.5.32 & PHP 5.5.0 on RHEL/CentOS 6.4/5.9 & Fedora 19-12 101 Comments
Install Cacti (Network Monitoring) on RHEL/CentOS 6.3/5.8 and Fedora 17-12 95 Comments
:: Advertise ::
12 of 13
10/01/2013 12:35 PM
http://www.tecmint.com/useful-basic-commands-of-apt-ge...
:: Follow Us ::
TecMint.com
Tecmint: Linux Howtos, Tutorials & Guides Follow + 624 +1
:: About ::
TecMint.com is a website that publishes practical and useful out-of-the-box articles for aspirant like you and me. We seek to present exceptional, remarkable tips, tutorials, and resources that the modern web professional will appreciate.
:: Our Services ::
Know More
We oer wide range of Linux Web Hosting and Management Services includes Linux hosting, WordPress hosting, Joomla Hosting, CMS hosting, Website migration and Custom solutions, making us a one-stop destination for all your possible hosting needs at fair minimum rates.
:: Advertise ::
Submit Order
TecMint.com is visited by tens of thousands of Linux users and has a excellent reputation in the search engine ranking. Most of the trac comes from Google organic search (80%). Spread your messages or products to an engaged readers by advertising with us. Home | Privacy Policy | Copyright Policy 2012-2013 All Rights Reserved. 25 Hardening Security Tips for Linux Servers 60 Commands of Linux : A Guide from Newbies to System Administrator 15 Command Line Tools to Monitor Linux Performance 5 Best Practices to Secure and Protect SSH Server 18 Tar Command Examples in Linux 20 Linux YUM (Yellowdog Updater, Modied) Commands 25 Useful Basic Commands of APT-GET and APT-CACHE 20 Funny Commands of Linux or Linux is Fun in Terminal 35 Practical Examples of Linux Find Command 10 Linux Distributions and Their Targeted Users Advertise Now
13 of 13
10/01/2013 12:35 PM