Steve K.

This is my brain on LiveJournal.

Previous Entry Share Next Entry
Handy Linux Command Wizardry
gecko
geckoblue
So I've been cleaning up my server to do a distribution upgrade (operating system upgrade, for those who don't speak Linux). And I figured I'd document a few handy tricks I've learned to make some clean-up work faster and safer.

Package Management


  1. Determining packages that are necessary versus extra/optional. Be sure you know you don't need a package before you go removing it. This command chain gives me the list of installed packages, what their priority is (sorted), and a short description of them. I had to use the */grep * trick to cut out long descriptions due to "binary:Summary" being unavailable for me.


    dpkg-query -Wf '* ${Package;-40}${Priority;-40}${Description}\n' | grep -E "^\* " | sort -b -k3,3 -k2,2 -k1,1 | less


  2. Determine what installed packages depend on a package. Kinda basic, but goes along with the previous list.


    aptitude why {package-name}


  3. Determine what packages a package depends on.


    apt-cache depends {package-name}
    


Software RAID


  1. Found a good cheat sheet for mdraid administration:
    http://www.ducea.com/2009/03/08/mdadm-cheat-sheet/

I'll probably add to this list, but I had to document this somewhere.
Tags: ,

?

Log in

No account? Create an account