Search This Blog

Saturday, June 20, 2009

No theme index file.dpkg error

While trying to upgrade to texmacs 1:1.0.7.2-1in Sid (unstable) on a machine running Debian Lenny (Stable), I was getting the following error

$sudo apt-get install texmacs
// bunch of apt-get messages

Setting up texmacs-common (1:1.0.7.2-1) ...
gtk-update-icon-cache: No theme index file.dpkg: error processing texmacs-common (--configure):
subprocess post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of texmacs:
texmacs depends on texmacs-common (= 1:1.0.7.2-1); however:
Package texmacs-common is not configured yet.
dpkg: error processing texmacs (--configure):
dependency problems - leaving unconfigured
Errors were encountered while processing:
texmacs-common
texmacs
E: Sub-process /usr/bin/dpkg returned an error code (1)


Install the gnome-icon-theme package to solve this bug.
$sudo apt-get install -t stable gnome-icon-theme
//bunch of apt-get messages

Selecting previously deselected package gnome-icon-theme.
(Reading database ... 225097 files and directories currently installed.)
Unpacking gnome-icon-theme (from .../gnome-icon-theme_2.22.0-1_all.deb) ...
Setting up texmacs-common (1:1.0.7.2-1) ...
gtk-update-icon-cache: Cache file created successfully.
Setting up texmacs (1:1.0.7.2-1) ...
Setting up gnome-icon-theme (2.22.0-1) ...

Thursday, June 04, 2009

running external commands

  1. To run external commands while editing a file in vim, use the '!' in the normal mode. For example
    :!ls -al
    will list the files
    :!date
    will display the current date.

  2. To read the output of external commands into the current file, do
    :r !date
    All the commands are run in normal mode. Press ESC key to enter the normal mode in vim.

    Further reading:- :help :!

  3. To run external commands in octave, use the system command. Sample octave session looks as
    $octave -q
    octave:1> system("date")
    Thu Jun 4 23:49:23 EDT 2009
    ans = 0
    octave:2> [ret_code output] = system("date");
    octave:3> ret_code
    ret_code = 0
    octave:4> output
    output = Thu Jun 4 23:49:40 EDT 2009

    octave:5> exit
    Further reading :- "doc system" shows the relevant help pages in octave.

  4. To run external commands in Fortran 90 programs, use the system command. Sample code looks as below
    $cat system.f90
    program callsystem
    implicit none
    !to examine the behaviour of the system command
    character (len=100)::cmd
    cmd="echo Wake up Neo"
    !if u are using ifc compiler use -Vaxlib during compilation
    call system(cmd//achar(0))
    call system(cmd)
    call system("date")
    ! The next line also works.
    ! call system("ls")
    end program callsystem

    $gfortran system.f90

    $./a.out
    Wake up Neo
    Wake up Neo
    Thu Jun 4 23:55:07 EDT 2009
  5. To run the external commands in C, use the system command available in stdlib.h. Sample code will be
    $cat system.c
    #include stdio.h
    #include stdlib.h

    int main() {
    /* Fixme :- <, > in the header files are not showing up on blogspot */
    int ret_code;
    ret_code = system("date");

    printf("%d\n", ret_code);
    return 0;
    }

    $gcc -Wall system.c

    $./a.out
    Fri Jun 5 00:04:14 EDT 2009
    0

    Further reading :- man system

    All the above are tested in Debian Lenny using vim 7.1, octave 3.0.1, gfortran 4.3.1, gcc 4.3.1

Followers