MySQL DBA - Tips and Techniques Magazine

3 Oct 2014

Debian Based Package Management

Think of apt-get as an app store.

Puppet & Chef allow us to automate installing packages over hundreds of machines.

vi /etc/apt/sources.list      (shows where apt-get looks ( ,, you can add third party sites – make sure you trust them).  

a)      apt-get update

b)      apt-cache search  apache2

c)      apt-get –s apache2  (simulation)

d)      apt-get -y install  apache2    (also takes care of dependencies)

e)      apt-get clean  (removes temporary install files in the cache)

( apt-get autoclean (removes removes obsolete packages that can no longer be downloaded)

(apt-get autoremove (removes obsolete packages that were installed as dependencies)

To upgrade the kernel, cant just update:

               apt-get dist-upgrade   (this will remove old packages, install new ones)

APT-CACHE   - can query meta-data

Sources.list file shows sources for repos that are stored in our cache.

apt-cache stats                 - shows all package stats, total number and size

apt-cache pkgnames       - names of all packge

apt-cache depends apache2 (shows dependencies for installing apache2)

apt-cache unmet              (packages that have unmet dependencies)

DPKG Command Set (for debian/Ubuntu) - manually install deb* packages

1.      Check version and 64 bit, then download the DPKG command set :

wget --no-check-certificates 

2.      Rename it 

mv download?dl=packages/debian/dropbox_1.6.0_amd64.deb dropbox.deb


3.      Install it

dpkg -i dropbox.deb    (fails due to missing dependencies)


apt-get updates

apt-get -f upgrade   (its going to fix the above)


4.      dpkg -i dropbox.deb   

5.      check


which dropbox


dpkg --get-selections |grep dropbox  (shows drop package is installed)


dpkg -L dropbox   (lists all package files and locations )


6.      can rerun the config file if there is one


dpkg-reconfigure dropbox

7.      To remove it

dpkg --remove dropbox   (leaves config files)

dpkg --purge dropbox (removes all + config files)

Summary and Overview of Aptitude and Dselect


High level text based program to do what apt-get does i.e manage packages

aptitude search

aptitude update

man aptitude

GUI based interface as well - easier than command line


               installed package

               uninstalled packages (available in repos)


eg can mark a package to be never updated


Can drill down

Dselect (unsupported and not installed by default anymore)

high level package manager, interface into apt-get, using "ncurses" menu system (out of date)

apt-get install dselect

No comments:

Post a Comment