Find the answer to your Linux question:
Page 1 of 3 1 2 3 LastLast
Results 1 to 10 of 24
Hi Having just tried Ubuntu and liked it I thought I'd jump in and see if I could get Debian and Gnome running.. I installed the Debian cd 1 (base) ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Oct 2005
    Posts
    13

    How do I start Gnome!


    Hi

    Having just tried Ubuntu and liked it I thought I'd jump in and see if I could get Debian and Gnome running.. I installed the Debian cd 1 (base) but it failed to read the 2nd cd so I selected the ftp option and installed more packages (apt-get install Gnome), then it did read the 2nd cd and seemed to install eveything.

    So now I have a big black screen full of white text. I am logged in and it's waiting for me to tell it some thing!

    I want to tell it to start Gnome and give me the GUI. If someone could tell me how I'd be most thankful.

    Thank you Oswald

    Ps. It's an eMac ppc

  2. #2
    Just Joined!
    Join Date
    Jan 2005
    Location
    Maryland
    Posts
    67
    startx

  3. #3
    Linux Guru
    Join Date
    May 2004
    Location
    forums.gentoo.org
    Posts
    1,817
    If 'startx' doesn't work, try 'gdm'.
    /IMHO
    //got nothin'
    ///this use to look better

  4. #4
    Just Joined!
    Join Date
    Oct 2005
    Posts
    13

    Still no luck

    Still no luck

    I logged in as root and tried startx and gdm.

    On both it returns "command not found"

    Any ideas wecome

  5. #5
    Linux User nalg0rath's Avatar
    Join Date
    Sep 2004
    Location
    Stockholm
    Posts
    303
    Log in as a normal user and then run
    Code:
    # gdm
    To add a user use the useradd command, read the manual if you don't know hot to do this.
    Code:
    # man useradd

  6. #6
    Linux Engineer d38dm8nw81k1ng's Avatar
    Join Date
    Mar 2005
    Location
    Newcastle
    Posts
    793
    Code:
    apt-get install gnome
    to make sure gnome is actually installed. then do:

    Code:
    apt-get install gdm
    this will install gdm, which you can then use to login to gnome. happy hunting
    Here's why Linux is easier than Windows:
    Package Managers! Apt-Get and Portage (among others) allow users to install programs MUCH easier than Windows can.
    Hardware Drivers. In SuSE, ALL the hardware is detected and installed automatically! How is this harder than Windows' constant disc changing and rebooting?

  7. #7
    Just Joined!
    Join Date
    Oct 2005
    Posts
    13

    Its Broke!

    After many hour and different types of reinstalls I'm at a loss. The only Linux I have that runs with a GUI is Ubuntu.

    Yellowdog 4 and Debian serge both report xserver faults , I take it thats why # startx failed.

    "process set to priority -1 instead of requested priority 0" and "fatal IO error104 (connection reset by peer) on xserver

    Thanks to all that tried to help I'll have another go tomorrow

    oswald

  8. #8
    Linux Guru
    Join Date
    May 2004
    Location
    forums.gentoo.org
    Posts
    1,817

    Re: Its Broke!

    Quote Originally Posted by oswaldkelso
    The only Linux I have that runs with a GUI is Ubuntu.
    Sounds like your problem is either with the driver for the video adapter or with something in your X configuration file (I think that's /etc/X11/xorg.conf). If you can run Ubuntu from a LiveCD, start it up and then print, copy or write down xorg.conf so that you can then compare the Ubuntu xorg.conf against the Debian xorg.conf and make changes as needed.
    /IMHO
    //got nothin'
    ///this use to look better

  9. #9
    Just Joined!
    Join Date
    Oct 2005
    Posts
    13

    Re:ubuntu config files

    Quote Originally Posted by drakebasher
    Quote Originally Posted by oswaldkelso
    The only Linux I have that runs with a GUI is Ubuntu.
    Sounds like your problem is either with the driver for the video adapter or with something in your X configuration file (I think that's /etc/X11/xorg.conf). If you can run Ubuntu from a LiveCD, start it up and then print, copy or write down xorg.conf so that you can then compare the Ubuntu xorg.conf against the Debian xorg.conf and make changes as needed.
    # /etc/X11/xorg.conf (xorg X Window System server configuration file)
    #
    # This file was generated by dexconf, the Debian X Configuration tool, using
    # values from the debconf database.
    #
    # Edit this file with caution, and see the /etc/X11/xorg.conf manual page.
    # (Type "man /etc/X11/xorg.conf" at the shell prompt.)
    #
    # This file is automatically updated on xserver-xorg package upgrades *only*
    # if it has not been modified since the last upgrade of the xserver-xorg
    # package.
    #
    # If you have edited this file but would like it to be automatically updated
    # again, run the following command:
    # sudo dpkg-reconfigure -phigh xserver-xorg

    Section "Files"
    FontPath "/usr/share/X11/fonts/misc"
    FontPath "/usr/share/X11/fonts/cyrillic"
    FontPath "/usr/share/X11/fonts/100dpi/:unscaled"
    FontPath "/usr/share/X11/fonts/75dpi/:unscaled"
    FontPath "/usr/share/X11/fonts/Type1"
    FontPath "/usr/share/X11/fonts/CID"
    FontPath "/usr/share/X11/fonts/100dpi"
    FontPath "/usr/share/X11/fonts/75dpi"
    # paths to defoma fonts
    FontPath "/var/lib/defoma/x-ttcidfont-conf.d/dirs/TrueType"
    FontPath "/var/lib/defoma/x-ttcidfont-conf.d/dirs/CID"
    EndSection

    Section "Module"
    Load "GLcore"
    Load "i2c"
    Load "bitmap"
    Load "ddc"
    Load "dri"
    Load "extmod"
    Load "freetype"
    Load "glx"
    Load "int10"
    Load "type1"
    Load "vbe"
    EndSection

    Section "InputDevice"
    Identifier "Generic Keyboard"
    Driver "kbd"
    Option "CoreKeyboard"
    Option "XkbRules" "xorg"
    Option "XkbModel" "pc105"
    Option "XkbLayout" "gb"
    Option "XkbOptions" "lv3:lwin_switch"
    EndSection

    Section "InputDevice"
    Identifier "Configured Mouse"
    Driver "mouse"
    Option "CorePointer"
    Option "Device" "/dev/input/mice"
    Option "Protocol" "ImPS/2"
    Option "Emulate3Buttons" "true"
    Option "ZAxisMapping" "4 5"
    EndSection

    Section "Device"
    Identifier "ATI Technologies, Inc. Radeon 7500 (RV200 QW)"
    Driver "ati"
    BusID "PCI:0:16:0"
    Option "UseFBDev" "true"
    EndSection

    Section "Monitor"
    Identifier "iMac"
    Option "DPMS"
    HorizSync 71-73
    VertRefresh 70-140
    EndSection

    Section "Screen"
    Identifier "Default Screen"
    Device "ATI Technologies, Inc. Radeon 7500 (RV200 QW)"
    Monitor "iMac"
    DefaultDepth 24
    SubSection "Display"
    Depth 1
    Modes "1024x768"
    EndSubSection
    SubSection "Display"
    Depth 4
    Modes "1024x768"
    EndSubSection
    SubSection "Display"
    Depth 8
    Modes "1024x768"
    EndSubSection
    SubSection "Display"
    Depth 15
    Modes "1024x768"
    EndSubSection
    SubSection "Display"
    Depth 16
    Modes "1024x768"
    EndSubSection
    SubSection "Display"
    Depth 24
    Modes "1024x768"
    EndSubSection
    EndSection

    Section "ServerLayout"
    Identifier "Default Layout"
    Screen "Default Screen"
    InputDevice "Generic Keyboard"
    InputDevice "Configured Mouse"
    EndSection

    Section "DRI"
    Mode 0666
    EndSection

    Is that the right one? I have these also that looked like they may be important.

    Template: xorg-common/experimental_packages
    Type: note
    Description: experimental version of XFree86 packages
    You are using an experimental version of XFree86 packages for Debian. Please
    do not file bugs with the Debian Bug Tracking System against this version of
    the packages, since they have not been released to the Debian distribution
    yet.
    .
    If you experience problems with these packages or would like to submit
    patches, please send mail to the Debian X mailing list. You can read more
    about this mailing list on the World Wide Web:
    http://lists.debian.org/debian-x/
    .
    If you do not want to be running experimental X packages, you need to do two
    things:
    1) Ensure that you do not have experimental package repositiories in
    your /etc/apt/sources.list file;
    2) Instruct apt to downgrade XFree86 to an appropriate released version;
    you can do this by appending a package suite name to the package name
    with "apt-get" -- for example:
    apt-get install xfree86-common/unstable
    or
    apt-get install xfree86-common/stable
    You may need to specify downgrades for several packages.



    I read a similar thing when Debian tried to load the screen?



    /.
    /usr
    /usr/X11R6
    /usr/X11R6/man
    /usr/X11R6/man/man7
    /usr/X11R6/man/man7/XConsortium.7x.gz
    /usr/X11R6/man/man7/XStandards.7x.gz
    /usr/X11R6/man/man7/Xsecurity.7x.gz
    /usr/X11R6/man/man7/X.7x.gz
    /usr/X11R6/man/man7/X.Org.7x.gz
    /usr/X11R6/man/man7/XProjectTeam.7x.gz
    /usr/X11R6/lib
    /usr/X11R6/lib/X11
    /usr/share
    /usr/share/doc
    /usr/share/doc/xorg-common
    /usr/share/doc/xorg-common/CHANGELOG.R5.gz
    /usr/share/doc/xorg-common/changelog.Debian.old.gz
    /usr/share/doc/xorg-common/README.gz
    /usr/share/doc/xorg-common/README.fonts.gz
    /usr/share/doc/xorg-common/RELNOTES.gz
    /usr/share/doc/xorg-common/Versions.gz
    /usr/share/doc/xorg-common/README.Debian
    /usr/share/doc/xorg-common/copyright
    /usr/share/doc/xorg-common/CHANGELOG.gz
    /usr/share/doc/xorg-common/CHANGELOG.ND.gz
    /usr/share/doc/xorg-common/changelog.Debian.gz
    /etc
    /etc/X11
    /etc/X11/Xresources
    /etc/init.d
    /etc/init.d/xorg-common
    /usr/X11R6/lib/X11/rgb.txt



    Above is the common list?


    #!/bin/sh
    # Debian xfree86-common package configuration script
    # Copyright 2002, 2003 Branden Robinson.
    # Licensed under the GNU General Public License, version 2. See the file
    # /usr/share/common-licenses/GPL or <http://www.gnu.org/copyleft/gpl.txt>.


    set -e

    # source debconf library
    . /usr/share/debconf/confmodule

    THIS_PACKAGE=xorg-common
    THIS_SCRIPT=config

    SOURCE_VERSION=6.8.2-77
    OFFICIAL_BUILD=yes

    # Use special abnormal exit codes so that problems with this library are more
    # easily tracked down.
    SHELL_LIB_INTERNAL_ERROR=86
    SHELL_LIB_THROWN_ERROR=74
    SHELL_LIB_USAGE_ERROR=99

    # old -> new variable names
    if [ -z "$DEBUG_XORG_PACKAGE" ] && [ -n "$DEBUG_XFREE86_PACKAGE" ]; then
    DEBUG_XORG_PACKAGE="$DEBUG_XFREE86_PACKAGE"
    fi
    if [ -z "$DEBUG_XORG_DEBCONF" ] && [ -n "$DEBUG_XFREE86_DEBCONF" ]; then
    DEBUG_XORG_DEBCONF="$DEBUG_XFREE86_DEBCONF"
    fi

    # initial sanity checks
    if [ -z "$THIS_PACKAGE" ]; then
    cat >&2 <<EOF
    Error: package maintainer script attempted to use shell library without
    definining \$THIS_PACKAGE shell variable. Please report the package name,
    version, and the text of this error message to the Debian Bug Tracking System.
    Visit <http://www.debian.org/Bugs/Reporting> on the World Wide Web for
    instructions, read the file /usr/share/doc/debian/bug-reporting.txt from the
    "doc-debian" package, or install the "reportbug" package and use the command of
    the same name to file a report against version $SOURCE_VERSION of this package.
    EOF
    exit $SHELL_LIB_USAGE_ERROR
    fi

    if [ -z "$THIS_SCRIPT" ]; then
    cat >&2 <<EOF
    Error: package maintainer script attempted to use shell library without
    definining \$THIS_SCRIPT shell variable. Please report the package name,
    version, and the text of this error message to the Debian Bug Tracking System.
    Visit <http://www.debian.org/Bugs/Reporting> on the World Wide Web for
    instructions, read the file /usr/share/doc/debian/bug-reporting.txt from the
    "doc-debian" package, or install the "reportbug" package and use the command of
    the same name to file a report against version $SOURCE_VERSION of the
    "$THIS_PACKAGE" package.
    EOF
    exit $SHELL_LIB_USAGE_ERROR
    fi

    trap "message;\
    message \"Received signal. Aborting $THIS_PACKAGE package $THIS_SCRIPT script.\";\
    message;\
    exit 1" HUP INT QUIT TERM

    reject_nondigits () {
    # syntax: reject_nondigits [ operand ... ]
    #
    # scan operands (typically shell variables whose values cannot be trusted) for
    # characters other than decimal digits and barf if any are found
    while [ -n "$1" ]; do
    # does the operand contain anything but digits?
    if ! expr "$1" : "[[:digit:]]\+$" > /dev/null 2>&1; then
    # can't use die(), because it wraps message() which wraps this function
    echo "$THIS_PACKAGE $THIS_SCRIPT error: reject_nondigits() encountered" \
    "possibly malicious garbage \"$1\"" >&2
    exit $SHELL_LIB_THROWN_ERROR
    fi
    shift
    done
    }

    reject_whitespace () {
    # syntax: reject_whitespace [ operand ]
    #
    # scan operand (typically a shell variable whose value cannot be trusted) for
    # whitespace characters and barf if any are found
    if [ -n "$1" ]; then
    # does the operand contain any whitespace?
    if expr "$1" : "[[:space:]]" > /dev/null 2>&1; then
    # can't use die(), because I want to avoid forward references
    echo "$THIS_PACKAGE $THIS_SCRIPT error: reject_whitespace() encountered" \
    "possibly malicious garbage \"$1\"" >&2
    exit $SHELL_LIB_THROWN_ERROR
    fi
    fi
    }

    reject_unlikely_path_chars () {
    # syntax: reject_unlikely_path_chars [ operand ... ]
    #
    # scan operands (typically shell variables whose values cannot be trusted) for
    # characters unlikely to be seen in a path and which the shell might
    # interpret and barf if any are found
    while [ -n "$1" ]; do
    # does the operand contain any funny characters?
    if expr "$1" : '.*[!$&()*;<>?|].*' > /dev/null 2>&1; then
    # can't use die(), because I want to avoid forward references
    echo "$THIS_PACKAGE $THIS_SCRIPT error: reject_unlikely_path_chars()" \
    "encountered possibly malicious garbage \"$1\"" >&2
    exit $SHELL_LIB_THROWN_ERROR
    fi
    shift
    done
    }

    # Query the terminal to establish a default number of columns to use for
    # displaying messages to the user. This is used only as a fallback in the
    # event the COLUMNS variable is not set. ($COLUMNS can react to SIGWINCH while
    # the script is running, and this cannot, only being calculated once.)
    DEFCOLUMNS=$(stty size 2> /dev/null | awk '{print $2}') || true
    if ! expr "$DEFCOLUMNS" : "[[:digit:]]\+$" > /dev/null 2>&1; then
    DEFCOLUMNS=80
    fi

    message () {
    # pretty-print messages of arbitrary length
    reject_nondigits "$COLUMNS"
    echo "$*" | fmt -t -w ${COLUMNS:-$DEFCOLUMNS} >&2
    }

    observe () {
    # syntax: observe message ...
    #
    # issue observational message suitable for logging someday when support for
    # it exists in dpkg
    if [ -n "$DEBUG_XORG_PACKAGE" ]; then
    message "$THIS_PACKAGE $THIS_SCRIPT note: $*"
    fi
    }

    warn () {
    # syntax: warn message ...
    #
    # issue warning message suitable for logging someday when support for
    # it exists in dpkg; also send to standard error
    message "$THIS_PACKAGE $THIS_SCRIPT warning: $*"
    }

    die () {
    # syntax: die message ...
    #
    # exit script with error message
    message "$THIS_PACKAGE $THIS_SCRIPT error: $*"
    exit $SHELL_LIB_THROWN_ERROR
    }

    internal_error () {
    # exit script with error; essentially a "THIS SHOULD NEVER HAPPEN" message
    message "internal error: $*"
    if [ -n "$OFFICIAL_BUILD" ]; then
    message "Please report a bug in the $THIS_SCRIPT script of the" \
    "$THIS_PACKAGE package, version $SOURCE_VERSION to the Ubuntu Bug" \
    "Tracking System. Include all messages above that mention the" \
    "$THIS_PACKAGE package. Visit " \
    "<http://bugzilla.ubuntu.com> on the World Wide Web for" \
    "instructions."
    fi
    exit $SHELL_LIB_INTERNAL_ERROR
    }

    usage_error () {
    message "usage error: $*"
    message "Please report a bug in the $THIS_SCRIPT script of the" \
    "$THIS_PACKAGE package, version $SOURCE_VERSION to the Debian Bug" \
    "Tracking System. Include all messages above that mention the" \
    "$THIS_PACKAGE package. Visit " \
    "<http://bugzilla.ubuntu.com> on the World Wide Web for" \
    "instructions."
    exit $SHELL_LIB_USAGE_ERROR
    }


    maplink () {
    # returns what symlink should point to; i.e., what the "sane" answer is
    # Keep this in sync with the debian/*.links files.
    # This is only needed for symlinks to directories.
    case "$1" in
    /etc/X11/xkb/compiled) echo /var/lib/xkb ;;
    /etc/X11/xkb/xkbcomp) echo /usr/bin/xkbcomp ;;
    /usr/X11R6/lib/X11/app-defaults) echo /etc/X11/app-defaults ;;
    /usr/X11R6/lib/X11/xkb) echo /etc/X11/xkb ;;
    /usr/X11R6/lib/X11/xserver) echo /etc/X11/xserver ;;
    *) internal_error "maplink() called with unknown path \"$1\"" ;;
    esac
    }

    analyze_path () {
    # given a supplied set of pathnames, break each one up by directory and do an
    # ls -dl on each component, cumulatively; i.e.
    # analyze_path /usr/X11R6/bin -> ls -dl /usr /usr/X11R6 /usr/X11R6/bin
    # Thanks to Randolph Chung for this clever hack.

    #local f g

    while [ -n "$1" ]; do
    reject_whitespace "$1"
    _g=
    message "Analyzing $1:"
    for _f in $(echo "$1" | tr / \ ); do
    if [ -e /$_g$_f ]; then
    ls -dl /$_g$_f /$_g$_f.dpkg-* 2> /dev/null || true
    _g=$_g$_f/
    else
    message "/$_g$_f: nonexistent; directory contents of /$_g:"
    ls -l /$_g
    break
    fi
    done
    shift
    done
    }

    find_culprits () {
    #local f p dpkg_info_dir possible_culprits smoking_guns bad_packages package \
    # msg

    reject_whitespace "$1"
    message "Searching for overlapping packages..."
    _dpkg_info_dir=/var/lib/dpkg/info
    if [ -d $_dpkg_info_dir ]; then
    if [ "$(echo $_dpkg_info_dir/*.list)" != "$_dpkg_info_dir/*.list" ]; then
    _possible_culprits=$(ls -1 $_dpkg_info_dir/*.list | egrep -v \
    "(xbase-clients|xfree86-common|xorg-common|xfs|xlibs)")
    if [ -n "$_possible_culprits" ]; then
    _smoking_guns=$(grep -l "$1" $_possible_culprits)
    if [ -n "$_smoking_guns" ]; then
    _bad_packages=$(printf "\\n")
    for f in $_smoking_guns; do
    # too bad you can't nest parameter expansion voodoo
    p=${f%*.list} # strip off the trailing ".list"
    _package=${p##*/} # strip off the directories
    _bad_packages=$(printf "%s\n%s" "$_bad_packages" "$_package")
    done
    _msg=$(cat <<EOF
    The following packages appear to have file overlaps with the X.Org packages;
    these packages are either very old, or in violation of Debian Policy. Try
    upgrading each of these packages to the latest available version if possible:
    for example, with the command "apt-get install". If no newer version of a
    package is available, you will have to remove it; for example, with the command
    "apt-get remove". If even the latest available version of the package has
    this file overlap, please file a bug against that package with the Debian Bug
    Tracking System. You may want to refer the package maintainer to section 12.8
    of the Debian Policy manual.
    EOF
    )
    message "$_msg"
    message "The overlapping packages are: $_bad_packages"
    else
    message "no overlaps found."
    fi
    fi
    else
    message "cannot search; no matches for $_dpkg_info_dir/*.list."
    fi
    else
    message "cannot search; $_dpkg_info_dir does not exist."
    fi
    }

    # we require a readlink command or shell function
    if ! which readlink > /dev/null 2>&1; then
    message "The readlink command was not found. Please install version" \
    "1.13.1 or later of the debianutils package."
    readlink () {
    # returns what symlink in $1 actually points to
    perl -e '$l = shift; exit 1 unless -l $l; $r = readlink $l; exit 1 unless $r; print "$r\n"' "$1"
    }
    fi

    check_symlink () {
    # syntax: check_symlink symlink
    #
    # See if specified symlink points where it is supposed to. Return 0 if it
    # does, and 1 if it does not.
    #
    # Primarily used by check_symlinks_and_warn() and check_symlinks_and_bomb().

    #local symlink

    # validate arguments
    if [ $# -ne 1 ]; then
    usage_error "check_symlink() called with wrong number of arguments;" \
    "expected 1, got $#"
    exit $SHELL_LIB_USAGE_ERROR
    fi

    _symlink="$1"

    if [ "$(maplink "$_symlink")" = "$(readlink "$_symlink")" ]; then
    return 0
    else
    return 1
    fi
    }

    check_symlinks_and_warn () {
    # syntax: check_symlinks_and_warn symlink ...
    #
    # For each argument, check for symlink sanity, and warn if it isn't sane.
    #
    # Call this function from a preinst script in the event $1 is "upgrade" or
    # "install".

    #local errmsg symlink

    # validate arguments
    if [ $# -lt 1 ]; then
    usage_error "check_symlinks_and_warn() called with wrong number of" \
    "arguments; expected at least 1, got $#"
    exit $SHELL_LIB_USAGE_ERROR
    fi

    while [ -n "$1" ]; do
    _symlink="$1"
    if [ -L "$_symlink" ]; then
    if ! check_symlink "$_symlink"; then
    observe "$_symlink symbolic link points to wrong location" \
    "$(readlink "$_symlink"); removing"
    rm "$_symlink"
    fi
    elif [ -e "$_symlink" ]; then
    _errmsg="$_symlink exists and is not a symbolic link; this package cannot"
    _errmsg="$_errmsg be installed until this"
    if [ -f "$_symlink" ]; then
    _errmsg="$_errmsg file"
    elif [ -d "$_symlink" ]; then
    _errmsg="$_errmsg directory"
    else
    _errmsg="$_errmsg thing"
    fi
    _errmsg="$_errmsg is removed"
    die "$_errmsg"
    fi
    shift
    done
    }

    check_symlinks_and_bomb () {
    # syntax: check_symlinks_and_bomb symlink ...
    #
    # For each argument, check for symlink sanity, and bomb if it isn't sane.
    #
    # Call this function from a postinst script.

    #local problem symlink

    # validate arguments
    if [ $# -lt 1 ]; then
    usage_error "check_symlinks_and_bomb() called with wrong number of"
    "arguments; expected at least 1, got $#"
    exit $SHELL_LIB_USAGE_ERROR
    fi

    while [ -n "$1" ]; do
    _problem=
    _symlink="$1"
    if [ -L "$_symlink" ]; then
    if ! check_symlink "$_symlink"; then
    _problem=yes
    warn "$_symlink symbolic link points to wrong location" \
    "$(readlink "$_symlink")"
    fi
    elif [ -e "$_symlink" ]; then
    _problem=yes
    warn "$_symlink is not a symbolic link"
    else
    _problem=yes
    warn "$_symlink symbolic link does not exist"
    fi
    if [ -n "$_problem" ]; then
    analyze_path "$_symlink" "$(readlink "$_symlink")"
    find_culprits "$_symlink"
    die "bad symbolic links on system"
    fi
    shift
    done
    }

    remove_conffile_prepare () {
    # syntax: remove_conffile_prepare filename official_md5sum ...
    #
    # Check a conffile "filename" against a list of canonical MD5 checksums.
    # If the file's current MD5 checksum matches one of the "official_md5sum"
    # operands provided, then prepare the conffile for removal from the system.
    # We defer actual deletion until the package is configured so that we can
    # roll this operation back if package installation fails.
    #
    # Call this function from a preinst script in the event $1 is "upgrade" or
    # "install" and verify $2 to ensure the package is being upgraded from a
    # version (or installed over a version removed-but-not-purged) prior to the
    # one in which the conffile was obsoleted.

    #local conffile current_checksum

    # validate arguments
    if [ $# -lt 2 ]; then
    usage_error "remove_conffile_prepare() called with wrong number of" \
    "arguments; expected at least 2, got $#"
    exit $SHELL_LIB_USAGE_ERROR
    fi

    _conffile="$1"
    shift

    # does the _conffile even exist?
    if [ -e "$_conffile" ]; then
    # calculate its checksum
    _current_checksum=$(md5sum < "$_conffile" | sed 's/[[:space:]].*//')
    # compare it to each supplied checksum
    while [ -n "$1" ]; do
    if [ "$_current_checksum" = "$1" ]; then
    # we found a match; move the confffile and stop looking
    observe "preparing obsolete conffile $_conffile for removal"
    mv "$_conffile" "$_conffile.$THIS_PACKAGE-tmp"
    break
    fi
    shift
    done
    fi
    }

    remove_conffile_commit () {
    # syntax: remove_conffile_commit filename
    #
    # Complete the removal of a conffile "filename" that has become obsolete.
    #
    # Call this function from a postinst script after having used
    # remove_conffile_prepare() in the preinst.

    #local conffile

    # validate arguments
    if [ $# -ne 1 ]; then
    usage_error "remove_conffile_commit() called with wrong number of" \
    "arguments; expected 1, got $#"
    exit $SHELL_LIB_USAGE_ERROR
    fi

    _conffile="$1"

    # if the temporary file created by remove_conffile_prepare() exists, remove it
    if [ -e "$_conffile.$THIS_PACKAGE-tmp" ]; then
    observe "committing removal of obsolete conffile $_conffile"
    rm "$_conffile.$THIS_PACKAGE-tmp"
    fi
    }

    remove_conffile_rollback () {
    # syntax: remove_conffile_rollback filename
    #
    # Roll back the removal of a conffile "filename".
    #
    # Call this function from a postrm script in the event $1 is "abort-upgrade"
    # or "abort-install" is after having used remove_conffile_prepare() in the
    # preinst.

    #local conffile

    # validate arguments
    if [ $# -ne 1 ]; then
    usage_error "remove_conffile_rollback() called with wrong number of" \
    "arguments; expected 1, got $#"
    exit $SHELL_LIB_USAGE_ERROR
    fi

    _conffile="$1"

    # if the temporary file created by remove_conffile_prepare() exists, move it
    # back
    if [ -e "$_conffile.$THIS_PACKAGE-tmp" ]; then
    observe "rolling back removal of obsolete conffile $_conffile"
    mv "$_conffile.$THIS_PACKAGE-tmp" "$_conffile"
    fi
    }

    run () {
    # syntax: run command [ argument ... ]
    #
    # Run specified command with optional arguments and report its exit status.
    # Useful for commands whose exit status may be nonzero, but still acceptable,
    # or commands whose failure is not fatal to us.
    #
    # NOTE: Do *not* use this function with db_get or db_metaget commands; in
    # those cases the return value of the debconf command *must* be checked
    # before the string returned by debconf is used for anything.

    #local retval

    # validate arguments
    if [ $# -lt 1 ]; then
    usage_error "run() called with wrong number of arguments; expected at" \
    "least 1, got $#"
    exit $SHELL_LIB_USAGE_ERROR
    fi

    "$@" || _retval=$?

    if [ ${_retval:-0} -ne 0 ]; then
    observe "command \"$*\" exited with status $_retval"
    fi
    }

    register_x_lib_dir_with_ld_so () {
    # syntax: register_x_lib_dir_with_ld_so
    #
    # Configure the dynamic loader ld.so to search /usr/X11R6/lib for shared
    # libraries.
    #
    # Call this function from the postinst script of a package that places a
    # shared library in /usr/X11R6/lib, before invoking ldconfig.

    #local dir ldsoconf

    _dir="/usr/X11R6/lib"
    _ldsoconf="/etc/ld.so.conf"

    # is the line not already present?
    if ! fgrep -qsx "$_dir" "$_ldsoconf"; then
    observe "adding $_dir directory to $_ldsoconf"
    echo "$_dir" >> "$_ldsoconf"
    fi
    }

    deregister_x_lib_dir_with_ld_so () {
    # syntax: deregister_x_lib_dir_with_ld_so
    #
    # Configure dynamic loader ld.so to not search /usr/X11R6/lib for shared
    # libraries, if and only if no shared libaries remain there.
    #
    # Call this function from the postrm script of a package that places a shared
    # library in /usr/X11R6/lib, in the event "$1" is "remove", and before
    # invoking ldconfig.

    #local dir ldsoconf fgrep_status cmp_status

    _dir="/usr/X11R6/lib"
    _ldsoconf="/etc/ld.so.conf"

    # is the line present?
    if fgrep -qsx "$_dir" "$_ldsoconf"; then
    # are there any shared objects in the directory?
    if [ "$(echo "$_dir"/lib*.so.*.*)" = "$_dir/lib*.so.*.*" ]; then
    # glob expansion produced nothing, so no shared libraries are present
    observe "removing $_dir directory from $_ldsoconf"
    # rewrite the file (very carefully)
    set +e
    fgrep -svx "$_dir" "$_ldsoconf" > "$_ldsoconf.dpkg-tmp"
    _fgrep_status=$?
    set -e
    case $_fgrep_status in
    0|1) ;; # we don't actually care if any lines matched or not
    *) die "error reading \"$_ldsoconf\"; fgrep exited with status" \
    "$_fgrep_status" ;;
    esac
    set +e
    cmp -s "$_ldsoconf.dpkg-tmp" "$_ldsoconf"
    _cmp_status=$?
    set -e
    case $_cmp_status in
    0) rm "$_ldsoconf.dpkg-tmp" ;; # files are identical
    1) mv "$_ldsoconf.dpkg-tmp" "$_ldsoconf" ;; # files differ
    *) die "error comparing \"$_ldsoconf.dpkg-tmp\" to \"$_ldsoconf\";" \
    "cmp exited with status $_cmp_status" ;;
    esac
    fi
    fi
    }

    # is this an unofficial Debian package?
    if [ -z "$OFFICIAL_BUILD" ]; then
    observe "unofficial build detected; issuing debconf note as warning"
    run db_register xorg-common/experimental_packages \
    xorg-common/nag
    run db_input high xorg-common/nag
    run db_go
    run db_unregister xorg-common/nag
    fi

    exit 0

    # vim:set ai et sts=2 sw=2 tw=0:



    above is the shell script if it helps. In the morning I try and install again and see if I can find the failed scripts. (then I just have to work out how to change them)


  10. #10
    Just Joined!
    Join Date
    Oct 2005
    Posts
    13

    Re:ubuntu config files

    Quote Originally Posted by drakebasher
    Quote Originally Posted by oswaldkelso
    The only Linux I have that runs with a GUI is Ubuntu.
    Sounds like your problem is either with the driver for the video adapter or with something in your X configuration file (I think that's /etc/X11/xorg.conf). If you can run Ubuntu from a LiveCD, start it up and then print, copy or write down xorg.conf so that you can then compare the Ubuntu xorg.conf against the Debian xorg.conf and make changes as needed.
    # /etc/X11/xorg.conf (xorg X Window System server configuration file)
    #
    # This file was generated by dexconf, the Debian X Configuration tool, using
    # values from the debconf database.
    #
    # Edit this file with caution, and see the /etc/X11/xorg.conf manual page.
    # (Type "man /etc/X11/xorg.conf" at the shell prompt.)
    #
    # This file is automatically updated on xserver-xorg package upgrades *only*
    # if it has not been modified since the last upgrade of the xserver-xorg
    # package.
    #
    # If you have edited this file but would like it to be automatically updated
    # again, run the following command:
    # sudo dpkg-reconfigure -phigh xserver-xorg

    Section "Files"
    FontPath "/usr/share/X11/fonts/misc"
    FontPath "/usr/share/X11/fonts/cyrillic"
    FontPath "/usr/share/X11/fonts/100dpi/:unscaled"
    FontPath "/usr/share/X11/fonts/75dpi/:unscaled"
    FontPath "/usr/share/X11/fonts/Type1"
    FontPath "/usr/share/X11/fonts/CID"
    FontPath "/usr/share/X11/fonts/100dpi"
    FontPath "/usr/share/X11/fonts/75dpi"
    # paths to defoma fonts
    FontPath "/var/lib/defoma/x-ttcidfont-conf.d/dirs/TrueType"
    FontPath "/var/lib/defoma/x-ttcidfont-conf.d/dirs/CID"
    EndSection

    Section "Module"
    Load "GLcore"
    Load "i2c"
    Load "bitmap"
    Load "ddc"
    Load "dri"
    Load "extmod"
    Load "freetype"
    Load "glx"
    Load "int10"
    Load "type1"
    Load "vbe"
    EndSection

    Section "InputDevice"
    Identifier "Generic Keyboard"
    Driver "kbd"
    Option "CoreKeyboard"
    Option "XkbRules" "xorg"
    Option "XkbModel" "pc105"
    Option "XkbLayout" "gb"
    Option "XkbOptions" "lv3:lwin_switch"
    EndSection

    Section "InputDevice"
    Identifier "Configured Mouse"
    Driver "mouse"
    Option "CorePointer"
    Option "Device" "/dev/input/mice"
    Option "Protocol" "ImPS/2"
    Option "Emulate3Buttons" "true"
    Option "ZAxisMapping" "4 5"
    EndSection

    Section "Device"
    Identifier "ATI Technologies, Inc. Radeon 7500 (RV200 QW)"
    Driver "ati"
    BusID "PCI:0:16:0"
    Option "UseFBDev" "true"
    EndSection

    Section "Monitor"
    Identifier "iMac"
    Option "DPMS"
    HorizSync 71-73
    VertRefresh 70-140
    EndSection

    Section "Screen"
    Identifier "Default Screen"
    Device "ATI Technologies, Inc. Radeon 7500 (RV200 QW)"
    Monitor "iMac"
    DefaultDepth 24
    SubSection "Display"
    Depth 1
    Modes "1024x768"
    EndSubSection
    SubSection "Display"
    Depth 4
    Modes "1024x768"
    EndSubSection
    SubSection "Display"
    Depth 8
    Modes "1024x768"
    EndSubSection
    SubSection "Display"
    Depth 15
    Modes "1024x768"
    EndSubSection
    SubSection "Display"
    Depth 16
    Modes "1024x768"
    EndSubSection
    SubSection "Display"
    Depth 24
    Modes "1024x768"
    EndSubSection
    EndSection

    Section "ServerLayout"
    Identifier "Default Layout"
    Screen "Default Screen"
    InputDevice "Generic Keyboard"
    InputDevice "Configured Mouse"
    EndSection

    Section "DRI"
    Mode 0666
    EndSection

    Is that the right one? I have these also that looked like they may be important.

    Template: xorg-common/experimental_packages
    Type: note
    Description: experimental version of XFree86 packages
    You are using an experimental version of XFree86 packages for Debian. Please
    do not file bugs with the Debian Bug Tracking System against this version of
    the packages, since they have not been released to the Debian distribution
    yet.
    .
    If you experience problems with these packages or would like to submit
    patches, please send mail to the Debian X mailing list. You can read more
    about this mailing list on the World Wide Web:
    http://lists.debian.org/debian-x/
    .
    If you do not want to be running experimental X packages, you need to do two
    things:
    1) Ensure that you do not have experimental package repositiories in
    your /etc/apt/sources.list file;
    2) Instruct apt to downgrade XFree86 to an appropriate released version;
    you can do this by appending a package suite name to the package name
    with "apt-get" -- for example:
    apt-get install xfree86-common/unstable
    or
    apt-get install xfree86-common/stable
    You may need to specify downgrades for several packages.



    I read a similar thing when Debian tried to load the screen?



    /.
    /usr
    /usr/X11R6
    /usr/X11R6/man
    /usr/X11R6/man/man7
    /usr/X11R6/man/man7/XConsortium.7x.gz
    /usr/X11R6/man/man7/XStandards.7x.gz
    /usr/X11R6/man/man7/Xsecurity.7x.gz
    /usr/X11R6/man/man7/X.7x.gz
    /usr/X11R6/man/man7/X.Org.7x.gz
    /usr/X11R6/man/man7/XProjectTeam.7x.gz
    /usr/X11R6/lib
    /usr/X11R6/lib/X11
    /usr/share
    /usr/share/doc
    /usr/share/doc/xorg-common
    /usr/share/doc/xorg-common/CHANGELOG.R5.gz
    /usr/share/doc/xorg-common/changelog.Debian.old.gz
    /usr/share/doc/xorg-common/README.gz
    /usr/share/doc/xorg-common/README.fonts.gz
    /usr/share/doc/xorg-common/RELNOTES.gz
    /usr/share/doc/xorg-common/Versions.gz
    /usr/share/doc/xorg-common/README.Debian
    /usr/share/doc/xorg-common/copyright
    /usr/share/doc/xorg-common/CHANGELOG.gz
    /usr/share/doc/xorg-common/CHANGELOG.ND.gz
    /usr/share/doc/xorg-common/changelog.Debian.gz
    /etc
    /etc/X11
    /etc/X11/Xresources
    /etc/init.d
    /etc/init.d/xorg-common
    /usr/X11R6/lib/X11/rgb.txt



    Above is the common list?


    #!/bin/sh
    # Debian xfree86-common package configuration script
    # Copyright 2002, 2003 Branden Robinson.
    # Licensed under the GNU General Public License, version 2. See the file
    # /usr/share/common-licenses/GPL or <http://www.gnu.org/copyleft/gpl.txt>.


    set -e

    # source debconf library
    . /usr/share/debconf/confmodule

    THIS_PACKAGE=xorg-common
    THIS_SCRIPT=config

    SOURCE_VERSION=6.8.2-77
    OFFICIAL_BUILD=yes

    # Use special abnormal exit codes so that problems with this library are more
    # easily tracked down.
    SHELL_LIB_INTERNAL_ERROR=86
    SHELL_LIB_THROWN_ERROR=74
    SHELL_LIB_USAGE_ERROR=99

    # old -> new variable names
    if [ -z "$DEBUG_XORG_PACKAGE" ] && [ -n "$DEBUG_XFREE86_PACKAGE" ]; then
    DEBUG_XORG_PACKAGE="$DEBUG_XFREE86_PACKAGE"
    fi
    if [ -z "$DEBUG_XORG_DEBCONF" ] && [ -n "$DEBUG_XFREE86_DEBCONF" ]; then
    DEBUG_XORG_DEBCONF="$DEBUG_XFREE86_DEBCONF"
    fi

    # initial sanity checks
    if [ -z "$THIS_PACKAGE" ]; then
    cat >&2 <<EOF
    Error: package maintainer script attempted to use shell library without
    definining \$THIS_PACKAGE shell variable. Please report the package name,
    version, and the text of this error message to the Debian Bug Tracking System.
    Visit <http://www.debian.org/Bugs/Reporting> on the World Wide Web for
    instructions, read the file /usr/share/doc/debian/bug-reporting.txt from the
    "doc-debian" package, or install the "reportbug" package and use the command of
    the same name to file a report against version $SOURCE_VERSION of this package.
    EOF
    exit $SHELL_LIB_USAGE_ERROR
    fi

    if [ -z "$THIS_SCRIPT" ]; then
    cat >&2 <<EOF
    Error: package maintainer script attempted to use shell library without
    definining \$THIS_SCRIPT shell variable. Please report the package name,
    version, and the text of this error message to the Debian Bug Tracking System.
    Visit <http://www.debian.org/Bugs/Reporting> on the World Wide Web for
    instructions, read the file /usr/share/doc/debian/bug-reporting.txt from the
    "doc-debian" package, or install the "reportbug" package and use the command of
    the same name to file a report against version $SOURCE_VERSION of the
    "$THIS_PACKAGE" package.
    EOF
    exit $SHELL_LIB_USAGE_ERROR
    fi

    trap "message;\
    message \"Received signal. Aborting $THIS_PACKAGE package $THIS_SCRIPT script.\";\
    message;\
    exit 1" HUP INT QUIT TERM

    reject_nondigits () {
    # syntax: reject_nondigits [ operand ... ]
    #
    # scan operands (typically shell variables whose values cannot be trusted) for
    # characters other than decimal digits and barf if any are found
    while [ -n "$1" ]; do
    # does the operand contain anything but digits?
    if ! expr "$1" : "[[:digit:]]\+$" > /dev/null 2>&1; then
    # can't use die(), because it wraps message() which wraps this function
    echo "$THIS_PACKAGE $THIS_SCRIPT error: reject_nondigits() encountered" \
    "possibly malicious garbage \"$1\"" >&2
    exit $SHELL_LIB_THROWN_ERROR
    fi
    shift
    done
    }

    reject_whitespace () {
    # syntax: reject_whitespace [ operand ]
    #
    # scan operand (typically a shell variable whose value cannot be trusted) for
    # whitespace characters and barf if any are found
    if [ -n "$1" ]; then
    # does the operand contain any whitespace?
    if expr "$1" : "[[:space:]]" > /dev/null 2>&1; then
    # can't use die(), because I want to avoid forward references
    echo "$THIS_PACKAGE $THIS_SCRIPT error: reject_whitespace() encountered" \
    "possibly malicious garbage \"$1\"" >&2
    exit $SHELL_LIB_THROWN_ERROR
    fi
    fi
    }

    reject_unlikely_path_chars () {
    # syntax: reject_unlikely_path_chars [ operand ... ]
    #
    # scan operands (typically shell variables whose values cannot be trusted) for
    # characters unlikely to be seen in a path and which the shell might
    # interpret and barf if any are found
    while [ -n "$1" ]; do
    # does the operand contain any funny characters?
    if expr "$1" : '.*[!$&()*;<>?|].*' > /dev/null 2>&1; then
    # can't use die(), because I want to avoid forward references
    echo "$THIS_PACKAGE $THIS_SCRIPT error: reject_unlikely_path_chars()" \
    "encountered possibly malicious garbage \"$1\"" >&2
    exit $SHELL_LIB_THROWN_ERROR
    fi
    shift
    done
    }

    # Query the terminal to establish a default number of columns to use for
    # displaying messages to the user. This is used only as a fallback in the
    # event the COLUMNS variable is not set. ($COLUMNS can react to SIGWINCH while
    # the script is running, and this cannot, only being calculated once.)
    DEFCOLUMNS=$(stty size 2> /dev/null | awk '{print $2}') || true
    if ! expr "$DEFCOLUMNS" : "[[:digit:]]\+$" > /dev/null 2>&1; then
    DEFCOLUMNS=80
    fi

    message () {
    # pretty-print messages of arbitrary length
    reject_nondigits "$COLUMNS"
    echo "$*" | fmt -t -w ${COLUMNS:-$DEFCOLUMNS} >&2
    }

    observe () {
    # syntax: observe message ...
    #
    # issue observational message suitable for logging someday when support for
    # it exists in dpkg
    if [ -n "$DEBUG_XORG_PACKAGE" ]; then
    message "$THIS_PACKAGE $THIS_SCRIPT note: $*"
    fi
    }

    warn () {
    # syntax: warn message ...
    #
    # issue warning message suitable for logging someday when support for
    # it exists in dpkg; also send to standard error
    message "$THIS_PACKAGE $THIS_SCRIPT warning: $*"
    }

    die () {
    # syntax: die message ...
    #
    # exit script with error message
    message "$THIS_PACKAGE $THIS_SCRIPT error: $*"
    exit $SHELL_LIB_THROWN_ERROR
    }

    internal_error () {
    # exit script with error; essentially a "THIS SHOULD NEVER HAPPEN" message
    message "internal error: $*"
    if [ -n "$OFFICIAL_BUILD" ]; then
    message "Please report a bug in the $THIS_SCRIPT script of the" \
    "$THIS_PACKAGE package, version $SOURCE_VERSION to the Ubuntu Bug" \
    "Tracking System. Include all messages above that mention the" \
    "$THIS_PACKAGE package. Visit " \
    "<http://bugzilla.ubuntu.com> on the World Wide Web for" \
    "instructions."
    fi
    exit $SHELL_LIB_INTERNAL_ERROR
    }

    usage_error () {
    message "usage error: $*"
    message "Please report a bug in the $THIS_SCRIPT script of the" \
    "$THIS_PACKAGE package, version $SOURCE_VERSION to the Debian Bug" \
    "Tracking System. Include all messages above that mention the" \
    "$THIS_PACKAGE package. Visit " \
    "<http://bugzilla.ubuntu.com> on the World Wide Web for" \
    "instructions."
    exit $SHELL_LIB_USAGE_ERROR
    }


    maplink () {
    # returns what symlink should point to; i.e., what the "sane" answer is
    # Keep this in sync with the debian/*.links files.
    # This is only needed for symlinks to directories.
    case "$1" in
    /etc/X11/xkb/compiled) echo /var/lib/xkb ;;
    /etc/X11/xkb/xkbcomp) echo /usr/bin/xkbcomp ;;
    /usr/X11R6/lib/X11/app-defaults) echo /etc/X11/app-defaults ;;
    /usr/X11R6/lib/X11/xkb) echo /etc/X11/xkb ;;
    /usr/X11R6/lib/X11/xserver) echo /etc/X11/xserver ;;
    *) internal_error "maplink() called with unknown path \"$1\"" ;;
    esac
    }

    analyze_path () {
    # given a supplied set of pathnames, break each one up by directory and do an
    # ls -dl on each component, cumulatively; i.e.
    # analyze_path /usr/X11R6/bin -> ls -dl /usr /usr/X11R6 /usr/X11R6/bin
    # Thanks to Randolph Chung for this clever hack.

    #local f g

    while [ -n "$1" ]; do
    reject_whitespace "$1"
    _g=
    message "Analyzing $1:"
    for _f in $(echo "$1" | tr / \ ); do
    if [ -e /$_g$_f ]; then
    ls -dl /$_g$_f /$_g$_f.dpkg-* 2> /dev/null || true
    _g=$_g$_f/
    else
    message "/$_g$_f: nonexistent; directory contents of /$_g:"
    ls -l /$_g
    break
    fi
    done
    shift
    done
    }

    find_culprits () {
    #local f p dpkg_info_dir possible_culprits smoking_guns bad_packages package \
    # msg

    reject_whitespace "$1"
    message "Searching for overlapping packages..."
    _dpkg_info_dir=/var/lib/dpkg/info
    if [ -d $_dpkg_info_dir ]; then
    if [ "$(echo $_dpkg_info_dir/*.list)" != "$_dpkg_info_dir/*.list" ]; then
    _possible_culprits=$(ls -1 $_dpkg_info_dir/*.list | egrep -v \
    "(xbase-clients|xfree86-common|xorg-common|xfs|xlibs)")
    if [ -n "$_possible_culprits" ]; then
    _smoking_guns=$(grep -l "$1" $_possible_culprits)
    if [ -n "$_smoking_guns" ]; then
    _bad_packages=$(printf "\\n")
    for f in $_smoking_guns; do
    # too bad you can't nest parameter expansion voodoo
    p=${f%*.list} # strip off the trailing ".list"
    _package=${p##*/} # strip off the directories
    _bad_packages=$(printf "%s\n%s" "$_bad_packages" "$_package")
    done
    _msg=$(cat <<EOF
    The following packages appear to have file overlaps with the X.Org packages;
    these packages are either very old, or in violation of Debian Policy. Try
    upgrading each of these packages to the latest available version if possible:
    for example, with the command "apt-get install". If no newer version of a
    package is available, you will have to remove it; for example, with the command
    "apt-get remove". If even the latest available version of the package has
    this file overlap, please file a bug against that package with the Debian Bug
    Tracking System. You may want to refer the package maintainer to section 12.8
    of the Debian Policy manual.
    EOF
    )
    message "$_msg"
    message "The overlapping packages are: $_bad_packages"
    else
    message "no overlaps found."
    fi
    fi
    else
    message "cannot search; no matches for $_dpkg_info_dir/*.list."
    fi
    else
    message "cannot search; $_dpkg_info_dir does not exist."
    fi
    }

    # we require a readlink command or shell function
    if ! which readlink > /dev/null 2>&1; then
    message "The readlink command was not found. Please install version" \
    "1.13.1 or later of the debianutils package."
    readlink () {
    # returns what symlink in $1 actually points to
    perl -e '$l = shift; exit 1 unless -l $l; $r = readlink $l; exit 1 unless $r; print "$r\n"' "$1"
    }
    fi

    check_symlink () {
    # syntax: check_symlink symlink
    #
    # See if specified symlink points where it is supposed to. Return 0 if it
    # does, and 1 if it does not.
    #
    # Primarily used by check_symlinks_and_warn() and check_symlinks_and_bomb().

    #local symlink

    # validate arguments
    if [ $# -ne 1 ]; then
    usage_error "check_symlink() called with wrong number of arguments;" \
    "expected 1, got $#"
    exit $SHELL_LIB_USAGE_ERROR
    fi

    _symlink="$1"

    if [ "$(maplink "$_symlink")" = "$(readlink "$_symlink")" ]; then
    return 0
    else
    return 1
    fi
    }

    check_symlinks_and_warn () {
    # syntax: check_symlinks_and_warn symlink ...
    #
    # For each argument, check for symlink sanity, and warn if it isn't sane.
    #
    # Call this function from a preinst script in the event $1 is "upgrade" or
    # "install".

    #local errmsg symlink

    # validate arguments
    if [ $# -lt 1 ]; then
    usage_error "check_symlinks_and_warn() called with wrong number of" \
    "arguments; expected at least 1, got $#"
    exit $SHELL_LIB_USAGE_ERROR
    fi

    while [ -n "$1" ]; do
    _symlink="$1"
    if [ -L "$_symlink" ]; then
    if ! check_symlink "$_symlink"; then
    observe "$_symlink symbolic link points to wrong location" \
    "$(readlink "$_symlink"); removing"
    rm "$_symlink"
    fi
    elif [ -e "$_symlink" ]; then
    _errmsg="$_symlink exists and is not a symbolic link; this package cannot"
    _errmsg="$_errmsg be installed until this"
    if [ -f "$_symlink" ]; then
    _errmsg="$_errmsg file"
    elif [ -d "$_symlink" ]; then
    _errmsg="$_errmsg directory"
    else
    _errmsg="$_errmsg thing"
    fi
    _errmsg="$_errmsg is removed"
    die "$_errmsg"
    fi
    shift
    done
    }

    check_symlinks_and_bomb () {
    # syntax: check_symlinks_and_bomb symlink ...
    #
    # For each argument, check for symlink sanity, and bomb if it isn't sane.
    #
    # Call this function from a postinst script.

    #local problem symlink

    # validate arguments
    if [ $# -lt 1 ]; then
    usage_error "check_symlinks_and_bomb() called with wrong number of"
    "arguments; expected at least 1, got $#"
    exit $SHELL_LIB_USAGE_ERROR
    fi

    while [ -n "$1" ]; do
    _problem=
    _symlink="$1"
    if [ -L "$_symlink" ]; then
    if ! check_symlink "$_symlink"; then
    _problem=yes
    warn "$_symlink symbolic link points to wrong location" \
    "$(readlink "$_symlink")"
    fi
    elif [ -e "$_symlink" ]; then
    _problem=yes
    warn "$_symlink is not a symbolic link"
    else
    _problem=yes
    warn "$_symlink symbolic link does not exist"
    fi
    if [ -n "$_problem" ]; then
    analyze_path "$_symlink" "$(readlink "$_symlink")"
    find_culprits "$_symlink"
    die "bad symbolic links on system"
    fi
    shift
    done
    }

    remove_conffile_prepare () {
    # syntax: remove_conffile_prepare filename official_md5sum ...
    #
    # Check a conffile "filename" against a list of canonical MD5 checksums.
    # If the file's current MD5 checksum matches one of the "official_md5sum"
    # operands provided, then prepare the conffile for removal from the system.
    # We defer actual deletion until the package is configured so that we can
    # roll this operation back if package installation fails.
    #
    # Call this function from a preinst script in the event $1 is "upgrade" or
    # "install" and verify $2 to ensure the package is being upgraded from a
    # version (or installed over a version removed-but-not-purged) prior to the
    # one in which the conffile was obsoleted.

    #local conffile current_checksum

    # validate arguments
    if [ $# -lt 2 ]; then
    usage_error "remove_conffile_prepare() called with wrong number of" \
    "arguments; expected at least 2, got $#"
    exit $SHELL_LIB_USAGE_ERROR
    fi

    _conffile="$1"
    shift

    # does the _conffile even exist?
    if [ -e "$_conffile" ]; then
    # calculate its checksum
    _current_checksum=$(md5sum < "$_conffile" | sed 's/[[:space:]].*//')
    # compare it to each supplied checksum
    while [ -n "$1" ]; do
    if [ "$_current_checksum" = "$1" ]; then
    # we found a match; move the confffile and stop looking
    observe "preparing obsolete conffile $_conffile for removal"
    mv "$_conffile" "$_conffile.$THIS_PACKAGE-tmp"
    break
    fi
    shift
    done
    fi
    }

    remove_conffile_commit () {
    # syntax: remove_conffile_commit filename
    #
    # Complete the removal of a conffile "filename" that has become obsolete.
    #
    # Call this function from a postinst script after having used
    # remove_conffile_prepare() in the preinst.

    #local conffile

    # validate arguments
    if [ $# -ne 1 ]; then
    usage_error "remove_conffile_commit() called with wrong number of" \
    "arguments; expected 1, got $#"
    exit $SHELL_LIB_USAGE_ERROR
    fi

    _conffile="$1"

    # if the temporary file created by remove_conffile_prepare() exists, remove it
    if [ -e "$_conffile.$THIS_PACKAGE-tmp" ]; then
    observe "committing removal of obsolete conffile $_conffile"
    rm "$_conffile.$THIS_PACKAGE-tmp"
    fi
    }

    remove_conffile_rollback () {
    # syntax: remove_conffile_rollback filename
    #
    # Roll back the removal of a conffile "filename".
    #
    # Call this function from a postrm script in the event $1 is "abort-upgrade"
    # or "abort-install" is after having used remove_conffile_prepare() in the
    # preinst.

    #local conffile

    # validate arguments
    if [ $# -ne 1 ]; then
    usage_error "remove_conffile_rollback() called with wrong number of" \
    "arguments; expected 1, got $#"
    exit $SHELL_LIB_USAGE_ERROR
    fi

    _conffile="$1"

    # if the temporary file created by remove_conffile_prepare() exists, move it
    # back
    if [ -e "$_conffile.$THIS_PACKAGE-tmp" ]; then
    observe "rolling back removal of obsolete conffile $_conffile"
    mv "$_conffile.$THIS_PACKAGE-tmp" "$_conffile"
    fi
    }

    run () {
    # syntax: run command [ argument ... ]
    #
    # Run specified command with optional arguments and report its exit status.
    # Useful for commands whose exit status may be nonzero, but still acceptable,
    # or commands whose failure is not fatal to us.
    #
    # NOTE: Do *not* use this function with db_get or db_metaget commands; in
    # those cases the return value of the debconf command *must* be checked
    # before the string returned by debconf is used for anything.

    #local retval

    # validate arguments
    if [ $# -lt 1 ]; then
    usage_error "run() called with wrong number of arguments; expected at" \
    "least 1, got $#"
    exit $SHELL_LIB_USAGE_ERROR
    fi

    "$@" || _retval=$?

    if [ ${_retval:-0} -ne 0 ]; then
    observe "command \"$*\" exited with status $_retval"
    fi
    }

    register_x_lib_dir_with_ld_so () {
    # syntax: register_x_lib_dir_with_ld_so
    #
    # Configure the dynamic loader ld.so to search /usr/X11R6/lib for shared
    # libraries.
    #
    # Call this function from the postinst script of a package that places a
    # shared library in /usr/X11R6/lib, before invoking ldconfig.

    #local dir ldsoconf

    _dir="/usr/X11R6/lib"
    _ldsoconf="/etc/ld.so.conf"

    # is the line not already present?
    if ! fgrep -qsx "$_dir" "$_ldsoconf"; then
    observe "adding $_dir directory to $_ldsoconf"
    echo "$_dir" >> "$_ldsoconf"
    fi
    }

    deregister_x_lib_dir_with_ld_so () {
    # syntax: deregister_x_lib_dir_with_ld_so
    #
    # Configure dynamic loader ld.so to not search /usr/X11R6/lib for shared
    # libraries, if and only if no shared libaries remain there.
    #
    # Call this function from the postrm script of a package that places a shared
    # library in /usr/X11R6/lib, in the event "$1" is "remove", and before
    # invoking ldconfig.

    #local dir ldsoconf fgrep_status cmp_status

    _dir="/usr/X11R6/lib"
    _ldsoconf="/etc/ld.so.conf"

    # is the line present?
    if fgrep -qsx "$_dir" "$_ldsoconf"; then
    # are there any shared objects in the directory?
    if [ "$(echo "$_dir"/lib*.so.*.*)" = "$_dir/lib*.so.*.*" ]; then
    # glob expansion produced nothing, so no shared libraries are present
    observe "removing $_dir directory from $_ldsoconf"
    # rewrite the file (very carefully)
    set +e
    fgrep -svx "$_dir" "$_ldsoconf" > "$_ldsoconf.dpkg-tmp"
    _fgrep_status=$?
    set -e
    case $_fgrep_status in
    0|1) ;; # we don't actually care if any lines matched or not
    *) die "error reading \"$_ldsoconf\"; fgrep exited with status" \
    "$_fgrep_status" ;;
    esac
    set +e
    cmp -s "$_ldsoconf.dpkg-tmp" "$_ldsoconf"
    _cmp_status=$?
    set -e
    case $_cmp_status in
    0) rm "$_ldsoconf.dpkg-tmp" ;; # files are identical
    1) mv "$_ldsoconf.dpkg-tmp" "$_ldsoconf" ;; # files differ
    *) die "error comparing \"$_ldsoconf.dpkg-tmp\" to \"$_ldsoconf\";" \
    "cmp exited with status $_cmp_status" ;;
    esac
    fi
    fi
    }

    # is this an unofficial Debian package?
    if [ -z "$OFFICIAL_BUILD" ]; then
    observe "unofficial build detected; issuing debconf note as warning"
    run db_register xorg-common/experimental_packages \
    xorg-common/nag
    run db_input high xorg-common/nag
    run db_go
    run db_unregister xorg-common/nag
    fi

    exit 0

    # vim:set ai et sts=2 sw=2 tw=0:



    above is the shell script if it helps. In the morning I try and install again and see if I can find the failed scripts. (then I just have to work out how to change them)


Page 1 of 3 1 2 3 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •