|
/Linux/Debian:
Software Package Management in Debian (and Ubuntu)
I particularly dislike graphical package managers, as they are all seem slow and, I think, not much easier to use then the command line. Here is a little quick start guide to using the command line to install and remove software in Debian or Ubuntu:
Search for software:
apt-cache search {space separated list of key words}Display information about a particular package:
apt-cache show {name of package}Upgrade: update your software list and then upgrade all installed software to the latest version:
apt-get updateInstall a defined list of packages:
apt-get upgrade
apt-get install {space separated list of package names}wajig, a useful utility: install wajig and less:
apt-get updateThen "wajig list-commands", which will produce output that is more then one page long, so even better is:
agt-get install wajig less
"wajig list-commands | less"
(Exit less by entering "ZZ")
"|" is the "pipe" operator, found on the same key as "\" on my keyboard, and is one of those whiz-bang UNIX features that, after you accumulate a short list, will leave you quite disinterested in ever going back to Micro$oft Windows.
Hold a package and exclude it from automatice upgrades:
'echo -e "python-pysqlite2 hold" | dpkg --set-selections'
where python-pysqlite2 is the package to be held. Thereafter, when one performs an "apt-get upgrade" the held package appears in the "following packages have been kept back" section, and requires a manual "apt-get install python-pysqlite2" to re-instate the latest version.
Revert a package to an older version:
For instance, if you track "testing", but want to use the occasional unbroken package in "stable", your "/etc/apt/sources.list" should contain the following two lines:
deb http://ftp.us.debian.org/debian/ testing main contrib non-free
deb http://ftp.us.debian.org/debian/ stable main contrib non-free
"testing" will take precedence over "stable" as it appears first in the list. Now suppose a just updated piece of "testing" software is broken. First find out what versions are available in your current archive:
apt-cache policy python-pysqlite2
To install an older version:
apt-get install python-pysqlite2=2.4.1-1
where the version identifier comes after the "=". And now, to prevent your just downgraded package from being clobbered by automatic upgrades, put the package on "hold", as described in the previous section.
posted at: 08:35 | path: /Linux/Debian | permanent link to this entry