apt-get interface + cleanup utility

April 22, 2011

For debian and ubuntu, and their derivatives. You will want apt-listbugs and apt-listchanges for the full experience.
Needs work but it shouldn’t destroy your system unless wordpress has munted it or I’ve overlooked something. so no promises.

create an executable bash file with this code and fire away as su/sudo for a menu driven apt-get interface with cruft cleaning capabilities…

#!/bin/bash clear echo Enter Package Name read PKG clear MODE="Normal" showMenu () { echo -e "\E[00;35m$PKG" tput sgr0 echo "Security Mode: $MODE" if [ "$MODE" = "Fast" ] then echo -e "\E[00;33m WARNING: Prompts disabled : BE CAREFUL!!!" tput sgr0 echo "1) Install - Install immediately" echo "2) Remove - Purge package and settings immediately" echo "3) Show - Display package information" echo "4) Identify Bugs - Display bug information" echo "5) Change Log - This doesnt work yet, sorry" echo "6) Reconfigure - Reconfigure package settings" echo "7) Upgrade - Upgrade Debian Immediately" echo "8) DPKG Clean - Remove leftover dependencies and settings" echo "9) DPKG Fix - Attempt to fix broken packages" echo "0) Simulate - Simulate actions - This doesnt work yet, sorry" echo "m) Security Mode - Switch security mode" fi if [ "$MODE" = "SUPER" ] then echo -e "\E[00;31m ACTION FORCED : USE EXTREME CAUTION!!!" tput sgr0 echo "1) Install - Forced install immediately" echo "2) Remove - Forced purge package and settings" echo "3) Show - Display package information" echo "4) Identify Bugs - Display bug information" echo "5) Change Log - This doesnt work yet, sorry" echo "6) Reconfigure - Forced reconfigure package" echo "7) Upgrade - Forced debian upgrade" echo "8) DPKG Clean - Remove orphans and cache" echo "9) DPKG Fix - Fix broken packages" echo "0) Simulate - Simulate actions - This doesnt work yet, sorry" echo "m) Security Mode - Switch security mode" fi if [ "$MODE" = "Normal" ] then echo -e "\E[00;32m User prompts enabled." tput sgr0 echo "1) Install - Install package" echo "2) Remove - Purge package and settings" echo "3) Show - Display package information" echo "4) Identify Bugs - Display bug information" echo "5) Change Log - This doesnt work yet, sorry" echo "6) Reconfigure - Reconfigure package" echo "7) Upgrade - Debian upgrade" echo "8) DPKG Clean - Clean leftovers" echo "9) DPKG Fix - Check for broken packages" echo "0) Simulate - Simulate actions - This doesnt work yet, sorry" echo "m) Security Mode - Switch security mode" fi echo "q) Quit" echo "k) New Query" echo "l) Search" sudo apt-get check echo "Make your selection" } while [ 1 ] do showMenu read -n1 CORE case "$CORE" in "1") clear echo "Installing $PKG." apt-cache show $PKG sudo apt-get update if [ "$MODE" = "Normal" ] then sudo apt-get --no-install-recommends install $PKG fi if [ "$MODE" = "Fast" ] then sudo apt-get install $PKG fi if [ "$MODE" = "SUPER" ] then sudo apt-get -f install $PKG fi ;; "2") clear echo "Removing $PKG." if [ "$MODE" = "Normal" ] then sudo apt-get purge $PKG fi if [ "$MODE" = "Fast" ] then sudo apt-get -y purge $PKG fi if [ "$MODE" = "SUPER" ] then sudo apt-get purge -f $PKG fi sudo apt-get -y autoremove sudo dpkg --purge $(dpkg --get-selections|grep deinstall|awk '{print $1}') ;; "3") clear apt-cache show $PKG ;; "4") clear echo "Checking $PKG for bugs." apt-listbugs -s all list $PKG ;; "5") clear #echo "Showing $PKG changelog." #apt-listchanges -f -v --apt $PKG -something something? echo "This doesnt work yet, sorry" ;; "6") clear echo "Reconfiguring $PKG." if [ "$MODE" = "Normal" ] then sudo dpkg-reconfigure $PKG fi if [ "$MODE" = "Fast" ] then sudo dpkg-reconfigure $PKG fi if [ "$MODE" = "SUPER" ] then sudo dpkg-reconfigure -u $PKG fi ;; "7") clear echo "Upgrading Debian!" sudo apt-get update if [ "$MODE" = "Normal" ] then sudo apt-get dist-upgrade fi if [ "$MODE" = "Fast" ] then sudo apt-get -y dist-upgrade fi if [ "$MODE" = "SUPER" ] then sudo apt-get -f dist-upgrade fi ;; "8") echo "Removing leftover files" if [ "$MODE" = "Normal" ] then sudo apt-get autoremove sudo dpkg --purge $(dpkg --get-selections|grep deinstall|awk '{print $1}') fi if [ "$MODE" = "Fast" ] then sudo apt-get -y autoremove sudo dpkg --purge $(dpkg --get-selections|grep deinstall|awk '{print $1}') fi if [ "$MODE" = "SUPER" ] then sudo apt-get -y autoremove sudo deborphan | sed 's/$/ purge/' | dpkg --set-selections sudo deborphan | sed 's/$/ remove/' | dpkg --set-selections sudo dpkg --purge $(dpkg --get-selections|grep deinstall|awk '{print $1}') sudo apt-get autoclean fi ;; "9") clear echo "Attempting to fix DPKG" if [ "$MODE" = "Normal" ] then sudo apt-get -f install fi if [ "$MODE" = "Fast" ] then sudo apt-get -f -y install fi if [ "$MODE" = "SUPER" ] then sudo apt-get -f -m -y install fi ;; "k") clear echo Enter Package Name read PKG ;; "m") clear if [ "$MODE" = "Normal" ] then MODE="Fast" else if [ "$MODE" = "Fast" ] then MODE="SUPER" else if [ "$MODE" = "SUPER" ] then MODE="Normal" fi fi fi ;; "l") clear echo Enter search Query: read SEARCH apt-cache search $SEARCH ;; "q") clear exit :: esac done

Centigog Draft

April 22, 2011

David Nixon was feeling restless. He tossed and turned in his bed, his mind filled with swimming patterns which swirled and twisted eventually forming the visions that makes the heart beat and the body sweat with terror. I am asleep, or am I awake? It’s a impossible for him to tell but the taste of chlorine is all too real. In the darkest recesses of his mind swells the familiar company of faces. His ex-girlfriend, tears in her eyes and face towards the ground, her head raises then vanishes into a dark mist. His parents frowning at him, shaking their heads before turning away and disappearing down an impossible corridor of broken dimensions. He stumbles, turns, trips across something and pushes himself away from the objects of his madness with everything he’s got. Striding down the broken cobblestone path he launches himself with a mighty stride onto the rooftop of a nearby villa, sending red plaster plates onto the causeway below. At last he can take a proper look at the landscape.

The city is dark, darker still than the maze of urban metropolis that greets him on his way home from the institution each day. Highlighted by the polka dot multicoloured lights of the street lamps and shop lights. No, this city is much darker than that. Light emanates from nothing Shadows from objects undefinable creep outward in every shape and form. The horizon is smeared with a dirty green haze from which thousands of broken concrete blocks hold firmly against the cracked ground, lifting into the crimson red sky of a infinite dusk. The dusk silhouettes a single solitary tree, long deceased, from behind the tree steps a figure in a hooded cloak, its presence long forgotten, it points a finger, beckoning…

He wakes up with a scream which pierces the empty space of his cold room. With a start David realises that he has just been released from his most terrible nightmare ever, but cannot explain what brought it on. Immediately his rational mind kicks in, begins to reason and evaluate the state of his reeling thoughts but, for once he comes short and nothing makes sense. He lets out a long sigh, reaches out for his bottle of rocket fuel and pours a long glass. Even then his mind is still racing. Who was that girl in the cloak? What does she want with me?


Follow

Get every new post delivered to your Inbox.