You are on page 1of 3

How install package using dpkg command

Using the apt-get application is the quickest way to find and install debian packages. The
installation part is done by an application named dpkg. Dpkg doesn’t have to be used by
apt-get, you can use it manually as well.

From the man dpkg command:

dpkg - a medium-level package manager for Debian

Whatever that means.

In keeping with GNU/Linux system security, only the superuser can use the dpkg
application. Dpkg is a typical GNU/Linux application that is controlled by command-line
switches. Possibly the most common use of dpkg is to install a local .deb file.

To install a .deb file, become root and use the command:

dpkg -i filename.deb

Dpkg can also be used to:

• dpkg –unpack: unpacks the file but does not install it


• dpkg –configure: presents whatever configuration options are available for the
package
• dpkg –remove: removes a package

Some of the package manipulation commands are actually carried out by an application
called dpkg-deb. In those cases, dpkg just acts as a front end to dpkg-deb and passes the
commands to it.

Dpkg-deb can also be used to manipulate .deb files. Some of the more useful commands
of dpkg-deb are:

dpkg-deb –show filename.deb

This will display the information for filename.deb. Normally, this is boring information
like the application version (which is normally evident from the filename), but in some
cases more interesting and useful information is displayed.

Consult the dpkg man page for information on the more arcane uses for dpkg.
LAB ….

Download the deb package from….

http://packages.debian.org/stable/

Use wget to download in command mode…

Ex:

wget http://debian.lcs.mit.edu/debian/pool/main/o/openssh/ssh_4.3p2-9_all.deb

NOTE : With dpkg installations you may find the dependency problems

Change Ubuntu Server from DHCP to a Static IP


Address

If the Ubuntu Server installer has set your server to use DHCP, you will want to change it
to a static IP address so that people can actually use it.

Changing this setting without a GUI will require some text editing, but that's classic linux,
right?

Let's open up the /etc/network/interfaces file. I'm going to use vi, but you can choose a
different editor

sudo vi /etc/network/interfaces

For the primary interface, which is usually eth0, you will see these lines:

auto eth0
iface eth0 inet dhcp

As you can see, it's using DHCP right now. We are going to change dhcp to static, and
then there are a number of options that should be added below it. Obviously you'd
customize this to your network.
auto eth0
iface eth0 inet static
address 192.168.1.100
netmask 255.255.255.0
network 192.168.1.0
broadcast 192.168.1.255
gateway 192.168.1.1

Now we'll need to add in the DNS settings by editing the resolv.conf file:

sudo vi /etc/resolv.conf

On the line ‘name server xxx.xxx.xxx.xxx’ replace the x with the IP of your name
server. (You can do ifconfig /all to find out what they are)

Ex

nameserver 203.115.0.18

nameserver 203.115.0.19

Now we'll just need to restart the networking components:

sudo /etc/init.d/networking restart

Testing

Ping www.google.com. If you get a response, name resolution is working(unless of


course if google is in your hosts file).

You might also like