Tales of an IT Nobody

devbox:~$ iptables -A OUTPUT -j DROP

Is apt apting nasty? March 15, 2010

Doing spring cleaning on our dev box today – apt has been starting to harp me about wanting to autoremove a lot of useful packages – including apt itself! Odd! I’ve learned a few new things today, that’s for sure.

So I went on a mission today to clean up everything package related on the box. In the end, I cleaned out packages, and freed ~800MB.

You can see more diagnostic information/steps on my linuxquestions forum post.
I also came across a handy resource in downgrading that goes into good depth here.

Here’s some things you might find useful if apt is being a pain – My biggest problem came in the form of a nasty autoremove message from apt:

The following packages were automatically installed and are no longer required:
   apt libwrap0-dev
The following packages will be REMOVED:
   apt libwrap0-dev

That’s right – apt wanted to remove itself! Turns out this is a product of having a misconfigured sources.list:

  deb http://debian.uchicago.edu/debian/ stable main contrib

Somehow, running dist-upgrade over time caused apt to update to the squeeze version of apt

  0.7.20.2+squeeze1

To fix this, I had to change stable to lenny in my sources.list, then you can perform a downgrade on a specific package like so:

  deb http://debian.uchicago.edu/debian/ lenny main contrib
  cd /var/cache/apt/archives/
  rm -rf *
  mkdir partial
  apt-get update
  apt-get install apt/stable
  apt-get update && echo “For good measure!”



Because of your sources.list change, apt will think the proper version is the ‘stable’ one, and will REINSTALL/DOWNGRADE apt for you. This fixed the version issue.



1 Comment on Is apt apting nasty?
Categories: Uncategorized

Command line musings: whiptail and dialog

A quick jaunt on cool command utils for ‘command line ui’ installations/prompts for those who are into that kind of stuff for configuration tools, etc;

Whiptail
Whiptail is a handy utility that allows you to create colorized command line dialogs that you see when configuring certain things such as postfix or zend server, etc.

For scripts that utilize this, it’s important to note the latter part of the man page. Yes/OK returns 0; No/Cancel returns 1. For internal errors/malformed command, whiptail returns -1.

Sample output:

 * Note: The “10 30” is height, and width represented in cols and rows not pixels.
Sample command:
whiptail –yesno –title “Question for you” “This is cool, no?” 10 30

Dialog
Dialog is a more powerful counterpart than whiptail, much more verbose in it’s usage providing flexability.

Sample output:


Sample command:
dialog –title “Dialog title” –checklist “Instructions for dialog”, 15 60 2 \
optionA “Description for A goes here” valA \

optionB “Description for B goes here” valB

Make sure you read the man pages on the return codes for use in your various shell scripts, etc.

No Comments on Command line musings: whiptail and dialog
Categories: linux purdy