You can use a BitDefender
Rescue CD, which is a a
live CD using Knoppix Linux, to boot
a Windows system without using Windows in order to scan the system for viruses
and other malware. Knoppix Linux is based on
Debian. You can determine which version
of Debian is being used by looking in /etc/debian_version
.
The BitDefender Rescue CD comes with some software aside from the BitDefender
anvirus software. For instance, Mozilla Firefox and Partition Image are also
on the live CD. But you may want to add other software as well. Knoppix
Linux uses binary packages in
.deb format, which can be downloaded and installed with the
apt-get
utility that will be accessible once you boot a system
from the live CD. For an explanation of .deb files, see
Deb files or Debian Packages.
You can view a list of available Debian packages at
view package
lists.
The apt-get
utility is part of the
Advanced
Packaging Tool (APT) package management software.
Let's suppose the package you want to install is tcpstat, which reports certain network interface statistics much like vmstat does for system statistics. tcpstat gets its information by either monitoring a specific interface, or by reading previously saved tcpdump data from a file.
Before you use apt-get
to install the package you wish to use,
you will need to create some directories that apt-get
expects to be present, but which aren't present when you boot from the rescue
So right-click on the desktop and select Terminal (as root) to open a
terminal window then enter the commands shown below.
root@Knoppix:~# mkdir /var/lib/apt/lists root@Knoppix:~# mkdir /var/lib/apt/lists/partial
I can then try installing the tcpstat package with apt-get.
root@Knoppix:~# apt-get install tcpstat
E: Could not open lock file /var/lib/dpkg/lock - open (2 No such file or directory)
E: Unable to lock the administration directory (/var/lib/dpkg/), are you root?
root@Knoppix:~#
The problem is that the /var/lib/dpkgk
directory doesn't exist,
so I need to create it as well. I'll also create the other directories and
files that dpkg
expects (see
Using dpkg with BitDefender Rescue CD).
root@Knoppix:~# mkdir /var/lib/dpkg root@Knoppix:~# mkdir /var/lib/dpkg/info root@Knoppix:~# mkdir /var/lib/dpkg/updates root@Knoppix:~# touch /var/lib/dpkg/status root@Knoppix:~# touch /var/lib/dpkg/available
I can then try installing tcpstat again with apt-get.
If you see messages, such as the following, you can edit
/etc/apt/sources.list
and comment out the entries that lead
to the errors.
W: Couldn't stat source package list http://people.debian.org ./ Packages (/var/lib/apt/lists/people.debian.org_%7easac_experimental_._Packages) - stat (2 No such file or directory)
In the example above, I saw "Couldn't stat source package list
http://people.debian.org ." In /etc/apt/sources.list
, I saw
the following:
# Thunderbird
deb http://people.debian.org/~asac/experimental ./
deb-src http://people.debian.org/~asac/experimental ./
So I commented out the to lines referring to http://people.debian.org by placing a "#" at the beginning of each line.
But I was also seeing lines, such as the following, in the output when I ran apt-get.
W: Couldn't stat source package list
http://security.debian.org stable/updates/contrib Packages
(/var/lib/apt/lists/security.debian.org_dists_stable_updates_contrib_binary-i386_Packages)
- stat (2 No such file or directory)
So I ran apt-get update
. apt-get update
does not
upgrade packages, it just updates information from repositories listed in
/etc/apt/sources.list
.
When I ran apt-get update
, I saw messages such as the
following:
Reading package lists... Done
W: GPG error: http://security.debian.org stable/updates Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 9AA38DCD55BE302B
W: GPG error: http://security.debian.org testing/updates Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 9AA38DCD55BE302B
W: GPG error: http://ftp.ro.debian.org stable Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 9AA38DCD55BE302B NO_PUBKEY 4D270D06F42584E6
To rectify that problem, I used the commands below. The gpg --keyserver wwwkeys.eu.pgp.net --recv-keys 9AA38DCD55BE302B
command uses the
gpg utility to query the PGP keyserver wwwkeys.eu.pgp.net for the
PGP
key corresponding to key id 9AA38DCD55BE302B
and to import that
key. The apt-key
command manages apt's list of trusted keys adding
the key just imported to the
GNU Privacy Guard
(GPG) public keyring for the root account to apt's list of trusted
keys.
root@Knoppix:# gpg --keyserver wwwkeys.eu.pgp.net --recv-keys 9AA38DCD55BE302B gpg: requesting key 55BE302B from hkp server wwwkeys.eu.pgp.net gpg: /root/.gnupg/trustdb.gpg: trustdb created gpg: key 55BE302B: public key "Debian Archive Automatic Signing Key (5.0/lenny) <ftpmaster@debian.org>" imported gpg: no ultimately trusted keys found gpg: Total number processed: 1 gpg: imported: 1 (RSA: 1) root@Knoppix:/home/knoppix# gpg --armor --export 9AA38DCD55BE302B | apt-key add - OK
I was then able to install the tcpstat
package.
root@Knoppix:~# apt-get install tcpstat Building dependency tree... Done The following extra packages will be installed: gcc-4.4-base libc6 libgcc1 libpcap0.8 Suggested packages: locales glibc-doc Recommended packages: tcpdump The following NEW packages will be installed: gcc-4.4-base libc6 libgcc1 libpcap0.8 tcpstat 0 upgraded, 5 newly installed, 0 to remove and 0 not upgraded. Need to get 4691kB of archives. After unpacking 11.7MB of additional disk space will be used. Do you want to continue [Y/n]? Y WARNING: The following packages cannot be authenticated! gcc-4.4-base libgcc1 libc6 libpcap0.8 tcpstat Install these packages without verification [y/N]? y Get:1 http://ftp.ro.debian.org testing/main gcc-4.4-base 4.4.1-1 [110kB] Get:2 http://ftp.ro.debian.org testing/main libgcc1 1:4.4.1-1 [72.9kB] Get:3 http://ftp.ro.debian.org testing/main libc6 2.9-23 [4367kB] Get:4 http://ftp.ro.debian.org testing/main libpcap0.8 1.0.0-2 [117kB] Get:5 http://ftp.ro.debian.org stable/main tcpstat 1.5-2 [24.3kB] Fetched 4691kB in 9s (495kB/s) E: Cannot get debconf version. Is debconf installed? debconf: apt-extracttemplates failed: Bad file descriptorSelecting previously deselected package gcc-4.4-base. (Reading database ... 0 files and directories currently installed.) Unpacking gcc-4.4-base (from .../gcc-4.4-base_4.4.1-1_i386.deb) ... Selecting previously deselected package libgcc1. Unpacking libgcc1 (from .../libgcc1_1%3a4.4.1-1_i386.deb) ... Selecting previously deselected package libc6. Unpacking libc6 (from .../archives/libc6_2.9-23_i386.deb) ... Matching libraries: /UNIONFS/lib/libc.so.6 Another copy of the C library was found via /etc/ld.so.conf. It is not safe to upgrade the C library in this situation; please remove the directory from /etc/ld.so.conf and try again. dpkg: error processing /var/cache/apt/archives/libc6_2.9-23_i386.deb (--unpack): subprocess pre-installation script returned error exit status 1 Selecting previously deselected package libpcap0.8. Unpacking libpcap0.8 (from .../libpcap0.8_1.0.0-2_i386.deb) ... Selecting previously deselected package tcpstat. Unpacking tcpstat (from .../tcpstat_1.5-2_i386.deb) ... Errors were encountered while processing: /var/cache/apt/archives/libc6_2.9-23_i386.deb localepurge: Disk space freed in /usr/share/man: -16K E: Sub-process /usr/bin/dpkg returned an error code (1) root@Knoppix:~#root@Knoppix:~#
Even though I saw some error messages, such as "dpkg: error processing
/var/cache/apt/archives/libc6_2.9-23_i386.deb (--unpack)", the package was
installed and I was able to use tcpstat
.
root@Knoppix:~# tcpstat
Listening on eth0
Time:1249840979 n=5 avg=46.00 stddev=0.00 bps=368.00
Time:1249840984 n=5 avg=46.00 stddev=0.00 bps=368.00
Time:1249840989 n=6 avg=46.00 stddev=0.00 bps=441.60
Time:1249840994 n=2 avg=46.00 stddev=0.00 bps=147.20
You can see information on a package you've installed with the
aptitude
command. Aptitude is an advanced command line front-end
for APT.
root@Knoppix:~# aptitude show tcpstat
Package: tcpstat
New: yes
State: unpacked
Automatically installed: no
Version: 1.5-2
Priority: extra
Section: net
Maintainer: Luk Claes <luk@debian.org>
Uncompressed Size: 98.3k
Depends: libc6 (>= 2.7-1), libpcap0.8 (>= 0.9.3-1)
Recommends: tcpdump
Description: network interface statistics reporting tool
tcpstat reports certain network interface statistics much like vmstat does for system
statistics. tcpstat gets its information by either monitoring a specific interface,
or by reading previously saved tcpdump data from a file.
Tags: admin::monitoring, interface::commandline, protocol::ip, qa::orphaned,
role::program, scope::utility, use::monitor, use::viewing
If a package isn't installed, you will see "State: not installed" in the
output from aptitude
.
References:
Created: Tuesday August 11, 2009