How to find unused packages in debian?

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
2
down vote

favorite
2












As a typical debian user I install some packages over time for several reasons:



  1. I want to test the package

  2. I want to use it for a short time

  3. I mis-spelled its name

  4. I copy/pasted a long apt install command from Internet, but I only need some of the packages.

Is there any (intelligent) tool to find packages installed previously and probably no longer needed?



This tool should guess the need to the package from current behavior and probably should use some kind of artificial intelligence. I don't expect that tool to be accurate, it only suggests.



I already know about deborphan and apt autoremove but they are useless in this scenario.










share|improve this question























  • I'd look at access times in /usr/bin, and pick off the less-recently used programs, ranked by package size. That would require some scripting work (ymmv).
    – Thomas Dickey
    Nov 24 at 17:37










  • thanks, this is good idea. but doesn't work for packages that have services installed.
    – gopy
    Nov 24 at 17:40










  • nor for packages that doesn't have binary files.
    – gopy
    Nov 24 at 17:48










  • Have you looked in /var/log/apt/history* to see what you installed when?
    – Doug O'Neal
    Nov 24 at 17:59










  • Yes I know about that file, but this method is completely manual and is not practical for systems with thousands of package installations.
    – gopy
    Nov 24 at 18:11














up vote
2
down vote

favorite
2












As a typical debian user I install some packages over time for several reasons:



  1. I want to test the package

  2. I want to use it for a short time

  3. I mis-spelled its name

  4. I copy/pasted a long apt install command from Internet, but I only need some of the packages.

Is there any (intelligent) tool to find packages installed previously and probably no longer needed?



This tool should guess the need to the package from current behavior and probably should use some kind of artificial intelligence. I don't expect that tool to be accurate, it only suggests.



I already know about deborphan and apt autoremove but they are useless in this scenario.










share|improve this question























  • I'd look at access times in /usr/bin, and pick off the less-recently used programs, ranked by package size. That would require some scripting work (ymmv).
    – Thomas Dickey
    Nov 24 at 17:37










  • thanks, this is good idea. but doesn't work for packages that have services installed.
    – gopy
    Nov 24 at 17:40










  • nor for packages that doesn't have binary files.
    – gopy
    Nov 24 at 17:48










  • Have you looked in /var/log/apt/history* to see what you installed when?
    – Doug O'Neal
    Nov 24 at 17:59










  • Yes I know about that file, but this method is completely manual and is not practical for systems with thousands of package installations.
    – gopy
    Nov 24 at 18:11












up vote
2
down vote

favorite
2









up vote
2
down vote

favorite
2






2





As a typical debian user I install some packages over time for several reasons:



  1. I want to test the package

  2. I want to use it for a short time

  3. I mis-spelled its name

  4. I copy/pasted a long apt install command from Internet, but I only need some of the packages.

Is there any (intelligent) tool to find packages installed previously and probably no longer needed?



This tool should guess the need to the package from current behavior and probably should use some kind of artificial intelligence. I don't expect that tool to be accurate, it only suggests.



I already know about deborphan and apt autoremove but they are useless in this scenario.










share|improve this question















As a typical debian user I install some packages over time for several reasons:



  1. I want to test the package

  2. I want to use it for a short time

  3. I mis-spelled its name

  4. I copy/pasted a long apt install command from Internet, but I only need some of the packages.

Is there any (intelligent) tool to find packages installed previously and probably no longer needed?



This tool should guess the need to the package from current behavior and probably should use some kind of artificial intelligence. I don't expect that tool to be accurate, it only suggests.



I already know about deborphan and apt autoremove but they are useless in this scenario.







debian package-management






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 24 at 20:52









Rui F Ribeiro

38.3k1476127




38.3k1476127










asked Nov 24 at 17:32









gopy

194




194











  • I'd look at access times in /usr/bin, and pick off the less-recently used programs, ranked by package size. That would require some scripting work (ymmv).
    – Thomas Dickey
    Nov 24 at 17:37










  • thanks, this is good idea. but doesn't work for packages that have services installed.
    – gopy
    Nov 24 at 17:40










  • nor for packages that doesn't have binary files.
    – gopy
    Nov 24 at 17:48










  • Have you looked in /var/log/apt/history* to see what you installed when?
    – Doug O'Neal
    Nov 24 at 17:59










  • Yes I know about that file, but this method is completely manual and is not practical for systems with thousands of package installations.
    – gopy
    Nov 24 at 18:11
















  • I'd look at access times in /usr/bin, and pick off the less-recently used programs, ranked by package size. That would require some scripting work (ymmv).
    – Thomas Dickey
    Nov 24 at 17:37










  • thanks, this is good idea. but doesn't work for packages that have services installed.
    – gopy
    Nov 24 at 17:40










  • nor for packages that doesn't have binary files.
    – gopy
    Nov 24 at 17:48










  • Have you looked in /var/log/apt/history* to see what you installed when?
    – Doug O'Neal
    Nov 24 at 17:59










  • Yes I know about that file, but this method is completely manual and is not practical for systems with thousands of package installations.
    – gopy
    Nov 24 at 18:11















I'd look at access times in /usr/bin, and pick off the less-recently used programs, ranked by package size. That would require some scripting work (ymmv).
– Thomas Dickey
Nov 24 at 17:37




I'd look at access times in /usr/bin, and pick off the less-recently used programs, ranked by package size. That would require some scripting work (ymmv).
– Thomas Dickey
Nov 24 at 17:37












thanks, this is good idea. but doesn't work for packages that have services installed.
– gopy
Nov 24 at 17:40




thanks, this is good idea. but doesn't work for packages that have services installed.
– gopy
Nov 24 at 17:40












nor for packages that doesn't have binary files.
– gopy
Nov 24 at 17:48




nor for packages that doesn't have binary files.
– gopy
Nov 24 at 17:48












Have you looked in /var/log/apt/history* to see what you installed when?
– Doug O'Neal
Nov 24 at 17:59




Have you looked in /var/log/apt/history* to see what you installed when?
– Doug O'Neal
Nov 24 at 17:59












Yes I know about that file, but this method is completely manual and is not practical for systems with thousands of package installations.
– gopy
Nov 24 at 18:11




Yes I know about that file, but this method is completely manual and is not practical for systems with thousands of package installations.
– gopy
Nov 24 at 18:11










2 Answers
2






active

oldest

votes

















up vote
2
down vote













popularity-contest is a debian tool which help the Debian developer to improve future versions of the distribution it can be used to achieve your goal. the popcon-largest-unused command will list the unused packages.




The popularity-contest package sets up a cron job that will periodically anonymously submit to the Debian developers statistics about the most used Debian packages on this system.




man popularity-contest




The popularity-contest command gathers information about Debian packages installed on the system, and prints the name of the most recently used executable program in that package as well as its last-accessed time (atime) and last-attribute-changed time (ctime) to stdout.




apt install popularity-contest
popularity-contest > /var/log/popularity-contest
popcon-largest-unused



DESCRIPTION: popcon-largest-unused



Based on the list of unused packages reported by popularity-contest, this program extract the package size from the APT cache, and list the unused packages sorted by size.







share|improve this answer






















  • Thanks, its an interesting tool, but not intelligent enough.
    – gopy
    Nov 24 at 18:40










  • what if I install apache and do not use http port for a long time? popularity-contest can't detect that. same is true for library packages and documentation packages.
    – gopy
    Nov 25 at 7:01










  • @gopy As the manpage say the debian tool will track the used executable program to generate the list.
    – GAD3R
    Nov 25 at 16:33


















up vote
-1
down vote













Yes, this is an existing project, called deborphan.




Description: program that can find unused packages, e.g. libraries



 deborphan finds packages that have no packages depending on them. The
default operation is to search within the libs, oldlibs and introspec‐
tion sections to hunt down unused libraries.






share|improve this answer




















  • "I already know about deborphan".
    – Weijun Zhou
    Nov 24 at 18:44










Your Answer








StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "106"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f483900%2fhow-to-find-unused-packages-in-debian%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























2 Answers
2






active

oldest

votes








2 Answers
2






active

oldest

votes









active

oldest

votes






active

oldest

votes








up vote
2
down vote













popularity-contest is a debian tool which help the Debian developer to improve future versions of the distribution it can be used to achieve your goal. the popcon-largest-unused command will list the unused packages.




The popularity-contest package sets up a cron job that will periodically anonymously submit to the Debian developers statistics about the most used Debian packages on this system.




man popularity-contest




The popularity-contest command gathers information about Debian packages installed on the system, and prints the name of the most recently used executable program in that package as well as its last-accessed time (atime) and last-attribute-changed time (ctime) to stdout.




apt install popularity-contest
popularity-contest > /var/log/popularity-contest
popcon-largest-unused



DESCRIPTION: popcon-largest-unused



Based on the list of unused packages reported by popularity-contest, this program extract the package size from the APT cache, and list the unused packages sorted by size.







share|improve this answer






















  • Thanks, its an interesting tool, but not intelligent enough.
    – gopy
    Nov 24 at 18:40










  • what if I install apache and do not use http port for a long time? popularity-contest can't detect that. same is true for library packages and documentation packages.
    – gopy
    Nov 25 at 7:01










  • @gopy As the manpage say the debian tool will track the used executable program to generate the list.
    – GAD3R
    Nov 25 at 16:33















up vote
2
down vote













popularity-contest is a debian tool which help the Debian developer to improve future versions of the distribution it can be used to achieve your goal. the popcon-largest-unused command will list the unused packages.




The popularity-contest package sets up a cron job that will periodically anonymously submit to the Debian developers statistics about the most used Debian packages on this system.




man popularity-contest




The popularity-contest command gathers information about Debian packages installed on the system, and prints the name of the most recently used executable program in that package as well as its last-accessed time (atime) and last-attribute-changed time (ctime) to stdout.




apt install popularity-contest
popularity-contest > /var/log/popularity-contest
popcon-largest-unused



DESCRIPTION: popcon-largest-unused



Based on the list of unused packages reported by popularity-contest, this program extract the package size from the APT cache, and list the unused packages sorted by size.







share|improve this answer






















  • Thanks, its an interesting tool, but not intelligent enough.
    – gopy
    Nov 24 at 18:40










  • what if I install apache and do not use http port for a long time? popularity-contest can't detect that. same is true for library packages and documentation packages.
    – gopy
    Nov 25 at 7:01










  • @gopy As the manpage say the debian tool will track the used executable program to generate the list.
    – GAD3R
    Nov 25 at 16:33













up vote
2
down vote










up vote
2
down vote









popularity-contest is a debian tool which help the Debian developer to improve future versions of the distribution it can be used to achieve your goal. the popcon-largest-unused command will list the unused packages.




The popularity-contest package sets up a cron job that will periodically anonymously submit to the Debian developers statistics about the most used Debian packages on this system.




man popularity-contest




The popularity-contest command gathers information about Debian packages installed on the system, and prints the name of the most recently used executable program in that package as well as its last-accessed time (atime) and last-attribute-changed time (ctime) to stdout.




apt install popularity-contest
popularity-contest > /var/log/popularity-contest
popcon-largest-unused



DESCRIPTION: popcon-largest-unused



Based on the list of unused packages reported by popularity-contest, this program extract the package size from the APT cache, and list the unused packages sorted by size.







share|improve this answer














popularity-contest is a debian tool which help the Debian developer to improve future versions of the distribution it can be used to achieve your goal. the popcon-largest-unused command will list the unused packages.




The popularity-contest package sets up a cron job that will periodically anonymously submit to the Debian developers statistics about the most used Debian packages on this system.




man popularity-contest




The popularity-contest command gathers information about Debian packages installed on the system, and prints the name of the most recently used executable program in that package as well as its last-accessed time (atime) and last-attribute-changed time (ctime) to stdout.




apt install popularity-contest
popularity-contest > /var/log/popularity-contest
popcon-largest-unused



DESCRIPTION: popcon-largest-unused



Based on the list of unused packages reported by popularity-contest, this program extract the package size from the APT cache, and list the unused packages sorted by size.








share|improve this answer














share|improve this answer



share|improve this answer








edited Nov 24 at 18:13

























answered Nov 24 at 18:05









GAD3R

24.6k1749104




24.6k1749104











  • Thanks, its an interesting tool, but not intelligent enough.
    – gopy
    Nov 24 at 18:40










  • what if I install apache and do not use http port for a long time? popularity-contest can't detect that. same is true for library packages and documentation packages.
    – gopy
    Nov 25 at 7:01










  • @gopy As the manpage say the debian tool will track the used executable program to generate the list.
    – GAD3R
    Nov 25 at 16:33

















  • Thanks, its an interesting tool, but not intelligent enough.
    – gopy
    Nov 24 at 18:40










  • what if I install apache and do not use http port for a long time? popularity-contest can't detect that. same is true for library packages and documentation packages.
    – gopy
    Nov 25 at 7:01










  • @gopy As the manpage say the debian tool will track the used executable program to generate the list.
    – GAD3R
    Nov 25 at 16:33
















Thanks, its an interesting tool, but not intelligent enough.
– gopy
Nov 24 at 18:40




Thanks, its an interesting tool, but not intelligent enough.
– gopy
Nov 24 at 18:40












what if I install apache and do not use http port for a long time? popularity-contest can't detect that. same is true for library packages and documentation packages.
– gopy
Nov 25 at 7:01




what if I install apache and do not use http port for a long time? popularity-contest can't detect that. same is true for library packages and documentation packages.
– gopy
Nov 25 at 7:01












@gopy As the manpage say the debian tool will track the used executable program to generate the list.
– GAD3R
Nov 25 at 16:33





@gopy As the manpage say the debian tool will track the used executable program to generate the list.
– GAD3R
Nov 25 at 16:33













up vote
-1
down vote













Yes, this is an existing project, called deborphan.




Description: program that can find unused packages, e.g. libraries



 deborphan finds packages that have no packages depending on them. The
default operation is to search within the libs, oldlibs and introspec‐
tion sections to hunt down unused libraries.






share|improve this answer




















  • "I already know about deborphan".
    – Weijun Zhou
    Nov 24 at 18:44














up vote
-1
down vote













Yes, this is an existing project, called deborphan.




Description: program that can find unused packages, e.g. libraries



 deborphan finds packages that have no packages depending on them. The
default operation is to search within the libs, oldlibs and introspec‐
tion sections to hunt down unused libraries.






share|improve this answer




















  • "I already know about deborphan".
    – Weijun Zhou
    Nov 24 at 18:44












up vote
-1
down vote










up vote
-1
down vote









Yes, this is an existing project, called deborphan.




Description: program that can find unused packages, e.g. libraries



 deborphan finds packages that have no packages depending on them. The
default operation is to search within the libs, oldlibs and introspec‐
tion sections to hunt down unused libraries.






share|improve this answer












Yes, this is an existing project, called deborphan.




Description: program that can find unused packages, e.g. libraries



 deborphan finds packages that have no packages depending on them. The
default operation is to search within the libs, oldlibs and introspec‐
tion sections to hunt down unused libraries.







share|improve this answer












share|improve this answer



share|improve this answer










answered Nov 24 at 18:30









Ipor Sircer

10.3k11024




10.3k11024











  • "I already know about deborphan".
    – Weijun Zhou
    Nov 24 at 18:44
















  • "I already know about deborphan".
    – Weijun Zhou
    Nov 24 at 18:44















"I already know about deborphan".
– Weijun Zhou
Nov 24 at 18:44




"I already know about deborphan".
– Weijun Zhou
Nov 24 at 18:44

















draft saved

draft discarded
















































Thanks for contributing an answer to Unix & Linux Stack Exchange!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.





Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


Please pay close attention to the following guidance:


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f483900%2fhow-to-find-unused-packages-in-debian%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown






Popular posts from this blog

How to check contact read email or not when send email to Individual?

Bahrain

Postfix configuration issue with fips on centos 7; mailgun relay