{"id":13296,"date":"2019-04-01T11:40:26","date_gmt":"2019-04-01T11:40:26","guid":{"rendered":"http:\/\/www.appservgrid.com\/paw92\/?p=13296"},"modified":"2019-04-01T11:40:26","modified_gmt":"2019-04-01T11:40:26","slug":"15-examples-of-how-to-use-new-advanced-package-tool-apt-in-ubuntu-debian","status":"publish","type":"post","link":"https:\/\/www.appservgrid.com\/paw92\/index.php\/2019\/04\/01\/15-examples-of-how-to-use-new-advanced-package-tool-apt-in-ubuntu-debian\/","title":{"rendered":"15 Examples of How to Use New Advanced Package Tool (APT) in Ubuntu\/Debian"},"content":{"rendered":"<p>One important thing to master under Linux System\/Server Administration is package management using different package management tools.<\/p>\n<p>Different Linux distributions install applications in a pre-compiled package that contain binary files, configuration files and also information about the application\u2019s dependencies.<\/p>\n<p><b>Read Also:<\/b>\u00a0<a href=\"https:\/\/www.tecmint.com\/useful-basic-commands-of-apt-get-and-apt-cache-for-package-management\/\" target=\"_blank\" rel=\"noopener\">Learn 25 \u2018apt-get\u2019 and \u2018apt-cache\u2019 Command Examples in Debian based Systems<\/a><\/p>\n<p>Package management tools help System\/Server Administrators in many ways such as:<\/p>\n<ol>\n<li>Downloading and installing software<\/li>\n<li>Compile software from source<\/li>\n<li>Keeping track of all software installed, their updates and upgrades<\/li>\n<li>Handling dependencies<\/li>\n<li>and also keeping other information about installed software and many more<\/li>\n<\/ol>\n<p>In this guide, we are going to look at\u00a0<strong>15<\/strong>\u00a0examples of how to use the new\u00a0<strong>APT<\/strong>\u00a0(Advanced Package Tool) on your Ubuntu Linux systems.<\/p>\n<p><strong>APT<\/strong>\u00a0is a command-line based tool that is used for dealing with packages on a Ubuntu based Linux systems. It presents a command line interface to the package management on your system.<\/p>\n<h3>1. Installing a Package<\/h3>\n<p>You can install a package as follows by specify a single package name or install many packages at once by listing all their names.<\/p>\n<pre>$ sudo apt install glances\r\n<\/pre>\n<div id=\"attachment_19945\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/04\/Install-Package-in-Ubuntu.png\" rel=\"attachment wp-att-19945\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-19945\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/04\/Install-Package-in-Ubuntu.png\" sizes=\"auto, (max-width: 791px) 100vw, 791px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/04\/Install-Package-in-Ubuntu.png 791w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/04\/Install-Package-in-Ubuntu-768x431.png 768w\" alt=\"Install Package in Ubuntu\" width=\"791\" height=\"444\" aria-describedby=\"caption-attachment-19945\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-19945\" class=\"wp-caption-text\">Install a Package<\/p>\n<\/div>\n<h3>2. Find Location of Installed Package<\/h3>\n<p>The following command will help you to list all the files that are contained in a package called\u00a0<a href=\"https:\/\/www.tecmint.com\/glances-an-advanced-real-time-system-monitoring-tool-for-linux\/\" target=\"_blank\" rel=\"noopener\">glances (advance Linux monitoring tool)<\/a>.<\/p>\n<pre>$ sudo apt content glances\r\n<\/pre>\n<div id=\"attachment_19947\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/04\/Find-Installed-Package-Files-Location.png\" rel=\"attachment wp-att-19947\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-19947\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/04\/Find-Installed-Package-Files-Location.png\" sizes=\"auto, (max-width: 786px) 100vw, 786px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/04\/Find-Installed-Package-Files-Location.png 786w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/04\/Find-Installed-Package-Files-Location-768x514.png 768w\" alt=\"Find Installed Package Files Location\" width=\"786\" height=\"526\" aria-describedby=\"caption-attachment-19947\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-19947\" class=\"wp-caption-text\">Find Installed Package Files Location<\/p>\n<\/div>\n<h3>3. Check All Dependencies of a Package<\/h3>\n<p>This will help you to display raw information about dependencies of a particular package that you specify.<\/p>\n<pre>$ sudo apt depends glances\r\n<\/pre>\n<div id=\"attachment_19948\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/04\/Check-Dependencies-of-Package.png\" rel=\"attachment wp-att-19948\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-19948\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/04\/Check-Dependencies-of-Package.png\" alt=\"Check Dependencies of Package\" width=\"506\" height=\"285\" aria-describedby=\"caption-attachment-19948\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-19948\" class=\"wp-caption-text\">Check Dependencies of Package<\/p>\n<\/div>\n<h3>4. Search for a Package<\/h3>\n<p>The\u00a0<strong>search<\/strong>\u00a0option searches for the given package name and show all the matching packages.<\/p>\n<pre>$ sudo apt search apache2\r\n<\/pre>\n<div id=\"attachment_19949\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/04\/Search-For-a-Package.png\" rel=\"attachment wp-att-19949\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-19949\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/04\/Search-For-a-Package.png\" sizes=\"auto, (max-width: 809px) 100vw, 809px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/04\/Search-For-a-Package.png 809w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/04\/Search-For-a-Package-768x465.png 768w\" alt=\"Search For a Package\" width=\"809\" height=\"490\" aria-describedby=\"caption-attachment-19949\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-19949\" class=\"wp-caption-text\">Search For a Package<\/p>\n<\/div>\n<h3>5. View Information About Package<\/h3>\n<p>This will help you display information about package or packages, run the command below by specifying all the packages that you want to display information about.<\/p>\n<pre>$ sudo apt show firefox\r\n<\/pre>\n<div id=\"attachment_19950\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/04\/Show-Package-Information.png\" rel=\"attachment wp-att-19950\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-19950\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/04\/Show-Package-Information.png\" sizes=\"auto, (max-width: 808px) 100vw, 808px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/04\/Show-Package-Information.png 808w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/04\/Show-Package-Information-768x469.png 768w\" alt=\"Show Package Information\" width=\"808\" height=\"493\" aria-describedby=\"caption-attachment-19950\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-19950\" class=\"wp-caption-text\">Show Package Information<\/p>\n<\/div>\n<h3>6. Verify a Package for any Broken Dependencies<\/h3>\n<p>Sometimes during package installation, you may get errors concerning broken package dependencies, to check that you do not have these problems run the command below with the package name.<\/p>\n<pre>$ sudo apt check firefox\r\n<\/pre>\n<div id=\"attachment_19951\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/04\/Check-Package-for-Broken-Dependencies.png\" rel=\"attachment wp-att-19951\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-19951\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/04\/Check-Package-for-Broken-Dependencies.png\" alt=\"Check Package for Broke Dependencies\" width=\"484\" height=\"108\" aria-describedby=\"caption-attachment-19951\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-19951\" class=\"wp-caption-text\">Check Package for Broke Dependencies<\/p>\n<\/div>\n<h3>7. List Recommended Missing Packages of Given Package<\/h3>\n<pre>$ sudo apt recommends apache2\r\n<\/pre>\n<div id=\"attachment_19952\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/04\/View-Recommended-Missing-Packages.png\" rel=\"attachment wp-att-19952\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-19952\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/04\/View-Recommended-Missing-Packages.png\" alt=\"View Recommended Missing Packages\" width=\"574\" height=\"61\" aria-describedby=\"caption-attachment-19952\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-19952\" class=\"wp-caption-text\">View Recommended Missing Packages<\/p>\n<\/div>\n<h3>8. Check Installed Package Version<\/h3>\n<p>The\u00a0<strong>\u2018version\u2019<\/strong>\u00a0option will show you the installed package version.<\/p>\n<pre>$ sudo apt version firefox\r\n<\/pre>\n<div id=\"attachment_19957\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/04\/Check-Installed-Package-Version.png\" rel=\"attachment wp-att-19957\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-19957\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/04\/Check-Installed-Package-Version.png\" alt=\"Check Installed Package Version\" width=\"554\" height=\"147\" aria-describedby=\"caption-attachment-19957\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-19957\" class=\"wp-caption-text\">Check Installed Package Version<\/p>\n<\/div>\n<h3>9. Update System Packages<\/h3>\n<p>This will help you to download a list of packages from different repositories included on your system and updates them when there are new versions of packages and their dependencies.<\/p>\n<pre>$ sudo apt update\r\n<\/pre>\n<div id=\"attachment_19958\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/04\/Update-System-Packages.png\" rel=\"attachment wp-att-19958\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-19958\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/04\/Update-System-Packages.png\" sizes=\"auto, (max-width: 783px) 100vw, 783px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/04\/Update-System-Packages.png 783w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/04\/Update-System-Packages-768x380.png 768w\" alt=\"Update System Packages\" width=\"783\" height=\"387\" aria-describedby=\"caption-attachment-19958\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-19958\" class=\"wp-caption-text\">Update System Packages<\/p>\n<\/div>\n<h3>10. Upgrade System<\/h3>\n<p>This helps you to install new versions of all the packages on your system.<\/p>\n<pre>$ sudo apt upgrade\r\n<\/pre>\n<div id=\"attachment_19959\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/04\/Upgrade-System.png\" rel=\"attachment wp-att-19959\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-19959\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/04\/Upgrade-System.png\" sizes=\"auto, (max-width: 801px) 100vw, 801px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/04\/Upgrade-System.png 801w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/04\/Upgrade-System-768x385.png 768w\" alt=\"Upgrade System\" width=\"801\" height=\"402\" aria-describedby=\"caption-attachment-19959\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-19959\" class=\"wp-caption-text\">Upgrade System<\/p>\n<\/div>\n<h3>11. Remove Unused Packages<\/h3>\n<p>When you install a new package on your system, it\u2019s dependencies are also installed and they use some system libraries with other packages. The after removing that particular package, it\u2019s dependencies will remain on the system, therefore to remove them use autoremove as follows:<\/p>\n<pre>$ sudo apt autoremove\r\n<\/pre>\n<div id=\"attachment_19960\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/04\/Remove-Unwanted-Packages.png\" rel=\"attachment wp-att-19960\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-19960\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/04\/Remove-Unwanted-Packages.png\" alt=\"Remove Unwanted Packages\" width=\"685\" height=\"114\" aria-describedby=\"caption-attachment-19960\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-19960\" class=\"wp-caption-text\">Remove Unwanted Packages<\/p>\n<\/div>\n<h3>12. Clean Old Repository of Downloaded Packages<\/h3>\n<p>The option \u2018clean\u2019 or \u2018autoclean\u2019 remove all old local repository of downloaded package files.<\/p>\n<pre>$ sudo apt autoclean \r\nor\r\n$ sudo apt clean\r\n<\/pre>\n<div id=\"attachment_19961\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/04\/Clean-Package-Repository.png\" rel=\"attachment wp-att-19961\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-19961\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/04\/Clean-Package-Repository.png\" alt=\"Clean Package Repository\" width=\"462\" height=\"112\" aria-describedby=\"caption-attachment-19961\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-19961\" class=\"wp-caption-text\">Clean Package Repository<\/p>\n<\/div>\n<h3>13. Remove Packages with its Configuration Files<\/h3>\n<p>When you run\u00a0<strong>apt<\/strong>\u00a0with\u00a0<strong>remove<\/strong>, it only removes the package files but configuration files remain on the system. Therefore to remove a package and it\u2019s configuration files, you will have to use\u00a0<strong>purge<\/strong>.<\/p>\n<pre>$ sudo apt purge glances\r\n<\/pre>\n<div id=\"attachment_19962\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/04\/Remove-Package-Configuration-Files.png\" rel=\"attachment wp-att-19962\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-19962\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/04\/Remove-Package-Configuration-Files.png\" alt=\"Remove Package Configuration Files\" width=\"763\" height=\"308\" aria-describedby=\"caption-attachment-19962\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-19962\" class=\"wp-caption-text\">Remove Package Configuration Files<\/p>\n<\/div>\n<h3>14. Install .Deb Package<\/h3>\n<p>To install a\u00a0<strong>.deb<\/strong>\u00a0file, run the command below with the filename as an argument as follows:<\/p>\n<pre>$ sudo apt deb atom-amd64.deb\r\n<\/pre>\n<div id=\"attachment_19963\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/04\/Install-Deb-Package.png\" rel=\"attachment wp-att-19963\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-19963\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/04\/Install-Deb-Package.png\" alt=\"Install Deb Package\" width=\"733\" height=\"178\" aria-describedby=\"caption-attachment-19963\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-19963\" class=\"wp-caption-text\">Install Deb Package<\/p>\n<\/div>\n<h3>15. Find Help While Using APT<\/h3>\n<p>The following command will list you all the options with it\u2019s description on how to use\u00a0<strong>APT<\/strong>\u00a0on your system.<\/p>\n<pre>$ apt help\r\n<\/pre>\n<div id=\"attachment_19964\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/04\/APT-Command-Help.png\" rel=\"attachment wp-att-19964\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-19964\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/04\/APT-Command-Help.png\" sizes=\"auto, (max-width: 840px) 100vw, 840px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/04\/APT-Command-Help.png 840w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/04\/APT-Command-Help-768x712.png 768w\" alt=\"APT Command Help\" width=\"840\" height=\"779\" aria-describedby=\"caption-attachment-19964\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-19964\" class=\"wp-caption-text\">APT Command Help<\/p>\n<\/div>\n<h3>Summary<\/h3>\n<p>Always remember that good\u00a0<a href=\"https:\/\/www.tecmint.com\/useful-basic-commands-of-apt-get-and-apt-cache-for-package-management\/\" target=\"_blank\" rel=\"noopener\">Linux package management<\/a>, can help you avoid breaking your system. There are so many other\u00a0<a href=\"https:\/\/www.tecmint.com\/linux-package-management\/\" target=\"_blank\" rel=\"noopener\">package management tools<\/a>\u00a0that you can use in Linux.<\/p>\n<p>You can share with us what you use and your experience with it. I hope the article is helpful and for any additional information, leave a comment in the comment section.<\/p>\n<p><a href=\"https:\/\/www.tecmint.com\/apt-advanced-package-command-examples-in-ubuntu\/\" target=\"_blank\" rel=\"noopener\">Source<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>One important thing to master under Linux System\/Server Administration is package management using different package management tools. Different Linux distributions install applications in a pre-compiled package that contain binary files, configuration files and also information about the application\u2019s dependencies. Read Also:\u00a0Learn 25 \u2018apt-get\u2019 and \u2018apt-cache\u2019 Command Examples in Debian based Systems Package management tools help &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/www.appservgrid.com\/paw92\/index.php\/2019\/04\/01\/15-examples-of-how-to-use-new-advanced-package-tool-apt-in-ubuntu-debian\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;15 Examples of How to Use New Advanced Package Tool (APT) in Ubuntu\/Debian&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-13296","post","type-post","status-publish","format-standard","hentry","category-linux"],"_links":{"self":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts\/13296","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/comments?post=13296"}],"version-history":[{"count":1,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts\/13296\/revisions"}],"predecessor-version":[{"id":13297,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts\/13296\/revisions\/13297"}],"wp:attachment":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/media?parent=13296"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/categories?post=13296"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/tags?post=13296"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}