SEARCH

Enter your search query in the box above ^, or use the forum search tool.

You are not logged in.

#1 2012-10-11 21:33:29

typewriterjason
#! Junkie
Registered: 2011-08-28
Posts: 257

Finding unused or unnecessary packages?

Hey all,

My question is this; I've been installing a few different packages lately, often to try to get what's needed to get a particular program to run. After realizing that I don't need to run that program any more, I'd like to clean the clutter of those packages.

Is there any set of commands, or a repeatalbe method, that would show me what packages aren't being used, or have never been used? So that I could find out which ones to nix?

(In this case, the program was Aleph One, the open source game engine to run the old Marathon first person shooter games from years ago. I stopped trying to get it working when I realized that the whole point of my #! laptop was for work, not play!)

Last edited by typewriterjason (2012-10-11 21:34:09)


Fortune favors the bold.
#! WALDORF
Asus EEEPC 1001PXD | Lenovo ThinkPad t410

Offline

Help fund CrunchBang, donate to the project!

#2 2012-10-11 22:59:50

pvsage
Internal Affairs
From: North Carolina
Registered: 2009-10-18
Posts: 13,970

Re: Finding unused or unnecessary packages?

I assume, in this case, `sudo apt-get autoremove --purge` isn't getting rid of everything?  I've noticed this happens sometimes. hmm

I know APT keeps a record of what's installed, and possibly when.  I can't check for it right now, as I'm at work at a Windows pooter, but I think it's in /var/cache/apt?

Offline

#3 2012-10-12 05:37:50

fratermus
#! CrunchBanger
From: 75081, USA
Registered: 2012-01-20
Posts: 149
Website

Re: Finding unused or unnecessary packages?

typewriterjason wrote:

Is there any set of commands, or a repeatalbe method, that would show me what packages aren't being used, or have never been used? So that I could find out which ones to nix?

There are many ways it could fail (due to unforseen accesses or fs settings), and I could be stupid and/or misguided, but here's a thought to get juices flowing:

progs that have been used this month:

find /usr/bin -atime -31

ie, access time less than 31 days.

progs that have not been used in a year:

find /usr/bin -atime +365

ie, access time greater than 365 days.


brother mouse
new to crunchbang.
my first linux kernel build was on a 386-16sx with 6MB SIPP RAM ($50/MB!)

Offline

#4 2012-10-12 19:57:40

typewriterjason
#! Junkie
Registered: 2011-08-28
Posts: 257

Re: Finding unused or unnecessary packages?

These are some neat ideas...

Hey, Pvsage... I haven't actually tried that apt-get option, colour me a noob!

Is there a way to see a list of what's would be removed first? Maybe I should just read the manual...


Fortune favors the bold.
#! WALDORF
Asus EEEPC 1001PXD | Lenovo ThinkPad t410

Offline

#5 2012-10-12 20:16:34

el_koraco
#!/loony/bun
From: inside Ed
Registered: 2011-07-25
Posts: 4,749

Re: Finding unused or unnecessary packages?

It will tell you what it's removing and ask for confirmation. You can also look in /var/cache/apt/archives for a record of installed packages.

Offline

#6 2012-10-12 20:48:00

pvsage
Internal Affairs
From: North Carolina
Registered: 2009-10-18
Posts: 13,970

Re: Finding unused or unnecessary packages?

typewriterjason wrote:

Maybe I should just read the manual...

Chop wood; carry water. wink  (Edit:  Sounds like somebody's found enlightenment. cool)

Last edited by pvsage (2012-10-12 20:49:44)

Offline

#7 2012-10-13 03:53:29

kiiroitori
#! CrunchBanger
From: Tokyo, Japan
Registered: 2010-12-07
Posts: 229

Re: Finding unused or unnecessary packages?

fratermus wrote:

progs that have been used this month:

find /usr/bin -atime -31

ie, access time less than 31 days.

progs that have not been used in a year:

find /usr/bin -atime +365

ie, access time greater than 365 days.

That's really neat smile
By the way, apt-get autoremove wants to get rid of networkmanager...Sounds like a bad idea to me...Is there a way to prevent autoremove to discard a specific package?


I love #! more than my own kids. I told them and they sympathized.

Offline

#8 2012-10-13 04:06:17

VastOne
#! Ranger
From: V-Ger
Registered: 2011-04-26
Posts: 10,165
Website

Re: Finding unused or unnecessary packages?

^ autoremove will only remove the remnants or dependencies of applications that have already been removed.  If network manager is there, it would seem that it has been removed.

Post the output of what you have seen and run and post the results of:

apt-cache policy network-manager

VSIDO | Words That Build Or Destroy

I dev VSIDO

Offline

#9 2012-10-14 06:54:51

kiiroitori
#! CrunchBanger
From: Tokyo, Japan
Registered: 2010-12-07
Posts: 229

Re: Finding unused or unnecessary packages?

^ Thanks for the reply VastOne.

apt-get autoremove

The following packages will be REMOVED:
  crda diffstat dnsmasq-base iw libavdevice53 libavfilter2 libglee0d1
  libjim0debian2 libmozjs15d libnetfilter-conntrack3 libnl-genl-3-200
  libnm-gtk-common libnm-gtk0 liboil0.3 libopenobex1 libunicap2 libweed0
  libx264-125 lives-data mobile-broadband-provider-info modemmanager
  network-manager ogmtools quilt usb-modeswitch usb-modeswitch-data
  wireless-regdb wpasupplicant xulrunner-10.0 xulrunner-15.0
0 upgraded, 0 newly installed, 30 to remove and 0 not upgraded.

apt-cache policy network-manager

network-manager:
  Installed: 0.9.4.0-6
  Candidate: 0.9.4.0-6
  Version table:
 *** 0.9.4.0-6 0
        500 http://ftp.jp.debian.org/debian/ wheezy/main amd64 Packages
        500 http://http.us.debian.org/debian/ wheezy/main amd64 Packages
        100 /var/lib/dpkg/status

I love #! more than my own kids. I told them and they sympathized.

Offline

#10 2012-10-14 07:38:10

pvsage
Internal Affairs
From: North Carolina
Registered: 2009-10-18
Posts: 13,970

Re: Finding unused or unnecessary packages?

^ If you are, indeed, using network-manager to connect and not ifup/down, wpasupplicant or whatever, then something like

sudo apt-get install network-manager --reinstall && sudo apt-get autoremove

should set network-manager to manually installed and prevent it from being discarded.

Offline

#11 2012-10-14 08:05:14

kiiroitori
#! CrunchBanger
From: Tokyo, Japan
Registered: 2010-12-07
Posts: 229

Re: Finding unused or unnecessary packages?

Thanks pvsage! I am using network manager. I don't know about ifupdown, maybe I should have a look at it smile
The story is I thought I'd remove the wifi packages using the smxi script (an option when running the script) since I have a wired connection. I know it's a bit looking for troubles...I will follow your instructions!
Thanks guys.


I love #! more than my own kids. I told them and they sympathized.

Offline

#12 2012-10-14 19:16:35

machinebacon
#! unstable
From: China
Registered: 2009-07-02
Posts: 6,826
Website

Re: Finding unused or unnecessary packages?

sudo apt-get install deborphan
sudo orphaner

a simple 'deborphan' shows orphaned packages, and the orphaner is a curses app that can simulate removal. Nice thing, but be careful.


Sweaty lads picking up the soap | I love the new "Ignore user" button

Offline

#13 2012-10-15 11:29:18

bozhkov
#! Junkie
Registered: 2009-12-29
Posts: 464

Re: Finding unused or unnecessary packages?

@machinebacon  hate deborphan's ncurses ui, or even the ugly gtk one, I use apt:
First I list the orphaned packages with

deborphan --guess-data

and then to remove those poor orphans I use:

apt-get purge $(deborphan --guess-data)

Offline

#14 2012-10-15 12:53:55

machinebacon
#! unstable
From: China
Registered: 2009-07-02
Posts: 6,826
Website

Re: Finding unused or unnecessary packages?

The only thing that is missing in deborphan (opposed to orphaner) is the simulation, but you can add -s to the apt-get command -- which doesn't help detecting the orphans after a proposed orphan removal. big_smile


Sweaty lads picking up the soap | I love the new "Ignore user" button

Offline

#15 2012-10-15 17:06:56

johnraff
nullglob
From: Nagoya, Japan
Registered: 2009-01-07
Posts: 4,148
Website

Re: Finding unused or unnecessary packages?

An alternative to re-installing packages if you just want to remove the "automatic" mark is apt-mark:

apt-mark unmarkauto packagename

Should be quicker anyway. smile


John
--------------------
( a boring Japan blog , Japan Links, idle twitterings  and GitStuff )
#! forum moderator    BunsenLabs

Offline

#16 2012-11-04 13:54:11

dura
Bloated Gimp
From: interzone
Registered: 2012-09-15
Posts: 2,108

Re: Finding unused or unnecessary packages?

This thread seems to relate to the ongoing efficiency and savings theme to the forum.

I was wondering whether I should remove unecessary localisations using bleachbit. Thoughts? I would keep english uk, english us, spanish, and french.

Would it also be recommended to use an orphan package removing tool? I am pretty unknowledgeable about which libraries I would and wouldn't need. But I guess there is a lot that could be cut out.

Colonic anyone?

Offline

#17 2012-11-04 18:21:32

machinebacon
#! unstable
From: China
Registered: 2009-07-02
Posts: 6,826
Website

Re: Finding unused or unnecessary packages?

dura,

you have my blessing with regards to bleachbit and orphaner. In bleachbit be careful if you run it as root. By all means, do not choose to 'wipe free space' or 'Memory' in the list; they can take ages and seriously bork your system when you run it as root.
deborphan/orphaner are quite safe. You will need to run it again and again until all orphans are removed. Usually nothing serious would happen., because it only removes unused libraries and packages, but of course if you are in doubt, better remove them manually (use deborphan and apt-get autoremove --purge the packages, one after the other, always alternating deborphan and apt-get)


Sweaty lads picking up the soap | I love the new "Ignore user" button

Offline

#18 2012-11-04 18:26:53

dura
Bloated Gimp
From: interzone
Registered: 2012-09-15
Posts: 2,108

Re: Finding unused or unnecessary packages?

^Thanks a lot machinebacon. So I'm going to go ahead with deleting all the unneeded localisations. Yay! I may also venture into orphan space later. Oh its so sad. Thanks grillmeister big_smile

Offline

#19 2012-11-04 18:29:26

machinebacon
#! unstable
From: China
Registered: 2009-07-02
Posts: 6,826
Website

Re: Finding unused or unnecessary packages?

smile You'll free up some hundreds of MBs  ]:D


Sweaty lads picking up the soap | I love the new "Ignore user" button

Offline

#20 2012-11-04 18:33:28

dura
Bloated Gimp
From: interzone
Registered: 2012-09-15
Posts: 2,108

Re: Finding unused or unnecessary packages?

^ 287mb gone!  big_smile Thanks grillmeister

Now to audit them orphans

Offline

#21 2012-11-04 18:34:37

machinebacon
#! unstable
From: China
Registered: 2009-07-02
Posts: 6,826
Website

Re: Finding unused or unnecessary packages?

Ta-dam! Ask if you are in doubt wink


Sweaty lads picking up the soap | I love the new "Ignore user" button

Offline

#22 2012-11-04 18:52:44

dura
Bloated Gimp
From: interzone
Registered: 2012-09-15
Posts: 2,108

Re: Finding unused or unnecessary packages?

apparently, deborphan told me I only had linux-image-2.6-amd64 to remove, so I sold it to the circus  ]:D

Cheers machinebacon (and thanks for introducing me to the world of tilers...) big_smile

Offline

#23 2012-11-04 19:00:18

machinebacon
#! unstable
From: China
Registered: 2009-07-02
Posts: 6,826
Website

Re: Finding unused or unnecessary packages?

Welcome to the tiling world, though I don't really use them -- you know, we can't decide big_smile


Sweaty lads picking up the soap | I love the new "Ignore user" button

Offline

Board footer

Powered by FluxBB

Copyright © 2012 CrunchBang Linux.
Proudly powered by Debian. Hosted by Linode.
Debian is a registered trademark of Software in the Public Interest, Inc.
Server: acrobat

Debian Logo