DebianThis forum is for the discussion of Debian Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
I know that the command to get the list of all the packages installed on your system is
#dpkg -l
But the thing is when it shows me the list of packages it marks soem of them 'rc' or 'pi' i.e. means those packages are not there on my system..right? So if those packages are not there why does it still shows them in the list.
Is there any command by which I can get only the packages that are installed on my system?
Here is the output of the dpkg -l command:
Code:
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Installed/Config-files/Unpacked/Failed-config/Half-installed
|/ Err?=(none)/Hold/Reinst-required/X=both-problems (Status,Err: uppercase=bad)
||/ Name Version Description
+++-==============-==============-============================================
ii adduser 3.63 Add and remove users and groups
ii apt 0.5.28.6 Advanced front-end for dpkg
ii apt-utils 0.5.28.6 APT utility programs
ii aptitude 0.2.15.9-2 terminal-based apt frontend
ii at 3.1.8-11 Delayed job execution and batch processing
ii base-config 2.53.10 Debian base system configurator
ii base-files 3.1.2 Debian base system miscellaneous files
ii base-passwd 3.5.9 Debian base system master password and group
ii bash 2.05b-26 The GNU Bourne Again SHell
ii bc 1.06-15 The GNU bc arbitrary precision calculator la
ii bin86 0.16.14-1.2 16-bit x86 assembler and loader
ii bind9-host 9.2.4-1 Version of 'host' bundled with BIND 9.X
ii binutils 2.15-6 The GNU assembler, linker and binary utiliti
ii bison 1.875d-1 A parser generator that is compatible with Y
ii bsdmainutils 6.0.17 collection of more utilities from FreeBSD
ii bsdutils 2.12p-4sarge1 Basic utilities from 4.4BSD-Lite
ii bzip2 1.0.2-7 high-quality block-sorting file compressor -
ii console-common 0.7.49 Basic infrastructure for text console config
ii console-data 2002.12.04dbs- Keymaps, fonts, charset maps, fallback table
ii console-tools 0.2.3dbs-56 Linux console and font utilities
ii coreutils 5.2.1-2 The GNU core utilities
ii cpio 2.5-1.3 GNU cpio -- a program to manage archives of
ii cpp 3.3.5-3 The GNU C preprocessor (cpp)
ii cpp-3.3 3.3.5-13 The GNU C preprocessor
ii cramfsprogs 1.1-6 Tools for CramFs (Compressed ROM File System
ii cron 3.0pl1-86 management of regular background processing
ii dash 0.5.2-5 The Debian Almquist Shell
ii dc 1.06-15 The GNU dc arbitrary precision reverse-polis
ii debconf 1.4.30.13 Debian configuration management system
ii debconf-i18n 1.4.30.13 full internationalization support for debcon
ii debianutils 2.8.4 Miscellaneous utilities specific to Debian
ii dhcp-client 2.0pl5-19.1 DHCP Client
ii dictionaries-c 0.25.12 Common utilities for spelling dictionary too
ii diff 2.8.1-11 File comparison utilities
rc discover1 1.7.7 hardware identification system
ii dnsutils 9.2.4-1 Clients provided with BIND
ii doc-debian 3.1 Debian Project documentation, Debian FAQ and
ii doc-linux-text 2005.04-1 Linux HOWTOs and FAQs in ASCII format
ii dpkg 1.10.28 Package maintenance system for Debian
ii dpkg-dev 1.10.28 Package building tools for Debian
ii dselect 1.10.28 a user tool to manage Debian packages
ii e2fslibs 1.37-2sarge1 ext2 filesystem libraries
ii e2fsprogs 1.37-2sarge1 ext2 file system utilities and libraries
ii ed 0.2-20 The classic unix line editor
ii eject 2.0.13deb-8sar ejects CDs and operates CD-Changers under Li
ii exim4-base 4.50-8sarge2 support files for all exim MTA (v4) packages
ii exim4-config 4.50-8sarge2 configuration for the exim MTA (v4)
ii exim4-daemon-l 4.50-8sarge2 lightweight exim MTA (v4) daemon
ii fdutils 5.4-20040228-1 Linux floppy utilities
ii file 4.12-1 Determines file type using "magic" numbers
ii findutils 4.1.20-6 utilities for finding files--find, xargs, an
ii finger 0.17-7 user information lookup program
ii flex 2.5.31-31sarge A fast lexical analyzer generator.
ii ftp 0.17-12 The FTP client.
ii g++ 3.3.5-3 The GNU C++ compiler
ii g++-3.3 3.3.5-13 The GNU C++ compiler
ii gcc 3.3.5-3 The GNU C compiler
ii gcc-3.3 3.3.5-13 The GNU C compiler
ii gcc-3.3-base 3.3.5-13 The GNU Compiler Collection (base package)
ii gdb 6.3-6 The GNU Debugger
ii gettext-base 0.14.4-2 GNU Internationalization utilities for the b
ii gnu-efi 3.0a-4 Library for developing EFI applications
ii gnupg 1.4.1-1.sarge3 GNU privacy guard - a free PGP replacement
ii grep 2.5.1.ds1-4 GNU grep, egrep and fgrep
ii groff-base 1.18.1.1-7 GNU troff text-formatting system (base syste
ii grub 0.95+cvs200406 GRand Unified Bootloader
ii gzip 1.3.5-10sarge1 The GNU compression utility
ii hdparm 6.1-2 tune hard disk parameters for high performan
ii hostname 2.13 A utility to set/show the host name or domai
ii hotplug 0.0.20040329-2 Linux Hotplug Scripts
ii hwinfo 8.38-3 Hardware identification system
ii iamerican 3.1.20.0-4 An American English dictionary for ispell
ii ibritish 3.1.20.0-4 A British English dictionary for ispell
ii ifupdown 0.6.7 high level tools to configure network interf
ii info 4.7-2.2 Standalone GNU Info documentation browser
ii initrd-tools 0.1.81.1 tools to create initrd image for prepackaged
ii initscripts 2.86.ds1-1 Standard scripts needed for booting and shut
ii ipchains 1.3.10-15 Network firewalling for Linux 2.2.x
ii iptables 1.2.11-10 Linux kernel 2.4+ iptables administration to
ii iputils-ping 20020927-2 Tools to test the reachability of network ho
ii ispell 3.1.20.0-4 International Ispell (an interactive spellin
pi kernel-image-2 2.6.8-16 Linux kernel image for version 2.6.8 on 386.
ii klogd 1.4.1-17 Kernel Logging Daemon
ii less 382-1 Pager program similar to more
ii libacl1 2.2.23-1 Access control list shared library
ii libattr1 2.4.16-1 Extended attribute shared library
ii libblkid1 1.37-2sarge1 block device id library
ii libbz2-1.0 1.0.2-7 high-quality block-sorting file compressor l
ii libc6 2.3.2.ds1-22sa GNU C Library: Shared libraries and Timezone
ii libc6-dev 2.3.2.ds1-22sa GNU C Library: Development Libraries and Hea
ii libcap1 1.10-14 support for getting/setting POSIX.1e capabil
ii libcomerr2 1.37-2sarge1 common error description library
ii libconsole 0.2.3dbs-56 Shared libraries for Linux console and font
ii libdb1-compat 2.1.3-7 The Berkeley database routines [glibc 2.0/2.
ii libdb3 3.2.9-22 Berkeley v3 Database Libraries [runtime]
ii libdb4.2 4.2.52-18 Berkeley v4.2 Database Libraries [runtime]
ii libdb4.3 4.3.27-2 Berkeley v4.3 Database Libraries [runtime]
rc libdiscover1 1.7.7 hardware identification library
ii libdns16 9.2.4-1 DNS Shared Library used by BIND
ii libevent1 1.0b-1.1 An asynchronous event notification library
ii libgc1 6.4-1 conservative garbage collector for C and C++
ii libgcc1 3.4.3-13 GCC support library
ii libgcrypt11 1.2.0-11.1 LGPL Crypto library - runtime library
ii libgdbm3 1.8.3-2 GNU dbm database routines (runtime version)
ii libgnutls11 1.0.16-13.2 GNU TLS library - runtime library
ii libgpg-error0 1.0-1 library for common error values and messages
ii libgpmg1 1.19.6-19sarge General Purpose Mouse - shared library
ii libident 0.22-3 simple RFC1413 client library - runtime
ii libidn11 0.5.13-1.0 GNU libidn library, implementation of IETF I
ii libisc7 9.2.4-1 ISC Shared Library used by BIND
ii libiw27 27-2 Wireless tools - library
ii libkrb53 1.3.6-2sarge2 MIT Kerberos runtime libraries
ii libldap-2.2-7 2.2.23-8 OpenLDAP libraries
ii libldap2 2.1.30-8 OpenLDAP libraries
ii liblocale-gett 1.01-17 Using libc functions for internationalizatio
ii liblockfile1 1.06 NFS-safe locking library, includes dotlockfi
ii liblwres1 9.2.4-1 Lightweight Resolver Library used by BIND
ii liblzo1 1.08-1.2 A real-time data compression library
ii libmagic1 4.12-1 File type determination library using "magic
ii libncurses5 5.4-4 Shared libraries for terminal handling
ii libncursesw5 5.4-4 Shared libraries for terminal handling (wide
ii libnewt0.51 0.51.6-20 Not Erik's Windowing Toolkit - text mode win
ii libnfsidmap1 0.8-1 An nfs idmapping library
ii libnss-db 2.2-6.3 DB Name Service Module
ii libopencdk8 0.5.5-10 Open Crypto Development Kit (OpenCDK) (runti
ii libpam-modules 0.76-22 Pluggable Authentication Modules for PAM
ii libpam-runtime 0.76-22 Runtime support for the PAM library
ii libpam0g 0.76-22 Pluggable Authentication Modules library
ii libpcre3 4.5-1.2sarge1 Perl 5 Compatible Regular Expression Library
ii libpopt0 1.7-5 lib for parsing cmdline parameters
ii libreadline4 4.3-11 GNU readline and history libraries, run-time
ii libreadline5 5.0-10 GNU readline and history libraries, run-time
ii libsasl2 2.1.19-1.5sarg Authentication abstraction library
ii libsigc++-1.2- 1.2.5-4 type-safe Signal Framework for C++ - runtime
ii libss2 1.37-2sarge1 command-line interface parsing library
ii libssl0.9.7 0.9.7e-3sarge1 SSL shared libraries
ii libstdc++5 3.3.5-13 The GNU Standard C++ Library v3
ii libstdc++5-3.3 3.3.5-13 The GNU Standard C++ Library v3 (development
ii libsysfs1 1.2.0-5 interface library to sysfs
ii libtasn1-0 0.1.2-5 Manage ASN.1 structures (runtime)
ii libtasn1-2 0.2.10-3sarge1 Manage ASN.1 structures (runtime)
ii libtext-charwi 0.04-1 get display widths of characters on the term
ii libtext-iconv- 1.2-3 Convert between character sets in Perl
ii libtext-wrapi1 0.06-1 internationalized substitute of Text::Wrap
ii libtextwrap1 0.1-1 text-wrapping library with i18n - runtime
ii libusb-0.1-4 0.1.10a-9.sarg userspace USB programming library
ii libuuid1 1.37-2sarge1 universally unique id library
ii libwrap0 7.6.dbs-8 Wietse Venema's TCP wrappers library
ii links 0.99+1.00pre12 Character mode WWW browser
ii linux-kernel-h 2.5.999-test7- Linux Kernel Headers for development
ri locales 2.3.2.ds1-22sa GNU C Library: National Language (locale) da
ii lockfile-progs 0.1.10 Programs for locking and unlocking files and
ii login 4.0.3-31sarge5 system login tools
ii logrotate 3.7-5 Log rotation utility
ii lpr 2003.09.23-7 BSD lpr/lpd line printer spooling system
ii lsof 4.74.dfsg.3-2 List open files.
ii m4 1.4.2-1 a macro processing language
ii mailx 8.1.2-0.200405 A simple mail user agent
ii make 3.80-9 The GNU version of the "make" utility.
ii makedev 2.3.1-77 creates device files in /dev
ii man-db 2.4.2-21 The on-line manual pager
ii manpages 1.70-1 Manual pages about using a GNU/Linux system
ii manpages-dev 1.70-1 Manual pages about using GNU/Linux for devel
ii mawk 1.3.3-11 a pattern scanning and text processing langu
ii mime-support 3.28-1 MIME files 'mime.types' & 'mailcap', and sup
ii module-init-to 3.2-pre1-2 tools for managing Linux kernel modules
ii modutils 2.4.26-1.2 Linux module utilities
ii mount 2.12p-4sarge1 Tools for mounting and manipulating filesyst
ii mpack 1.6-1 tools for encoding/decoding MIME messages
ii mtools 3.9.9-2.1 Tools for manipulating MSDOS files
ii mtr-tiny 0.67-1 Full screen ncurses traceroute tool
ii mutt 1.5.9-2sarge1 Text-based mailreader supporting MIME, GPG,
ii nano 1.2.4-5 free Pico clone with some new features
ii ncurses-base 5.4-4 Descriptions of common terminal types
ii ncurses-bin 5.4-4 Terminal-related programs and man pages
ii ncurses-term 5.4-4 Additional terminal type definitions
ii net-tools 1.60-10 The NET-3 networking toolkit
ii netbase 4.21 Basic TCP/IP networking system
ii netkit-inetd 0.10-10 The Internet Superserver
ii nfs-common 1.0.6-3.1 NFS support files common to client and serve
ii nvi 1.79-22 4.4BSD re-implementation of vi
ii passwd 4.0.3-31sarge5 change and administer password and group dat
ii patch 2.5.9-2 Apply a diff file to an original
ii pciutils 2.1.11-15 Linux PCI Utilities
ii perl 5.8.4-8sarge4 Larry Wall's Practical Extraction and Report
ii perl-base 5.8.4-8sarge4 The Pathologically Eclectic Rubbish Lister
ii perl-modules 5.8.4-8sarge4 Core Perl modules
ii pidentd 3.0.18-2 TCP/IP IDENT protocol server with DES suppor
ii portmap 5-9 The RPC portmapper
ii procmail 3.22-11 Versatile e-mail processor
ii procps 3.2.1-2 The /proc file system utilities
ii psmisc 21.5-1 Utilities that use the proc filesystem
ii python 2.3.5-2 An interactive high-level object-oriented la
ii python-newt 0.51.6-20 A NEWT module for Python
ii python2.3 2.3.5-3sarge1 An interactive high-level object-oriented la
ii rcs 5.7-15 The GNU Revision Control System
ii reportbug 3.8 reports bugs in the Debian distribution
ii sed 4.1.2-8 The GNU sed stream editor
ii sharutils 4.2.1-13 shar, unshar, uuencode, uudecode
ii slang1 1.4.9dbs-8 The S-Lang programming library - runtime ver
ii slang1a-utf8 1.4.9dbs-8 The S-Lang programming library with utf8 sup
ii ssh 3.8.1p1-8.sarg Secure rlogin/rsh/rcp replacement (OpenSSH)
ii strace 4.5.8-1.2 A system call tracer
ii sysklogd 1.4.1-17 System Logging Daemon
ii sysv-rc 2.86.ds1-1 Standard boot mechanism using symlinks in /e
ii sysvinit 2.86.ds1-1 System-V like init
ii tar 1.14-2.2 GNU tar
ii tasksel 2.24 Tool for selecting tasks for installation on
ii tcpd 7.6.dbs-8 Wietse Venema's TCP wrapper utilities
ii tcsh 6.13.00-1 TENEX C Shell, an enhanced version of Berkel
ii telnet 0.17-29 The telnet client
ii texinfo 4.7-2.2 Documentation system for on-line information
ii time 1.7-21 The GNU time program for measuring cpu resou
pi traceroute 1.4a12-18 traces the route taken by packets over a TCP
ii udev 0.056-3 /dev/ management daemon
ii usbmount 0.0.10 automatically mount and unmount USB mass sto
ii usbutils 0.70-8 USB console utilities
ii util-linux 2.12p-4sarge1 Miscellaneous system utilities
ii w3m 0.5.1-3 WWW browsable pager with excellent tables/fr
ii wamerican 5-4 American English dictionary words for /usr/s
ii wget 1.9.1-12 retrieves files from the web
ii whiptail 0.51.6-20 Displays user-friendly dialog boxes from she
ii whois 4.7.5 the GNU whois client
ii wireless-tools 27-2 Tools for manipulating Linux Wireless Extens
ii zlib1g 1.2.2-4.sarge. compression library - runtime
Then I just have to copy over the appropriate config files from /etc and I'm all set with a cloned system, even if the hardware is different.
You gussed it right. I am also trying to do the same i.e. clone the system(atleast the packages).
I tried the --get-selections and even in that it showed that some packages have purge/deinstall status. Now why is that? I am really confused here as to what is happening? Why does these command gives list of packages which are purged/uninstalled.
You know, I think I asked that same question once on the Debian forum here at LQ and didn't get any response. I tried googling the net a bit, but in the end, it was all working right so I didn't bother asking it again.
Maybe it has something to do with how the system has changed from the base install. i.e. if you purged exim from the base system, you want to mark it as purged on the new system also. That was my guess as to what was happening.
I bet only packages from a bare bones install are marked that way. Anything else would probably be left off (for example if you installed Battle for Wesnoth, and then purged it, I bet it wouldn't show up on your list at all). Note, I haven't tried this, but it would be pretty easy to install something like that and then --get-selections to one file. Then purge it and --get-selections to another file. Then diff the two files...
A quick answer to why some packages show "deinstall" or "purge" (I haven't double checked it, it is from memory)
It doesn't matter what it says. If you get-selections on one machine, and you do set-selctions on the other one you'll end up with the same dpkg status. I did this a few times, and nothing to worry about.
However, WHEN you do this, make sure you have the same /etc/apt/sources.list on both machines. When you have different versions pointing at in sources.list, you'll end up in chaos. (Not unrecoverable though)
You know, I think I asked that same question once on the Debian forum here at LQ and didn't get any response. I tried googling the net a bit, but in the end, it was all working right so I didn't bother asking it again.
Maybe it has something to do with how the system has changed from the base install. i.e. if you purged exim from the base system, you want to mark it as purged on the new system also. That was my guess as to what was happening.
I bet only packages from a bare bones install are marked that way. Anything else would probably be left off (for example if you installed Battle for Wesnoth, and then purged it, I bet it wouldn't show up on your list at all). Note, I haven't tried this, but it would be pretty easy to install something like that and then --get-selections to one file. Then purge it and --get-selections to another file. Then diff the two files...
Thanks buddy. I second you on that. Thanks for all the help. Atleast I am not the only one who thought like that.
A quick answer to why some packages show "deinstall" or "purge" (I haven't double checked it, it is from memory)
It doesn't matter what it says. If you get-selections on one machine, and you do set-selctions on the other one you'll end up with the same dpkg status. I did this a few times, and nothing to worry about.
However, WHEN you do this, make sure you have the same /etc/apt/sources.list on both machines. When you have different versions pointing at in sources.list, you'll end up in chaos. (Not unrecoverable though)
jlinkels
Ok, so I got another question which is a logical extension of this one.
Suppose I have a MAchine A on which I do base installation and add some additonal packages.
Now I have a machine B on which I would like to install packages of A i.e. Machine B is a clone of MAchine A. But Machine B already has a base-install + it has some other packages like alsa-utils xmms which Machine A does not have. So now I want that all the packages of A are installed on MAchine B and whatever Extra packages machine B has I want to purge/remove them. Will the method that you suggested will work? i.e. If I run the following commands will I be able to achieve what I want i.e. Machine B is a clone of Machine A.
Code:
On Machine A
dpkg --get-selections > selections.txt
Then transfer the file selections.txt from A to B
On Machine B
apt-get update
dselect update
dpkg --set-selections < selections.txt
apt-get dselect-upgrade
Any ideas? this will really clear loads of doubt from my mind that I have for this method.
My gut feeling is that it will remove all packages that are not set as install (not sure it will purge though). But I guess the only way to find out is to try it (i.e. intentionally install something extra that you know is extra like wesnoth). Then get-selections again to a different file and compare the two files. You should be able to compare relatively quickly.
If I was a scripter, I could probably even figure out an awk string to mark all the packages that don't match as purge. Then you could set-selections with the new file and purge all the extraneous packages...
Uhm.. not that I don't want to help anyone, but this comes into an area where thorough reading of the man pages will give you more reliable information that I can give you.
Anyway, your question:
Quote:
So now I want that all the packages of A are installed on MAchine B and whatever Extra packages machine B has I want to purge/remove them.
The answer is most likely "no"
If you have a list of packages, then
Code:
package1 install
will install the package
Code:
package2 deinstall
will deinstall the package
Packages which are not being mentioned in your file will be left alone by dpkg.
If you want to deinstall/purge files on machine B in an automated way, you could run --get-selections on both machines and do a diff of the two files. For the files which are present on B and not on A, you could change "install" to "de-install" and run dpkg on B.
OK, i've been trying to follow this up. What i want to do, is a small diskquett which in cludes 2 Sh-Scripts. One to set up APT (its sources) and a second one to insall my personal softwre "minimum". Can you guys help me out? I thought i could just install all the "minimum" stuff i want, and then use the dpkg --get-selections-technique to make a list of the stuff. Whill this work? Thanks
In principle, yes. (that is what the thread is about) Your minimum set of packages will be installed.
However, you might need to copy some more files, like /etc/apt/sources.list to make sure you use the same version. Maybe apt-conf as well if you modified it.
The same goes for any personal stuff you want to have installed on the other machine, like adapted bashrc or so.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.