Difference between revisions of "Debian - handbook for apt-get"

From Blue-IT.org Wiki

(Pakete installieren / install packages)
(APT)
Line 38: Line 38:
  
 
==APT==
 
==APT==
 +
=== apt-miror ===
 +
 +
My mirror list:
 +
 +
############# config ##################
 +
#
 +
set base_path    /local/apt-mirror
 +
#
 +
# set mirror_path  $base_path/mirror
 +
# set skel_path    $base_path/skel
 +
# set var_path    $base_path/var
 +
# set cleanscript $var_path/clean.sh
 +
# set defaultarch  <running host architecture>
 +
# set postmirror_script $var_path/postmirror.sh
 +
# set run_postmirror 0
 +
set nthreads    20
 +
set _tilde 0
 +
#
 +
############# end config ##############
 +
 +
# DEBS
 +
deb http://archive.ubuntu.com/ubuntu trusty main restricted universe multiverse
 +
deb http://archive.ubuntu.com/ubuntu trusty-security main restricted universe multiverse
 +
deb http://archive.ubuntu.com/ubuntu trusty-updates main restricted universe multiverse
 +
#deb http://archive.ubuntu.com/ubuntu trusty-proposed main restricted universe multiverse
 +
#deb http://archive.ubuntu.com/ubuntu trusty-backports main restricted universe mul
 +
deb http://archive.canonical.com/ubuntu trusty partner
 +
deb http://extras.ubuntu.com/ubuntu trusty main
 +
 +
 +
# SOURCES
 +
#deb-src http://archive.uibuntu.com/ubuntu trusty main restricted universe multiverse
 +
#deb-src http://archive.ubuntu.com/ubuntu trusty-security main restricted universe multiverse
 +
#deb-src http://archive.ubuntu.com/ubuntu trusty-updates main restricted universe multiverse
 +
#deb-src http://archive.ubuntu.com/ubuntu trusty-proposed main restricted universe multiverse
 +
#deb-src http://archive.ubuntu.com/ubuntu trusty-backports main restricted universe multiverse
 +
 +
# THIRD PARTY
 +
 +
# Openprinting
 +
deb http://www.openprinting.org/download/printdriver/debian/ lsb3.2 contrib
 +
 +
#Google2Ubuntu
 +
deb http://ppa.launchpad.net/benoitfra/google2ubuntu/ubuntu trusty main
 +
 +
# Docky
 +
deb http://ppa.launchpad.net/docky-core/ppa/ubuntu trusty main
 +
 +
# Google
 +
deb http://dl.google.com/linux/chrome/deb/ stable main
 +
 +
# Google Talk Plugin
 +
deb http://dl.google.com/linux/talkplugin/deb/ stable main
 +
 +
# Monodevelop 4
 +
deb http://ppa.launchpad.net/inizan-yannick/mono/ubuntu trusty main
 +
 +
# Libreoffice stable
 +
deb http://ppa.launchpad.net/libreoffice/ppa/ubuntu trusty main
 +
 +
# Thinkpad
 +
deb http://ppa.launchpad.net/linrunner/thinkpad-extras/ubuntu trusty main
 +
deb http://ppa.launchpad.net/linrunner/tlp/ubuntu trusty main
 +
 +
# Simple Screen Recorder
 +
deb http://ppa.launchpad.net/maarten-baert/simplescreenrecorder/ubuntu trusty main
 +
 +
# Multimedia, VLC, ffmpeg, libdvd ...
 +
deb http://ppa.launchpad.net/mc3man/trusty-media/ubuntu trusty main
 +
 +
# Multisystem
 +
deb http://liveusb.info/multisystem/depot all main
 +
 +
# WebUpd8 nilarimogard: equalizer, audio-tools, multimedia
 +
deb http://ppa.launchpad.net/nilarimogard/webupd8/ubuntu trusty main
 +
 +
# Mac Mbuntu - Noobslab Themes
 +
deb http://ppa.launchpad.net/noobslab/themes/ubuntu trusty main
 +
 +
# Opera
 +
deb http://deb.opera.com/opera/ lenny non-free
 +
 +
# Kesselgulasch - gimp
 +
deb http://ppa.launchpad.net/otto-kesselgulasch/gimp/ubuntu trusty main
 +
 +
# Owncloud
 +
deb http://download.opensuse.org/repositories/isv:/ownCloud:/desktop/Ubuntu_14.04/ /
 +
 +
# Pipelight (Flash, Silverlight)
 +
deb http://ppa.launchpad.net/pipelight/stable/ubuntu trusty main
 +
 +
# Darktable
 +
deb http://ppa.launchpad.net/pmjdebruijn/darktable-release/ubuntu trusty main
 +
 +
# RabbitVCS
 +
deb http://ppa.launchpad.net/rabbitvcs/ppa/ubuntu trusty main
 +
 +
# Humanity Colors Theme
 +
deb http://ppa.launchpad.net/ravefinity-project/ppa/ubuntu trusty main
 +
 +
# Satyajit Happy Themes
 +
deb http://ppa.launchpad.net/satyajit-happy/themes/ubuntu trusty main
 +
 +
# Shutter
 +
deb http://ppa.launchpad.net/shutter/ppa/ubuntu trusty main
 +
 +
# Skype
 +
deb http://download.skype.com/linux/repos/debian/ stable non-free
 +
 +
# Handbrake Stable
 +
deb http://ppa.launchpad.net/stebbins/handbrake-releases/ubuntu trusty main
 +
 +
# Truecrypt und Indikator
 +
deb http://ppa.launchpad.net/stefansundin/truecrypt/ubuntu trusty main
 +
 +
# SVN
 +
deb http://ppa.launchpad.net/svn/ppa/ubuntu trusty main
 +
 +
# Tuxboot
 +
deb http://ppa.launchpad.net/thomas.tsai/ubuntu-tuxboot/ubuntu trusty main
 +
 +
# Equinox Theme
 +
deb http://ppa.launchpad.net/tiheum/equinox/ubuntu trusty main
 +
 +
# Ubuntu-Tweak
 +
deb http://ppa.launchpad.net/tualatrix/ppa/ubuntu trusty main
 +
 +
# WINE
 +
deb http://ppa.launchpad.net/ubuntu-wine/ppa/ubuntu trusty main
 +
 +
# VirtualBox
 +
deb http://download.virtualbox.org/virtualbox/debian trusty contrib
 +
 +
# Java WebUpd8
 +
deb http://ppa.launchpad.net/webupd8team/java/ubuntu trusty main
 +
 +
# Sublime Text 3 - WebUpd8
 +
deb http://ppa.launchpad.net/webupd8team/sublime-text-3/ubuntu trusty main
 +
 +
# Tor Browser Projekt
 +
deb http://ppa.launchpad.net/webupd8team/tor-browser/ubuntu trusty main
 +
 +
# Y-PPA Manager
 +
deb http://ppa.launchpad.net/webupd8team/y-ppa-manager/ubuntu trusty main
 +
 +
# X2Go Stable
 +
deb http://ppa.launchpad.net/x2go/stable/ubuntu trusty mai
 +
 
 +
clean http://archive.ubuntu.com/ubuntu
 +
 +
Then you can create an apt-mirror-client list from this file:
 +
cat mirror.list | grep -v ^# | grep -v  clean | grep -v set | grep -v '^$' | \
 +
sed  's/ppa.launchpad.net/teneriffa/g' | sed  's/download.skype.com/teneriffa/g' | \
 +
sed  's/download.virtualbox.org/teneriffa/g' |  sed  's/download.opensuse.org/teneriffa/g' | \
 +
sed  's/deb.opera.com/teneriffa/g' | sed  's/dl.google.com/teneriffa/g' | \
 +
sed  's/archive.ubuntu.com/teneriffa/g' | sed  's/extras.ubuntu.com/teneriffa/g' | \
 +
sed  's/archive.canonical.com/teneriffa/g' | sed  's/www.openprinting.org/teneriffa/g'| \
 +
sed  's/liveusb.info/teneriffa/g
 +
 +
and save it on your client ;-)
 +
 
=== GPG ===
 
=== GPG ===
  

Revision as of 12:34, 7 March 2015

Konsole öffnen, als Administrator anmelden. Open a console (terminal) and login as root.

Also see

Navigate

Navigieren in Verzeichnissen

Wo bin ich?

pwd

Verzeichnis anzeigen

ls

In Verzeichnis wechseln. (Tip: mit Tabulatortaste vervollständigen)

ls
cd Ve (Tabulatortaste drücken)
cd Verzeichnisname

Verzeichnis runter

cd ..

Locate

Datei suchen / Search for files

1. Suchdatenbank aktualisieren / actuate search database

updatedb

2. Suchen / search

locate dateiname | grep muster

Beispiel für Dateinamen / Examples for filenames

locate *.rpm | grep synaptic
locate *.doc | grep tax
locate *.txt

APT

apt-miror

My mirror list:

############# config ##################
#
set base_path    /local/apt-mirror
#
# set mirror_path  $base_path/mirror
# set skel_path    $base_path/skel
# set var_path     $base_path/var
# set cleanscript $var_path/clean.sh
# set defaultarch  <running host architecture>
# set postmirror_script $var_path/postmirror.sh
# set run_postmirror 0
set nthreads     20
set _tilde 0
#
############# end config ##############

# DEBS
deb http://archive.ubuntu.com/ubuntu trusty main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu trusty-security main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu trusty-updates main restricted universe multiverse
#deb http://archive.ubuntu.com/ubuntu trusty-proposed main restricted universe multiverse
#deb http://archive.ubuntu.com/ubuntu trusty-backports main restricted universe mul
deb http://archive.canonical.com/ubuntu trusty partner
deb http://extras.ubuntu.com/ubuntu trusty main


# SOURCES
#deb-src http://archive.uibuntu.com/ubuntu trusty main restricted universe multiverse
#deb-src http://archive.ubuntu.com/ubuntu trusty-security main restricted universe multiverse
#deb-src http://archive.ubuntu.com/ubuntu trusty-updates main restricted universe multiverse
#deb-src http://archive.ubuntu.com/ubuntu trusty-proposed main restricted universe multiverse
#deb-src http://archive.ubuntu.com/ubuntu trusty-backports main restricted universe multiverse

# THIRD PARTY

# Openprinting
deb http://www.openprinting.org/download/printdriver/debian/ lsb3.2 contrib

#Google2Ubuntu
deb http://ppa.launchpad.net/benoitfra/google2ubuntu/ubuntu trusty main

# Docky
deb http://ppa.launchpad.net/docky-core/ppa/ubuntu trusty main

# Google
deb http://dl.google.com/linux/chrome/deb/ stable main

# Google Talk Plugin
deb http://dl.google.com/linux/talkplugin/deb/ stable main

# Monodevelop 4
deb http://ppa.launchpad.net/inizan-yannick/mono/ubuntu trusty main

# Libreoffice stable
deb http://ppa.launchpad.net/libreoffice/ppa/ubuntu trusty main

# Thinkpad
deb http://ppa.launchpad.net/linrunner/thinkpad-extras/ubuntu trusty main 
deb http://ppa.launchpad.net/linrunner/tlp/ubuntu trusty main

# Simple Screen Recorder
deb http://ppa.launchpad.net/maarten-baert/simplescreenrecorder/ubuntu trusty main

# Multimedia, VLC, ffmpeg, libdvd ...
deb http://ppa.launchpad.net/mc3man/trusty-media/ubuntu trusty main

# Multisystem
deb http://liveusb.info/multisystem/depot all main 

# WebUpd8 nilarimogard: equalizer, audio-tools, multimedia
deb http://ppa.launchpad.net/nilarimogard/webupd8/ubuntu trusty main 

# Mac Mbuntu - Noobslab Themes
deb http://ppa.launchpad.net/noobslab/themes/ubuntu trusty main

# Opera
deb http://deb.opera.com/opera/ lenny non-free

# Kesselgulasch - gimp
deb http://ppa.launchpad.net/otto-kesselgulasch/gimp/ubuntu trusty main

# Owncloud
deb http://download.opensuse.org/repositories/isv:/ownCloud:/desktop/Ubuntu_14.04/ /

# Pipelight (Flash, Silverlight)
deb http://ppa.launchpad.net/pipelight/stable/ubuntu trusty main

# Darktable
deb http://ppa.launchpad.net/pmjdebruijn/darktable-release/ubuntu trusty main 

# RabbitVCS
deb http://ppa.launchpad.net/rabbitvcs/ppa/ubuntu trusty main

# Humanity Colors Theme
deb http://ppa.launchpad.net/ravefinity-project/ppa/ubuntu trusty main

# Satyajit Happy Themes
deb http://ppa.launchpad.net/satyajit-happy/themes/ubuntu trusty main

# Shutter
deb http://ppa.launchpad.net/shutter/ppa/ubuntu trusty main

# Skype
deb http://download.skype.com/linux/repos/debian/ stable non-free

# Handbrake Stable
deb http://ppa.launchpad.net/stebbins/handbrake-releases/ubuntu trusty main 

# Truecrypt und Indikator
deb http://ppa.launchpad.net/stefansundin/truecrypt/ubuntu trusty main 

# SVN
deb http://ppa.launchpad.net/svn/ppa/ubuntu trusty main

# Tuxboot
deb http://ppa.launchpad.net/thomas.tsai/ubuntu-tuxboot/ubuntu trusty main

# Equinox Theme
deb http://ppa.launchpad.net/tiheum/equinox/ubuntu trusty main

# Ubuntu-Tweak
deb http://ppa.launchpad.net/tualatrix/ppa/ubuntu trusty main

# WINE
deb http://ppa.launchpad.net/ubuntu-wine/ppa/ubuntu trusty main 

# VirtualBox
deb http://download.virtualbox.org/virtualbox/debian trusty contrib

# Java WebUpd8
deb http://ppa.launchpad.net/webupd8team/java/ubuntu trusty main

# Sublime Text 3 - WebUpd8
deb http://ppa.launchpad.net/webupd8team/sublime-text-3/ubuntu trusty main

# Tor Browser Projekt
deb http://ppa.launchpad.net/webupd8team/tor-browser/ubuntu trusty main

# Y-PPA Manager
deb http://ppa.launchpad.net/webupd8team/y-ppa-manager/ubuntu trusty main 

# X2Go Stable
deb http://ppa.launchpad.net/x2go/stable/ubuntu trusty mai
 
clean http://archive.ubuntu.com/ubuntu

Then you can create an apt-mirror-client list from this file:

cat mirror.list | grep -v ^# | grep -v  clean | grep -v set | grep -v '^$' | \
sed  's/ppa.launchpad.net/teneriffa/g' | sed  's/download.skype.com/teneriffa/g' | \
sed  's/download.virtualbox.org/teneriffa/g' |  sed  's/download.opensuse.org/teneriffa/g' | \
sed  's/deb.opera.com/teneriffa/g' | sed  's/dl.google.com/teneriffa/g' | \
sed  's/archive.ubuntu.com/teneriffa/g' | sed  's/extras.ubuntu.com/teneriffa/g' | \
sed  's/archive.canonical.com/teneriffa/g' | sed  's/www.openprinting.org/teneriffa/g'| \
sed  's/liveusb.info/teneriffa/g

and save it on your client ;-)

GPG

If you get an error about a missing key, do:

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys <###################>

where <###################> is the key which was given in the error.

Otherwise, if you have a keyfile, do:

wget -qO - http://source.url/to/the.key | sudo apt-key add -

Updaten / update

apt-get update

Suchen / search

apt-cache search irgendein_name

Pakete installieren / install packages

apt-get install (--reinstall) irgendein_paket

Force dpkg options

apt-get install -o DPkg::Options::=--force-confold --yes --force-yes --no-install-recommends YOUR_PACKAGE_WONT_INSTALL YOUR_PACKAGE

Pakete deinstallieren (VOLLSTÄNDIG) / uninstall packages

apt-get remove (--purge) irgendein_paket

Distribution auf den neuesten Stand bringen / Distribution update

apt-get upgrade
apt-get dist-upgrade

Schiefgelaufene Installation wiederholen / Redo an installation

apt-get -f install

Komplettes Desaster korrigieren / Desaster recovery

dpkg --reconfigure -a

Get all deb entries in all sources-list (for apt-mirror)

find /etc/apt -name "*.list" | grep -v mirror.list | awk '{system("cat " $0 " | grep -v deb-src | egrep ^deb")}'

Paketliste erstellen und zurückspielen

dpkg --get-selections > selections.list

Replay:

dpkg --set-selections < selections.list
apt-get dselect-upgrade

Clear the selections cache:

dpkg --clear-selections