Benutzer-Werkzeuge

Webseiten-Werkzeuge


debian

Dies ist eine alte Version des Dokuments!


Debian GNU/Linux

ls -la

~/.bashrc oder /etc/bash.bashrc

alias la = 'ls -la'

Auto Login gdm3

/etc/gdm3/daemon.conf

 Enabling automatic login
 AutomaticLoginEnable = true
 AutomaticLogin = user

A start job is running for Raise network interfaces

  cd /etc/network
  sudo vi interfaces
  #auto eth0
  #auto wlan0
  .......

Fully Upgrade current System

Persistenten LIVE Stick erstellen

http://cosmolinux.no-ip.org/raconetlinux2/persistence.html

Problem: Standard Soundausgabe auf HDMI

Lösung: cat /dev/sndstat

Wenn HDMI als Soundkarte 0 gelistet ist, folgendes in /etc/modprobe.d/snd-hda-intel.conf eintragen:

options snd-hda-intel index=0,-2

Dann

sudo rmmod snd-hda-intel
sudo modprobe snd-hda-intel
oder reboot

→ HDMI sollte jetzt in /dev/sndstat nicht mehr an erster Stelle stehen.

Sämtliche Pakete neu installieren

dpkg --get-selections | grep "\binstall" | awk '{print $1}' > /tmp/dpkg.log 
sudo xargs -n1 apt-get --reinstall install -y < /tmp/dpkg.log

Debian Runlevel Configuration Tool

apt-get install rcconf

Debian Edu / Skolelinux Jessie — Eine vollständige Linux-Lösung für Ihre Schule

Mittels backports.debian.org neuere Software installieren

"deb http://ftp.debian.org/debian/ jessie-backports main" in /etc/apt/sources.list eintragen
apt-get update
apt-get install -t jessie-backports tuxtype

Downgrade im Notfall

Systeminformation

hostnamectl
uname -mrs
lsb_release -a

hostnamectl

Upgrade Debian 8 from version 8.2 to 8.3

uname -mrs
lsb_release -a

sudo apt-get update
sudo apt-get dist-upgrade

reboot

uname -mrs
lsb_release -a
dmesg | egrep -i 'err|warn|critical'
sudo tail -f /var/log/myapp

Suche nach Paketen

apt-cache search paketname

Paketübersicht

apt-cache policy paketname

Tabellarische Paketübersicht der Paketquellen

apt-cache madison paketname

Paketinstallation wiederholen

apt-get --reinstall install paketname

System updaten

apt-get upgrade

Distribution updaten

apt-get dist-upgrade

Netzwerk

/etc/network/interfaces
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

#auto wlan0
#iface wlan0 inet dhcp
#wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf

allow-hotplug eth0
iface eth0 inet static
 address 10.0.0.1
 netmask 255.255.255.0
 gateway 10.0.0.138
 dns-domain peer.st
 dns-nameservers 10.0.0.138
 dns-nameservers 8.8.8.8

Netzwerk neu starten

/etc/init.d/networking restart

Zeitzone einstellen

dpkg-reconfigure tzdat

Problem:

Der Wert wheezy ist für APT::default release ungültig

Lösung

Datei /etc/apt/apt.conf mit folgendem Inhalt anlegen:

APT::Default-Release "jessie";

GPG Schlüssel abgelaufen

apt-get install debian-keyring
gpg --keyserver pgp.mit.edu --recv-keys 1F41B907
gpg --armor --export 1F41B907 | apt-key add -

apt-get meldet "fopen: Keine Berechtigung

chown -R man /var/cache/man

Update von wheezy nach jessie

Tastatur umstellen

sudo apt-get install debconf console-data
sudo dpkg-reconfigure keyboard-configuration
sudo dpkg-reconfigure console-data
sudo dpkg-reconfigure locale

Autostart und Stopp von Diensten

http://www.tippscout.de/ubuntu-dienste-automatisch-starten_tipp_5451.html

update-rc.d mysql defaults
update-rc.d mysql remove

Grub

/boot/grub/grub.cfg

FAI

Anzahl der Einträge in die history

vi /etc/enviroment
HISTSIZE=2000
HISTFILESIZE=20000

bash Autovervollständigung mit TAB

vi /etc/bash.bashrc
# enable bash completion in interactive shells
if ! shopt -oq posix; then
  if [ -f /usr/share/bash-completion/bash_completion ]; then
    . /usr/share/bash-completion/bash_completion
  elif [ -f /etc/bash_completion ]; then
    . /etc/bash_completion
  fi
fi

Distribution abfragen

lsb_release  -a

/etc/apt/sources.list

#Debian Server
#deb http://http.debian.net/debian wheezy main
#deb-src http://http.debian.net/debian wheezy main

#deb http://http.debian.net/debian wheezy-updates main
#deb-src http://http.debian.net/debian wheezy-updates main

deb http://security.debian.org/ wheezy/updates main
deb-src http://security.debian.org/ wheezy/updates main

#debian - Österreich

#deb http://ftp.at.debian.org/debian/ wheezy main contrib non-free
#deb-src http://ftp.at.debian.org/debian/ wheezy main contrib non-free

#deb http://ftp.at.debian.org/debian/ wheezy-updates main contrib non-free
#deb-src http://ftp.at.debian.org/debian/ wheezy-updates main contrib non-free

Deutsches Sprachpaket für KDE, Iceweasel, Icedove

apt-get install kde-l10n-de iceweasel-l10n-de icedove-l10n-de

Debian LIVE

http://live.debian.net

Bootparameter

keyboard_layout=de

Installation

Befehle beim Start hinzufügen

vi /etc/rc.local

init-script hinzufügen, entfernen

Vorlage: /etc/init.d/skeleton
$ sudo chmod 755 /etc/init.d/foobar
$ sudo update-rc.d foobar defaults
$ sudo update-rc.d -f foobar remove 

Paketverwaltung

  • Grundsätzlich: backport Repository benutzen. Mischen von testing und stable ist nicht gut
  • /etc/apt/sources.list:
...
deb http://debian.inode.at/debian squeeze main contrib non-free
deb http://www.backports.org/debian  squeeze-backports main contrib non-free
deb http://security.debian.org/ squeeze-updates main contrib non-free
deb http://www.debian-multimedia.org/ squeeze main non-free
deb http://mirror.home-dn.net/debian-multimedia/ squeeze main

...
apt-get update
apt-get install debian-backports-keyring

Tools

  • vi, mc, nmap:
apt-get install vim mc nmap 
  • ssh-server:
apt-get install openssh-server
  • Java:
apt-get install sun-java6-jre 
update-alternatives --config java
  • Flash:
apt-get install flashplugin-nonfree

Virtualbox Guest Additions

apt-get update
apt-get install build-essential module-assistant
  • Kernel-Sourcen vorbereiten:
m-a prepare
  • VirtualBox → Install Guest Additions
mount /media/cdrom
sh /media/cdrom/VBoxLinuxAdditions.run

Strg+arrow up oder Strg+arrow down für History

Put the following lines in your ~/.inputrc:
## arrow up
"\e[A":history-search-backward
## arrow down
"\e[B":history-search-forward

Kernel Upgrade

  • Aktuellen Kernel suchen:
aptitude search linux-image
  • Installieren:
aptitude -t lenny-backports install debian-backports-keyring linux-image-2.6.32-bpo.5-amd64 linux-headers-2.6.32-bpo.5-amd64
  • Reboot & Enjoy!

GDM

  • root erlauben, sich einzuloggen:
gdmsetup

Vorbereiten zum Klonen

Multimedia

apt-get install debian-multimedia-keyring
  • Flash:
apt-get install flashplugin-nonfree
update-flashplugin-nonfree --install
apt-get install dvdauthor
apt-get install dvdbackup
apt-get install dvdrtools
apt-get install dvd+rw-tools
apt-get install k9copy ....or for Gnome Desktop consider Brasero
apt-get install libmad0
apt-get install lame
apt-get install libavifile-0.7c2
apt-get install libdvdcss2
apt-get install libdvdnav4
apt-get install libdvdread3
apt-get install liblame0
apt-get install libxine1-ffmpeg
apt-get install mencoder
apt-get install msttcorefonts  ...(this one will take a bit of time)
apt-get install transcode
apt-get install vamps
apt-get install w32codecs    ......or w64codiecs where applicable
apt-get install kaffeine   ..... or for Gnome Desktop consider Mplayer or Totem
apt-get install vlc
apt-get install flac
apt-get install gstreamer0.10-ffmeg
apt-get install gstreamer0.10-fluendo-mp3
apt-get install gsteamer0.10-plugins-bad
apt-get install xine-console
and the libxine plugin support
....libxine1-misc-plugins
....libxine1-ffmpeg
....libxine1-plugins
....libxine1-x

PDF in HTML umwandeln via php

apt-get install poppler-utils
test.php
<?php
 
$datei="l110328";
if (file_exists("$datei.pdf") AND !file_exists("$datei.html"))
{
    exec("pdftohtml -c -i -noframes $datei.pdf $datei.html",$noecho);
    exec("sed 's/<BODY bgcolor=\"#A0A0A0\"/<BODY bgcolor=\"#FFFFFF\"/' $datei.html > tmp",$noecho);
    exec("rm html/$datei.html;mv html/tmp html/$datei.html",$noecho);
}
 
?>

Script beim Herunterfahren ausführen

vi /etc/init.d/clean
#!/bin/bash

rm /etc/udev/rules.d/70-persistent-net.rules
ethtool -s eth0 wol g
chmod a+x /etc/init.d/clean
update-rc.d clean start 20 0 6 .

Jungfräuliches Debian

/etc/vim/vimrc
...
set number
...
syntax on
...
if has("autocmd")
  au BufReadPost * if line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g'\"" | endif
endif
...
/etc/inputrc
...
# alternate mappings for "page up" and "page down" to search the history
"\e[5~": history-search-backward
"\e[6~": history-search-forward
...
/etc/bash.bashrc
...
test -s /etc/profile.d/ls.bash && . /etc/profile.d/ls.bash
test -s /etc/profile.d/alias.bash && . /etc/profile.d/alias.bash
/etc/profile.d/ls.bash
case "$-" in
*i*)
    #
    # Colored file listings
    #
    if test -x /usr/bin/dircolors ; then
        #
        # set up the color-ls environment variables:
        #
        if test -f $HOME/.dir_colors ; then
            eval "`/usr/bin/dircolors -b $HOME/.dir_colors`"
        elif test -f /etc/DIR_COLORS ; then
            eval "`/usr/bin/dircolors -b /etc/DIR_COLORS`"
        fi
    fi
 
    #
    # ls color option depends on the terminal
    # If LS_COLORS is set but empty, the terminal has no colors.
    #
    if test "${LS_COLORS+empty}" = "${LS_COLORS:+empty}" ; then
        LS_OPTIONS=--color=tty
    else
        LS_OPTIONS=--color=none
    fi
    if test "$UID" = 0 ; then
        LS_OPTIONS="-A -N $LS_OPTIONS -T 0"
    else
        LS_OPTIONS="-N $LS_OPTIONS -T 0"
    fi
 
    #
    # Avoid trouble with Emacs shell mode
    #
    if test "$EMACS" = "t" ; then
        LS_OPTIONS='-N --color=none -T 0';
    fi
    export LS_OPTIONS
 
    #
    # useful ls aliases
    #
    if test "$is" != "ash" ; then
        unalias ls 2>/dev/null
    fi
    case "$is" in
        bash) alias ls='ls $LS_OPTIONS'      ;;
        zsh)  alias ls='\ls $=LS_OPTIONS'    ;;
        *)    alias ls='/bin/ls $LS_OPTIONS' ;;
    esac
    alias dir='ls -l'
    alias ll='ls -l'
    alias la='ls -la'
    alias l='ls -alF'
    alias ls-l='ls -l'
    ;;
esac
/etc/profile.d/alias.bash
#
# Some useful functions
#
if test -z "$restricted" ; then
    startx  () {
        test -x /usr/bin/startx || {
            echo "No startx installed" 1>&2
            return 1;
        }
        /usr/bin/startx ${1+"$@"} 2>&1 | tee $HOME/.xsession-errors
    }
    remount () { /bin/mount -o remount,${1+"$@"} ; }
fi
 
#
# Set some generic aliases
#
alias o='less'
alias ..='cd ..'
alias ...='cd ../..'
alias cd..='cd ..'
if test "$is" != "ksh" ; then
    alias -- +='pushd .'
    alias -- -='popd'
fi
alias rd=rmdir
alias egrep='egrep --color=auto'
alias fgrep='fgrep --color=auto'
alias grep='grep --color=auto'
alias md='mkdir -p'
if test "$is" = "bash" -a ! -x /bin/which -a ! -x /usr/bin/which ; then
    #
    # Other shells use the which command in path (e.g. ash) or
    # their own builtin for the which command (e.g. ksh and zsh).
    #
    _which () {
        local file=$(type -p ${1+"$@"} 2>/dev/null)
        if test -n "$file" -a -x "$file"; then
            echo "$file"
            return 0
        fi
        hash -r
        type -P ${1+"$@"}
    }
    alias which=_which
fi
alias rehash='hash -r'
alias you='if test "$EUID" = 0 ; then /sbin/yast2 online_update ; else su - -c "/sbin/yast2 online_update" ; fi'
if test "$is" != "ksh" ; then
    alias beep='echo -en "\007"'
else
    alias beep='echo -en "\x07"'
fi
alias unmount='echo "Error: Try the command: umount" 1>&2; false'
/root/.bashrc
...
PS1='\[\033[1;31m\]\u@\h:\w #\[\033[0m\] '
...
debian.1620980174.txt.gz · Zuletzt geändert: 2021/05/14 10:16 von admin