dpkg –get-selections: Get the Current State of Your Ubuntu/Debian machine

Posted by Joys of Programming on in dpkg, Linux, Ubuntu

dpkg can be used for a variety of purposes. It can be used to install and remove packages. But one of the best feature which you can use is to save the current state of your machine.

What is current state of your machine?
You may be wondering what does the current state means. Your ubuntu/debian machine is a collection of many packages. Every time your machine crashes, apart from losing the valuable data, you may also lose the information about various packages you installed in your machine.

dpkg –get-selections gives the list of all package names and their current state like installed, deinstalled etc.

$ dpkg --get-selections 

acpi-support                                    install
acpid                                           install
adduser                                         install
adium-theme-ubuntu                              install
aisleriot                                       install
akonadi-server                                  install
....

You can save the settings into a file using tee.

$ dpkg --get-selections | tee packages_list

acpi-support                                    install
acpid                                           install
adduser                                         install
adium-theme-ubuntu                              install
aisleriot                                       install
akonadi-server                                  install
....

You can make use of the file packages_list in many ways. Save it in your mail, so that you can use it later or even use it to clone another machine in a similar way.

Tags: , , , ,

Comments:

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Copyright © 2009-2012 Joys of Programming All rights reserved.
Desk Mess Mirrored v1.8.1 theme from BuyNowShop.com.