|Free Software at Schools: Installing and Maintaining a Debian-Edu Network; Also Known as Skolelinux|
|Prev||Chapter 8. Fine-tuning[id=finetuning]||Next|
In order to install packages, you need to define where you want to get them from, where your package reservoir is.
You define your package reservoir in the file /etc/apt/sources.list
A quick introduction to the use of the command line for working with packaqe administration is given in this section.
deb ftp://ftp.skolelinux.no/debian/ woody main contrib non-free deb ftp://ftp.skolelinux.no/debian-non-US/ woody/non-US main contrib non-free deb ftp://ftp.skolelinux.no/skolelinux/ woody local
These lines contain information about where you can get your packaqes.
If you add new lines to this file, then you have to update the database that contains information about what is available.
See Chapter 14 for other lines that you can add as sources for packages.
The selection of available packages changes constantly. New packages become available; newer versions of packages appear, etc. So it is necessary to make sure that the database that contains information about the packages is kept constantly up-to-date. This is done with the command
It's a good habit to always run this command before you upgrade or add new packages.
All of the packages that have already been installed can be upgraded to a newer version with the command
Sometimes it's really nice to know what is actually going to happen before you start to upgrade all installed packages. It's possible that it's not the right moment for you to start downloading several large packages. Maybe you need to wait until there is more bandwidth available. If you run
apt-get upgrade -sthen nothing will actually happen- the upgrade will only be simulated. If there is too much information on the screen, then you can try
apt-get upgrade -s|more. If it looks fine, then you run the above command again, taking away the -s
On the US keyboard, the so-called pipe symbol, | is found immediately to the left of the BACKSPACE key. Use the SHIFT key to type the pipe symbol.
You can get an overview of installed packages using the command
dpkg -l|more. Be aware that the first two letters indicate the status of the package; "ii" means that it is fully installed.
If you don't remember the name of a package, you can do a search of the database with the command
apt-cache search <packagename>. If there is too much text on the screen, then you can try
apt-cache search <packagename>|more
The two symbols < and > must not be used. They are only used in this example.
apt-cache showpkg <packagename>and
apt-cache policy <packagename>will give you detailed info about the packacge.
When you have found the package you want, install it with the command
apt-get install <packagename>If you want to see what will happen when you install it, you can first run a simulation with the command
apt-get install <packagename> -s
To find the specific package that you want to remove, use the commands that were mentioned earlier for finding the name of the package.
When you know the name of the package, then you can remove it simply with the command
apt-get remove <packagename>If you want to see what is going to happen when you remove the package, you can run a simulation first with the command
apt-get remove <packagename> -s
When you install a package with the command
apt-get install <packagename>, the newest version will be automatically installed. Sometimes you don't want to install the newest version, just a little older version.
apt-get install <packagename>=older_versions_number
If you think that the older version of the backup module of Webmin is better, then you should run
apt-cache showpkg webmin-slbackupto get an overview of available versions
tjener:~# apt-cache showpkg webmin-slbackup Package: webmin-slbackup Versions: 0.0.7-1(/var/lib/apt/lists/ftp.skolelinux.no_skolelinux_dists_woody_local_binary-i386_Packages) (/var/lib/apt/lists/ftp.skolelinux.no_skolelinux_dists_woody-test_local_binary-i386_Packages) (/var/lib/dpkg/status) 0.0.6-1(/var/lib/apt/lists/ftp.skolelinux.no_skolelinux_dists_woody-test_local_binary-i386_Packages) Reverse Depends: education-main-server,webmin-slbackup task-skolelinux-server,webmin-slbackup Dependencies: 0.0.7-1 - webmin (0 (null)) perl (0 (null)) libcgi-application-perl (0 (null)) libhtml-template-perl (0 (null)) libexpect-perl (2 1.15) slbackup (2 0.0.5-1) 0.0.6-1 - webmin (0 (null)) perl (0 (null)) libcgi-application-perl (0 (null)) libhtml-template-perl (0 (null)) libexpect-perl (2 1.15) slbackup (2 0.0.5-1) Provides: 0.0.7-1 - 0.0.6-1 - Reverse Provides:Here you can see that there are two versions available: 0.0.6-1 and 0.0.7-1.
If you want to install version 0.0.6-1, you can do that with the command
apt-get install webmin-slbackup=0.0.6-1
Sometimes you want to manually download a package from somewhere, such as from Opera's web page. Then you get a so-called .deb-package in your own home directory. You can install it by using the command
dpkg -i <>. If you first want to do a simulation, run the command
dpkg --no-act -i <packagename>
Sometimes it's nice to know exactly which files came from a specific package. You can get that overview with the command
dpkg -L <packagename>
If you want to know which package a specific package came from, the command
dpkg -S <filename>will help you find out.
Maybe you have accidentally erased an important systems file, and you do not have any backup of it. What then? If you use the command
dpkg -S <filename>you will find out which package the file originally comes from. That way you can unpack the package and get back the missing systems file.
First, you have to get the relevant .deb-package. When you have done that, you place it in the /tmpdirectory. You unpack the files in that directory with the command
dpkg -X <packagename> /tmpwhich will then create the necessary directories in the /tmpdirectory and then place the files there.
Never unpack the package directly in the /-directory!
There are some packages which I often install, as well as some packages that I wish I didn't have to download from the Internet every time. Even if the commandapt-get makes it easier to install packages from the Internet, unfortunately apt-get won't increase the speed of my Internet connection. However, I can use apt-get to make my own mirror of the packages that I have downloaded. That way, in the future when I want to install these packages, the command apt-get will fetch the packages that I have already downloaded. This goes more quickly.
cp /var/cache/apt/archives/*.deb /var/www/dpkg
dpkg-scanpackages dpkg /dev/null | gzip -9c > dpkg/Packages.gz
After that, a new line in the file /etc/apt/sources.list must be added to
deb file:///var/www dpkg/Then you must, as usual, run the command apt-get update in order to update your package database.