How to make a favicon in Ubuntu

To make a favicon in Debian linux or Ubuntu (in my case):

  • Install the package xpm2wico with Synaptic or apt-get.
    An Xpm to Windows .ico converter
  • Using Gimp, Capture and shrink or create/edit a 16×16 graphic.
  • Save your image in X PixMap Image (xpm) format.
  • Convert from xpm to favicon name and format: "xpm2wico favicon.xpm favicon.ico".
  • Copy favicon.ico to convenient place, then add the following to a webpage:
    <link rel="shortcut icon" href="favicon.ico" type="image/x-icon" />