{"id":11139,"date":"2021-10-15T11:25:06","date_gmt":"2021-10-15T11:25:06","guid":{"rendered":"https:\/\/linuxways.net\/?p=11139"},"modified":"2021-10-15T11:25:06","modified_gmt":"2021-10-15T11:25:06","slug":"how-to-clear-apt-cache-on-debian-10","status":"publish","type":"post","link":"https:\/\/linuxways.net\/de\/debian\/how-to-clear-apt-cache-on-debian-10\/","title":{"rendered":"How to Clear apt-cache on Debian 10"},"content":{"rendered":"<p><strong>Apt<\/strong> (<strong>Advanced Packaging Tool<\/strong>) is a command-line package installation and dependency management utility in Debian-based distributions.<\/p>\n<p>When you install packages in Debian using the apt-get or apt command, a copy of the .deb file is saved in the <strong>\/var\/cache\/apt\/archives<\/strong> directory. If you uninstall and reinstall a package, your system will look for it in the cache and download it from there rather than downloading it again.<\/p>\n<p>If you run out of disk space on your Debian system, you can clear the apt-cache and free up some space.<\/p>\n<p>In this guide, you will learn how to clear the apt-cache on Debian.<\/p>\n<h2><strong>Use apt clean Command<\/strong><\/h2>\n<p>To clear the apt-cache, use the apt clean command to erase all files in the cache directory. The user doesn&#8217;t need to manually delete the cache directory.<\/p>\n<pre><strong> $ sudo apt clean<\/strong><\/pre>\n<p>You can run the apt clean command with an option called \u2014dry-run. This will simply display the folders from which packages will be deleted.<\/p>\n<pre><strong>$ sudo apt clean --dry-run<\/strong><\/pre>\n<p><strong><img loading=\"lazy\" decoding=\"async\" width=\"721\" height=\"164\" class=\"wp-image-11140\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/10\/word-image-273.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/10\/word-image-273.png 721w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/10\/word-image-273-300x68.png 300w\" sizes=\"auto, (max-width: 721px) 100vw, 721px\" \/><\/strong><\/p>\n<h2><strong>Use apt auto-clean Command<\/strong><\/h2>\n<p>This command removes all saved archives for packages that can no longer be downloaded from your cache. The packages are either no longer in the repository or have a newer version available in the repo. This command cleans obsolete Debian packages.<\/p>\n<pre><strong>$ sudo apt autoclean<\/strong><\/pre>\n<p><strong><img loading=\"lazy\" decoding=\"async\" width=\"514\" height=\"112\" class=\"wp-image-11141\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/10\/word-image-274.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/10\/word-image-274.png 514w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/10\/word-image-274-300x65.png 300w\" sizes=\"auto, (max-width: 514px) 100vw, 514px\" \/><\/strong><\/p>\n<h2><strong>Conclusion<\/strong><\/h2>\n<p>Clearing the cache created by apt is completely safe. It is faster and simpler than manually deleting the cache directory.<\/p>","protected":false},"excerpt":{"rendered":"<p>Apt (Advanced Packaging Tool) is a command-line package installation and dependency management utility in Debian-based distributions. When you install packages in Debian using the apt-get or apt command,&hellip;<\/p>","protected":false},"author":1,"featured_media":11218,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[394,17],"class_list":["post-11139","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-debian","tag-apt-cache","tag-debian-10"],"_links":{"self":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts\/11139","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\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/comments?post=11139"}],"version-history":[{"count":0,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts\/11139\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/media\/11218"}],"wp:attachment":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/media?parent=11139"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/categories?post=11139"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/tags?post=11139"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}