Commands matching dpkg (119)

  • Use dpkg-query to query packages.


    0
    dpkg-query -W -f '${binary:Package} ${Status}\n' '*' |sed -n 's/ deinstall ok config-files//p'|xargs dpkg --purge
    ceving · 2016-09-06 11:43:04 15

  • 0
    sudo apt-get purge `dpkg -l | grep php| awk '{print $2}' |tr "\n" " "`
    bDrwx · 2016-09-23 15:33:18 25
  • select generic 105 intl. pc > german (turkisch)


    0
    dpkg-reconfigure keyboard-configuration
    aysadk · 2017-07-14 15:04:02 100
  • Same as 7272 but that one was too dangerous so i added -P to prompt users to continue or cancel Note the double space: "...^ii␣␣linux-image-2..." Like 5813, but fixes two bugs: [1]This leaves the meta-packages 'linux-headers-generic' and 'linux-image-generic' alone so that automatic upgrades work correctly in the future. [2]Kernels newer than the currently running one are left alone (this can happen if you didn't reboot after installing a new kernel).


    -1
    sudo aptitude remove -P $(dpkg -l|awk '/^ii linux-image-2/{print $2}'|sed 's/linux-image-//'|awk -v v=`uname -r` 'v>$0'|sed 's/-generic//'|awk '{printf("linux-headers-%s\nlinux-headers-%s-generic\nlinux-image-%s-generic\n",$0,$0,$0)}')
    Bonster · 2011-04-25 05:19:57 3

  • -1
    dpkg -l | sed '/^rc/!d;s/^[^ ]* [^ ]* \([^ ]*\).*/\1/' | xargs -r sudo apt-get -y purge
    plasticdoc · 2011-06-05 09:19:27 3

  • -1
    dpkg -l |grep i386 | awk '{ print "apt-get -y remove --purge "$2 }' | sh
    rubenmoran · 2013-03-23 19:19:24 5

  • -1
    sudo dpkg -i *.deb
    newnumber · 2017-06-20 11:45:35 16

  • -1
    sudo fuser -vki /var/lib/dpkg/lock; sudo dpkg --configure -a
    newnumber · 2017-06-20 12:00:02 22

  • -2
    dpkg -L Your_Package
    eastwind · 2009-12-06 14:49:04 3

  • -2
    dpkg --get-selections | awk '$2=="install" {print $1}' | sort
    depesz · 2011-03-15 08:39:26 4
  • Uses dpkg -S or apt-file to find the file you want and shows results in various ways. Available at https://github.com/Pipeliner/configs/blob/master/bin/pacof pacof -xp 'bin/[^/]*mixer' alsamixergui alsa-tools-gui alsa-utils ... Show Sample Output


    -2
    pacof -e rlogin
    pipeliner · 2011-11-04 13:17:04 4
  • This will, for an application that has already been removed but had its configuration left behind, purge that configuration from the system. To test it out first, you can remove the last -y, and it will show you what it will purge without actually doing it. I mean it never hurts to check first, "just in case." ;)


    -3
    dpkg-query -l| grep -v "ii " | grep "rc " | awk '{print $2" "}' | tr -d "\n" | xargs aptitude purge -y
    thepicard · 2009-04-28 19:25:53 11
  • Use the hold space to preserve lines until data is needed.


    -3
    sed -ne '/^Package: \(.*\)/{s//\1/;h;};/^Installed-Size: \(.*\)/{s//\1/;G;s/\n/ /;p;}' /var/lib/dpkg/status | sort -rn
    arcege · 2009-10-19 19:01:17 24

  • -3
    sudo dpkg -P $(dpkg -l | grep -i adobeair)
    xmonkey · 2010-11-02 14:09:16 4

  • -4
    dpkg-reconfigure -phigh xserver-xorg
    raiden · 2009-02-26 21:22:57 7
  • Useful for removes a package and its depends, for example to remove the gnome desktop environment, also configuration files will be removed, you should be carefully and sure that you want to do this. Show Sample Output


    -4
    sudo apt-get remove --purge `dpkg -l | awk '{print $2}' | grep gnome` && apt-get autoremove
    kelevra · 2009-04-28 10:34:42 14
  • convert to debian package file (deb) a redhat package file (rpm) , then you can install it by using dpkg , require alien package ( sudo apt-get install alien first ) Show Sample Output


    -5
    sudo alien --to-deb Your_PackAge.rpm
    eastwind · 2009-09-27 13:49:07 5
  • IMVHO if you are using cpan to install perl modules you are doing it wrong. Show Sample Output


    -5
    dpkg-query -W | grep perl
    unixmonkey10924 · 2010-07-20 16:14:04 4
  • Install a deb package you have downloaded (synaptic has to be closed). (dpkg-dev needs to be installed) After that you may have to run following: sudo apt-get install -f (that should fix any dependency problems) I am using ubuntu linux


    -7
    sudo dpkg -i packagename.deb
    bkn390 · 2009-09-25 09:54:04 13
  • ‹ First  < 3 4 5

What's this?

commandlinefu.com is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.

Share Your Commands


Check These Out

Disassemble all ACPI tables on your system
The fact that Linux exposes the ACPI tables to the user via sysfs makes them a gold mine of valuable hardware information for low-level developers. Looping through each of them and disassembling them all makes them even more valuable.

Your name backwards

test for ksh/bash
Dave Korn gave me this one. It works because ksh allows variable names ( w/o the $name syntax ) used by sh and bash. I wrote it to permit "single source" shell libraries; the current objective: every shell library may be sourced by either shell. see http://github.com/applemcg/backash

Which processes are listening on a specific port (e.g. port 80)
swap out "80" for your port of interest. Can use port number or named ports e.g. "http"

Find the package that installed a command

extract element of xml
poor man's xml parser :)

Convert seconds to [DD:][HH:]MM:SS
Converts any number of seconds into days, hours, minutes and seconds. sec2dhms() { declare -i SS="$1" D=$(( SS / 86400 )) H=$(( SS % 86400 / 3600 )) M=$(( SS % 3600 / 60 )) S=$(( SS % 60 )) [ "$D" -gt 0 ] && echo -n "${D}:" [ "$H" -gt 0 ] && printf "%02g:" "$H" printf "%02g:%02g\n" "$M" "$S" }

convert a .wmv to a .avi

Displays user-defined ps output and pidstat output about the top CPU or MEMory users.
It grabs the PID's top resource users with $(ps -eo pid,pmem,pcpu| sort -k 3 -r|grep -v PID|head -10) The sort -k is sorting by the third field which would be CPU. Change this to 2 and it will sort accordingly. The rest of the command is just using diff to display the output of 2 commands side-by-side (-y flag) I chose some good ones for ps. pidstat comes with the sysstat package(sar, mpstat, iostat, pidstat) so if you don't have it, you should. I might should take off the timestamp... :|

Encrypted chat with netcat and openssl (one-liner)
client$ while true; do read -n30 ui; echo $ui |openssl enc -aes-256-ctr -a -k PaSSw ; done | nc localhost 8877 | while read so; do decoded_so=`echo "$so"| openssl enc -d -a -aes-256-ctr -k PaSSw`; echo -e "Incoming: $decoded_so"; done This will establish a simple encrypted chat with AES-256-CTR using netcat and openssl only. More info here https://nixaid.com/encrypted-chat-with-netcat/


Stay in the loop…

Follow the Tweets.

Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.

» http://twitter.com/commandlinefu
» http://twitter.com/commandlinefu3
» http://twitter.com/commandlinefu10

Subscribe to the feeds.

Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):

Subscribe to the feed for: