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

Make a file not writable / immutable by root
http://linuxhelp.blogspot.com/2005/11/make-your-files-immutable-which-even.html

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" }

Find installed network devices
Find installed network devices.

find directory with most inodes/files
Find which directory in one filesystem that contains most inodes or files.

mplayer webcam window for screencasts
When recording screencast some people like to have the image from their webcam, so the can show something, that can't be seen on the desktop. So starting mplayer with these parameters you will have a window with no frames, borders whatsoever, and selecting the window a hitting the "F" key you will bring it in fullscreen. if you want to position the frame somewhere else, you could play with the --geomeptry option where 100%:100% mean bottom right corner. The HEIGHT and WIDTH can't be changed as you like, since the most webcams support specified dimensions, so you would have to play with it to see what is supported

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"

Create a bunch of dummy text files

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" }

drop first column of output by piping to this

Find files and calculate size of result in shell
Find files and calculate size with stat of result in shell


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: