home / linux / debian (navigation links) El hombre es esclavo de sus palabras y dueño de sus silencios

Debian Tips and Tricks


Overview

See here

APT

 written by will trillich <will@dontUthink.com>
# 2000 oct 19, thurs
DEBIAN'S ADVANCED PACKAGE TOOL -- apt
 Debian uses a cool packaging system that takes care of dependencies for you 
 -- packageA may require packageB, which requires packageC, 
 and the Advanced Package Tool (apt) will take care of installing packageC and packageB if you request packageA. 
 Very nice!

 To see what apt-* commands you have available, try this :
 type 'apt' at the command prompt of your shell, and then press TAB/CONTROL-D... 
 most shells will then display for you all the commands (avilable on your $PATH list) that start with those letters. 
 A great way to find useful nuggets!

SETUP -- Advanced Package Tool (apt)
 This little gizmo sets up the configuration file for you :
  apt-setup
 It asks you some questions and winds up configuring your /etc/apt/sources.list file, 
 which is used by the apt utilities to download and upgrade packages on your debian system.

 /etc/apt/sources.list is the file that tells your AdvancedPackageTool (apt) 
 where to look when you want to update current packages or install new ones.

 To learn about the format of this file, try
  man sources.list

 For a list of debian mirrors to use in sources.list, try
  http://www.debian.org/misc/README.mirrors
 or just re-run the apt-setup utility.

 NOTE -- keep in mind that debian is a work-in-progress,
 meaning that as holes are found and bugs are kilt in the stable distribution, 
 a whole new world is developing on the UNSTABLE distribution. 
 If you need something from 'unstable' go ahead and try it; 
 this is fine if you don't mind being on the "front lines" so to speak. 
 Most of us stick with the STABLE distribution, which has no new gizmos being created;
 only patches and fixes are added to the STABLE release. 
 You might occasionaly want to delve into UNSTABLE territory, for some new functionality 
 that's not available in the stodgy, old, >>dependable<< stable area.  
 It's up to you, but don't expect a refund if something breaks -- it's called UNSTABLE for a reason!
 You can hop back and forth between the two by changing 'stable' to 'unstable' or vice-versa, in your sources.list file.
 Stick with STABLE, though, if you can. 
 If you're running a production server, definitely shy away from UNSTABLE 
 unless you like soothing the frazzled nerves of management, and their paying customers, and your spouse,
 who keeps asking why you're always looking for a new job.

UPDATING YOUR SYSTEM -- apt-get upgrade
 Once sources.list is set up and you're online, first you
  apt-get update
 to refresh the package list to include the latest fixes, and then simply
  apt-get upgrade
 to download, configure and then install any packages you've got that have been tweaked. 
 You'll probably wanna do this periodically to squash bugs and plug security holes.

INSTALLING PACKAGES -- apt-get install
 When you're online, to install new packages you want to use, simply use something like
  apt-get install vim traceroute mysql-server mysql-client
  apt-get install logcheck
 to download, configure and install whichever packages you want

FINDING PACKAGES -- apt-cache search
 whether you're online or not--
 How do you find the package that's got the feature you want?
 There are several options, and all require that you know some of the accepted terminology of the feature you're after:
  apt-get update
 then when your package list is up-to-date,
  apt-cache search tunnel
  apt-cache search 'php.*sql'
  apt-cache search apache.\*perl
  apt-cache search elvis\|vim

 Search packages with REGEX -- if your pattern uses any keystrokes that mean something to the shell (e.g. [|?*])
 you'll need to quote them so that apt-cache will be able to see them, 
 instead of having the shell expand the term to a list of file names that mean something else entirely.

 NOTE -- apt-cache only knows about the package descriptions you've already downloaded. 
 If there are new ones to be had, browse to http://packages.debian.org/PACKAGESUBSTRING to see what's available. for example:
  http://packages.debian.org/vnc
 will get you a listing of packages that contain the term "vnc" somewhere in the title.

DESCRIBING PACKAGES -- apt-cache show
 The simplest way to see the description of a package :
  apt-cache show postgresql
  apt-cache show iproute
 This displays what the package is designed to do, version info and so forth.

LISTING PACKAGES -- dpkg -l
 Which packages are installed ? Do any need configuring ?
  dpkg -l
 (that's a lower-case EL, not a one.) lists all INSTALLED packages.

  dpkg -l \*
 lists all packages.

  dpkg -l '*postgres*'
 list status of packages matching GLOB (not regex: a regex uses .* to mean 'any character, zero or more times'; 
 in a glob, .* means a dot, followed by zero or more characters).

 If your pattern uses metacharacters (* ? | etc.) you'll need to quote it so that your command shell doesn't interpret it
 -- you want dpkg to see the pattern, instead.

 Combine that with grep for some powerful searches:
  dpkg -l \* | grep ^pi
 finds installed packages marked to be purged.

  dpkg -l \* | grep "[]"
 lists packages marked for installation, that aren't installed yet.

  dpkg -l \* | grep '^[]i'
 shows installed packages that won't stay that way.

 See 'man grep' for more info on grep and 'man dpkg' for
 more on the listing format.

PACKAGE CONTENTS -- dpkg -L
  dpkg -L mysql
  dpkg -L apt
 (with an upper-case EL) shows all the files -- with full path names -- that are provided by the package.

FINDING WHICH PACKAGE SUPPLIES... -- dpkg -S
 how to find which package contains a certain file:
  dpkg -S postmaster
  dpkg -S 'doc/*sql' | cut -f1 -d: | sort -u
 search for packages that supply files whose paths contain the GLOB. 
 See 'man cut' and 'man sort' for info on how to use these tools in your day-to-day mungings.

Handy-dandy stuff, once you get used to it.

Learn more :

  • man apt-get
  • man sources.list
  • man dpkg
  • man grep
  • man cut
  • man sort
dpkg -i nombrepaquete.deb
/etc/apt/sources.list
synaptic : entorno gráfico para apt para Linex.

Amunt! Top Amunt!
Linex

Homepage

inittab
See here
Com escollir el Desktop

Amb la icona de "Sesion" puc escollir entre Gnome i Xfce, però el KDE no hi es !

Per altra banda, quan arrenca el SuSE 8.2, em deix escollir entre

M'agradaria sapiguer quin programa és el que m'està deixant veure aquesta selecció ! init
Vocabulary Linex

Amunt! Top Amunt!
Links

Ep ! site under construction. Escriu-me ! Actualitzat el 20130317   Uf !