Gentoo Blog

The ultimate Gentoo Blog
  • Home
  • About

Debian/Ubuntu Package management Using dpkg

Simon | June 3, 2010

Dpkg is the Debian package manager dpkg is a tool to install, build, remove and manage Debian packages.

Now we will see all the available commands for dpkg with some examples

1)Install a package

Syntax

dpkg -i <.deb file name>

Example

dpkg -i courier-pop-ssl_0.61.2-1ubuntu2_amd64.deb

2)Install all packages recursively from a directory

Syntax

dpkg -R

Example

dpkg -R /usr/local/src

3)Unpack the package, but don’t configure it.

Syntax

dpkg --unpack package_file

If you use -R option is specified, package_file must refer to a directory instead.

Example

dpkg --unpack courier-pop-ssl_0.61.2-1ubuntu2_amd64.deb

4)Reconfigure an unpacked package

Syntax

dpkg --configure package

If -a is given instead of package, all unpacked but unconfigured packages are configured.

Example

dpkg --configure courier-pop-ssl_0.61.2-1ubuntu2_amd64.deb

5)Remove an installed package except configuration files

Syntax

dpkg -r

Example

dpkg -r courier-pop-ssl_0.61.2-1ubuntu2_amd64.deb

6)Remove an installed package including configuration files

Syntax

dpkg -P

If you use -a is given instead of a package name, then all packages unpacked, but marked to be removed or purged in file /var/lib/dpkg/status, are removed or purged, respectively.

Example

dpkg -P courier-pop-ssl

7)Replace available packages info

Syntax

dpkg --update-avail

With this option old information is replaced with the information in the Packages-file.

8)Merge with info from file

Syntax

dpkg --merge-avail

With this option old information is combined with information from Packages file.

The Packages file distributed with Debian is simply named Packages.dpkg keeps its record of available packages in /var/lib/dpkg/available.

9)Update dpkg and dselect’s idea of which packages are available with information from the package pack-age_file.

Syntax

dpkg -A package_file

10)Forget about uninstalled unavailable packages.

Syntax

dpkg --forget-old-unavail

11)Erase the existing information about what packages are available.

Syntax

dpkg --clear-avail

12)Searches for packages that have been installed only partially on your system.

Syntax

dpkg -C

13)Compare Package versions version numbers

Syntax

dpkg --compare-versions ver1 op ver2

14)Display a brief help message.

Syntax

dpkg --help

15)Display dpkg licence.

Syntax

dpkg --licence (or) dpkg --license

16)Display dpkg version information.

Syntax

dpkg --version

17)Build a deb package.

Syntax

dpkg -b directory [filename]

18)List contents of a deb package.

Syntax

dpkg -c filename

19)Show information about a package.

Syntax

dpkg -I filename [control-file]

20)List packages matching given pattern.

Syntax

dpkg -l package-name-pattern

Example

dpkg -l postfix

21)List all installed packages, along with package version and short description

Syntax

dpkg -l

22)Report status of specified package.

Syntax

dpkg -s package-name

Example

dpkg -s openssh-server

23)List files installed to your system from package.

Syntax

dpkg -L package-Name

Example

dpkg -L postfix

24)Search for a filename from installed packages.

Syntax

dpkg -S filename-search-pattern

Example

dpkg -S /usr/bin/cut

25)Display details about package

Syntax

dpkg -p package-name

Example

dpkg -p openssh-server

If you want more information about dpkg check “man dpkg”

Share on Facebook
Comments
No Comments »
Categories
Ubuntu/Debian
Comments rss Comments rss
Trackback Trackback

X11 Forwarding with SSH

Simon | April 22, 2010

This is fairly simple stuff but it took me 15 minutes to solve because i was missing a package :( So i thought i would write a quick article here we go X11 forwarding with ssh. This should work on any Linux distribution unless ssh has been built without the support for X forwarding. Which as far as i know is uncommon.

1. Install xauth with your package manager for ubuntu/debian do

aptitude install xauth

2. Edit the sshd_config on the server you want to start the X program from

vi /etc/ssh/sshd_config

3. Add the following to your sshd_config file on the server

X11Forwarding yes

4. Restart the ssh server

/etc/init.d/ssh restart

5. Edit the ssh_config on the client (this could also be in your home directory under .ssh/config)

vi /etc/ssh/ssh_config

6. Add the following to your ssh_config file on the client

ForwardX11 yes

7. Connect to the server with ssh

ssh user@host

8. You can also use ssh -X user@host Which switches on X Forwarding for the single connection. We don’t need this option because we set it permanently in the ssh_config on the client.

Share on Facebook
Comments
1 Comment »
Categories
Gentoo, Ubuntu/Debian
Comments rss Comments rss
Trackback Trackback

Ubuntu Countdown for Lucid Lynx the next release

Simon | April 8, 2010

Share on Facebook
Comments
No Comments »
Categories
Ubuntu/Debian
Comments rss Comments rss
Trackback Trackback

Howto install htscanner

Simon | March 29, 2010

I have started using Suphp on some of our confixx servers. Suphp hast one big advantage over mod php it executes PHP scripts with the permissions of their owners. Which is extremely useful on multi domain servers. Otherwise you always have the problem that files uploaded via FTP have different permissions than files upload via http. For example plugins uploaded via the wordpress backend or photos via php gallery. One of the big downsides of Suphp for us is that you cannot use .htaccess files for mod rewrite and so on. This is were htscanner comes along this is the description. Allow one to use htaccess-like file to configure PHP. sounds good :) You need to perform the following steps to install htscanner on debian or ubuntu:

1. Download htscanner:

wget http://pecl.php.net/get/htscanner-0.9.0.tgz

2. Unpack the archive:

tar -xzvf htscanner-0.9.0.tgz

3. Install dependencies:

aptitude install php5-dev php-config

4. Change into the htscanner directory:

cd htscanner-0.9.0

5. run phpize

phpize

6. Configure htscanner

./configure --enable-htscanner

7. Then make and make install

make && make install

8. This should have installed htscanner at the end of the install you should see the install path.

9. Create a file to get the htscanner module loaded:

vi /etc/php5/cgi/conf.d/htscanner.ini

10. With the following content:

extension=htscanner.so

11. restart the Apache web server and you can use .htaccess files again.

Share on Facebook
Comments
2 Comments »
Categories
Ubuntu/Debian
Comments rss Comments rss
Trackback Trackback

Ubuntu 10.04 Lucid Window Buttons On The Left

Simon | March 9, 2010

To get the close and minimize buttons back on the right hand side do the following:

1. Press Alt + F2 and enter:

gconf-editor

2. navigate to /apps/metacity/general/button_layout

3. set the key value to:

:maximize,minimize,close

Thats it log out or restart metacity and your buttons should appear back on the right hand side.

Share on Facebook
Comments
6 Comments »
Categories
Ubuntu/Debian
Comments rss Comments rss
Trackback Trackback

chmod change files or directories recursively to the same value

Simon | February 11, 2010

Recursively change all files in your current working directory including files in subdirectories to 644:

find . -type f -print0 | xargs -0 chmod 644

Recursively change all directories in your current working directory including subdirectories to 755:

find . -type d -print0 | xargs -0 chmod 755

Share on Facebook
Comments
3 Comments »
Categories
Gentoo, Stuff, Ubuntu/Debian
Comments rss Comments rss
Trackback Trackback

Debian Lenny Possible missing firmware /lib/firmware/bnx2-09-4.0.5.fw for module bnx2

Simon | February 1, 2010

If you see this message after running aptitude upgrade with a Kernel update:

W: Possible missing firmware /lib/firmware/bnx2-09-4.0.5.fw for module bnx2

Do not reboot your server or you will be left without any network. Please edit your apt sources.list file and add the non-free repo. For example it could look like this:

deb http://ftp.hosteurope.de/pub/linux/debian/ lenny main non-free
deb-src http://ftp.hosteurope.de/pub/linux/debian/ lenny main non-free

deb http://security.debian.org/ lenny/updates main non-free
deb-src http://security.debian.org/ lenny/updates main non-free

Please edit the line for your standard apt server and for security.debian.org to receive possible security updates. Then run

aptitude update

Now we can install the missing firmware for our broadcom network card:

aptitude install firmware-bnx2

Check if the firmware has been installed correctly:

web99:~# ls -lha /lib/firmware/
total 212K
drwxr-xr-x 2 root root 112 2010-02-01 12:25 .
drwxr-xr-x 11 root root 4.2K 2010-01-20 15:36 ..
-rw-r--r-- 1 root root 104K 2009-08-04 07:00 bnx2-06-4.0.5.fw
-rw-r--r-- 1 root root 101K 2009-08-04 07:00 bnx2-09-4.0.5.fw

We need this version bnx2-09-4.0.5.fw which you can see in the reported error message above.

Thats it you can carry on and reboot your server.

Share on Facebook
Comments
1 Comment »
Categories
Ubuntu/Debian
Comments rss Comments rss
Trackback Trackback

Ubuntu Karmic mount Windows partition as user

Simon | January 9, 2010

With Ubuntu versions prior to Karmic you could mount windows partitions as a normal user. After typing in the root password you could allow the user to mount a windows partition after ticking the box remember this the user could do this himself in the future. Easy going that’s how it should be with Ubuntu for some reason that does not work any more. And this is the solution:

1. Create a file named:

vi /var/lib/polkit-1/localauthority/50-local.d/nautilus.pkla

2. Copy the following content into the file:

[Allow users to mount with nautilus]
Identity=unix-group:simon
Action=org.freedesktop.devicekit.disks.filesystem-mount-system-internal
ResultAny=no
ResultInactive=no
ResultActive=yes

That’s it easy once you know how it’s done.

Share on Facebook
Comments
No Comments »
Categories
Ubuntu/Debian
Comments rss Comments rss
Trackback Trackback

Ubuntu Karmic change CPU Frequency as user

Simon | January 9, 2010

With Ubuntu versions prior to Karmic you could change the CPU Frequency as a normal user. After typing in the root password you could allow the user to change the CPU Frequency after ticking the box remember this the user could do this himself in the future. Easy going that’s how it should be with Ubuntu for some reason that does not work any more. And this is the solution:

1. Create a file named:

vi /var/lib/polkit-1/localauthority/50-local.d/gnome-cpufreq.pkla

2. Copy the following content into the file:

[Allow users to set the CPU frequency]
Identity=unix-group:simon
Action=org.gnome.cpufreqselector
ResultAny=no
ResultInactive=no
ResultActive=yes

That’s it easy once you know how it’s done.

Share on Facebook
Comments
1 Comment »
Categories
Ubuntu/Debian
Comments rss Comments rss
Trackback Trackback

HP ProLiant Support Pack CD for Debian lenny and Ubuntu 9.04 Jaunty

Simon | November 26, 2009

Nice collection of support tools monitoring apps for snmp and a CLI for the HP raid controller. Definitely worth looking at if you are running debian or ubuntu boxes on HP proliant servers:

HP ProLiant Support Pack CD

Share on Facebook
Comments
No Comments »
Categories
Ubuntu/Debian
Comments rss Comments rss
Trackback Trackback

« Previous Entries Next Entries »

 

May 2012
M T W T F S S
« Apr    
 123456
78910111213
14151617181920
21222324252627
28293031  

Categories

  • confixx/Plesk
  • fun
  • Gentoo
  • iptables
  • mysql
  • news
  • Raid Controllers
  • Stuff
  • Ubuntu/Debian
  • Xen/Vmware

Links

  • Gentoo
  • http.net
  • iphone software linux
  • michael-fuchs.net
  • Ubuntu
  • webupd8.org

Search Blog

rss Comments rss valid xhtml 1.1 design by jide powered by Wordpress get firefox