{"id":20941,"date":"2023-08-31T19:49:40","date_gmt":"2023-08-31T19:49:40","guid":{"rendered":"https:\/\/linuxways.net\/?p=20941"},"modified":"2023-08-31T19:49:40","modified_gmt":"2023-08-31T19:49:40","slug":"how-to-use-apt-package-manager-in-debian-12","status":"publish","type":"post","link":"https:\/\/linuxways.net\/de\/debian\/how-to-use-apt-package-manager-in-debian-12\/","title":{"rendered":"How to Use apt Package Manager in Debian 12"},"content":{"rendered":"<p>Debian 12 is an open-source operating system that comes with a default package manager known as apt. APT is an acronym for Advanced Package Tool. It is a command-line tool that efficiently handles the software package management in Debian 12. This package manager handles the installation, configuration, and deletion of packages.<\/p>\n<p>In this write-up, the method of using APT Package Manager is discussed.<\/p>\n<h2><strong>How to Use apt Package Manager in Debian 12?<\/strong><\/h2>\n<p>We can use the apt package manager for different purposes as described below:<\/p>\n<h2><strong>How to Update the Packages Using apt?<\/strong><\/h2>\n<p>Before installing or updating any package, it is recommended to update the package list using the command:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"co4\">$ <\/span><span class=\"kw2\">sudo<\/span> apt update<\/div><\/div>\n<p>In my case, all the packages are up to date:<\/p>\n<p><strong><img loading=\"lazy\" decoding=\"async\" width=\"778\" height=\"149\" class=\"wp-image-20942\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2023\/08\/word-image-20941-1.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2023\/08\/word-image-20941-1.png 778w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/08\/word-image-20941-1-300x57.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/08\/word-image-20941-1-768x147.png 768w\" sizes=\"auto, (max-width: 778px) 100vw, 778px\" \/><\/strong><\/p>\n<h2><strong>How to Install the Packages List Using apt?<\/strong><\/h2>\n<p>After updating the packages, we can install different types of packages using the apt command.<\/p>\n<p>Let\u2019s install a commonly used text editor nano, using the following command:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"co4\">$ <\/span><span class=\"kw2\">sudo<\/span> apt <span class=\"kw2\">install<\/span> <span class=\"kw2\">nano<\/span><\/div><\/div>\n<p>This command installs the nano package along with its dependencies:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"787\" height=\"127\" class=\"wp-image-20943\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2023\/08\/word-image-20941-2.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2023\/08\/word-image-20941-2.png 787w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/08\/word-image-20941-2-300x48.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/08\/word-image-20941-2-768x124.png 768w\" sizes=\"auto, (max-width: 787px) 100vw, 787px\" \/><\/p>\n<h2><strong>How to Uninstall the Packages List Using apt?<\/strong><\/h2>\n<p>In order to delete a package use the \u201c<strong>apt remove nano\u201d <\/strong>command.<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"co4\">$ <\/span><span class=\"kw2\">sudo<\/span> apt remove <span class=\"kw2\">nano<\/span><\/div><\/div>\n<p>This command deletes the packages but it does not delete the configuration files. Press \u201cY\u201d to continue with the installation process:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"773\" height=\"194\" class=\"wp-image-20944\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2023\/08\/word-image-20941-3.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2023\/08\/word-image-20941-3.png 773w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/08\/word-image-20941-3-300x75.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/08\/word-image-20941-3-768x193.png 768w\" sizes=\"auto, (max-width: 773px) 100vw, 773px\" \/><\/p>\n<p>To delete the package as well as its configuration files, we use the command:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"co4\">$ <\/span><span class=\"kw2\">sudo<\/span> apt purge <span class=\"kw2\">nano<\/span><\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"731\" height=\"195\" class=\"wp-image-20945\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2023\/08\/word-image-20941-4.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2023\/08\/word-image-20941-4.png 731w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/08\/word-image-20941-4-300x80.png 300w\" sizes=\"auto, (max-width: 731px) 100vw, 731px\" \/><\/p>\n<p>Press \u201cY\u201d and after a few seconds, the nano package will be deleted successfully.<\/p>\n<h2><strong>How to Upgrade the Packages Using apt?<\/strong><\/h2>\n<p>In order to keep our system up-to-date with the security attributes, it is necessary to upgrade our packages. To upgrade, use the given command:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"co4\">$ <\/span><span class=\"kw2\">sudo<\/span> apt upgrade<\/div><\/div>\n<p>My packages have already been upgraded as shown below:<\/p>\n<p><strong><img loading=\"lazy\" decoding=\"async\" width=\"789\" height=\"132\" class=\"wp-image-20946\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2023\/08\/word-image-20941-5.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2023\/08\/word-image-20941-5.png 789w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/08\/word-image-20941-5-300x50.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/08\/word-image-20941-5-768x128.png 768w\" sizes=\"auto, (max-width: 789px) 100vw, 789px\" \/><\/strong><\/p>\n<p>In order to upgrade the held-back packages, use the following command:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"co4\">$ <\/span><span class=\"kw2\">sudo<\/span> apt dist-upgrade<\/div><\/div>\n<p><strong><img loading=\"lazy\" decoding=\"async\" width=\"783\" height=\"131\" class=\"wp-image-20947\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2023\/08\/word-image-20941-6.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2023\/08\/word-image-20941-6.png 783w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/08\/word-image-20941-6-300x50.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/08\/word-image-20941-6-768x128.png 768w\" sizes=\"auto, (max-width: 783px) 100vw, 783px\" \/><\/strong><\/p>\n<h2><strong>How to Search for Packages Using APT?<\/strong><\/h2>\n<p>We can also search for packages using the apt command. To search for packages that contain the keyword \u201cfirefox\u201d, we use the following command.<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"co4\">$ <\/span>apt search firefox<\/div><\/div>\n<p>This command retrieved all the packages that contain the keyword \u201cfirefox\u201d.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"756\" height=\"241\" class=\"wp-image-20948\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2023\/08\/word-image-20941-7.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2023\/08\/word-image-20941-7.png 756w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/08\/word-image-20941-7-300x96.png 300w\" sizes=\"auto, (max-width: 756px) 100vw, 756px\" \/><\/p>\n<h2><strong>How to Install other Packages using apt?<\/strong><\/h2>\n<p>Let\u2019s install some packages that are not installed by default in Debian 12 such as \u201csynaptic\u201d. To install \u201csynaptic\u201d, use the following command:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"co4\">$ <\/span><span class=\"kw2\">sudo<\/span> apt <span class=\"kw2\">install<\/span> synaptic<\/div><\/div>\n<p>This command will execute and install the newest version:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"778\" height=\"155\" class=\"wp-image-20949\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2023\/08\/word-image-20941-8.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2023\/08\/word-image-20941-8.png 778w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/08\/word-image-20941-8-300x60.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2023\/08\/word-image-20941-8-768x153.png 768w\" sizes=\"auto, (max-width: 778px) 100vw, 778px\" \/><\/p>\n<h2><strong>Conclusion<\/strong><\/h2>\n<p>\u201capt\u201d is a powerful package manager command line tool that allows the user to perform different operations such as updating, upgrading, installation of packages, package deletion, etc. It is a convenient method to handle the packages in Debian 12. This write-up has illustrated how to use the \u201capt\u201d package manager in Debian 12.<\/p>","protected":false},"excerpt":{"rendered":"<p>\u201capt\u201d is a package manager, command line tool that allows the user to perform operations such as updating, upgrading, installation, package deletion, etc.<\/p>","protected":false},"author":110,"featured_media":20950,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[],"class_list":["post-20941","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-debian"],"_links":{"self":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts\/20941","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/users\/110"}],"replies":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/comments?post=20941"}],"version-history":[{"count":0,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts\/20941\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/media\/20950"}],"wp:attachment":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/media?parent=20941"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/categories?post=20941"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/tags?post=20941"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}