• Willkommen im Linux Club - dem deutschsprachigen Supportforum für GNU/Linux. Registriere dich kostenlos, um alle Inhalte zu sehen und Fragen zu stellen.

[HOWTO] Installation von smart

oc2pus

Ultimate Guru
Dieses HowTo wird nun im wiki gepflegt. Bitte den aktuellen Stand dort nachschauen:

http://www.linux-club.de/faq/Installation_von_smart





[work in progress ....] [DRAFT...]
Changelog:
* 01.11.2005 gpg-check und cache Flags ergänzt, Verweis auf aptosmart-Script
* 02.11.2005 smart-0.40-10 korrigiert den smart.desktop Eintrag
* 03.11.2005 64bit Pakete ergänzt
* 24.11.2005 smart und smart-gui
* 17.12.2005 smart.desktop eingefügt
....
[work in progress ....] [DRAFT...]

From The Free On-line Dictionary of Computing:
Code:
smart
1. <programming> Said of a program that does the {Right Thing} in a wide variety of complicated circumstances. (...)
flehan.gif
flehan.gif
flehan.gif
flehan.gif
flehan.gif


smart ist ein Paket Manager, der mit allen möglichen Distributionsformaten zusammenarbeiten soll (APT, APT-RPM, YUM, URPMI, etc), und bietet eine "bessere" Paket-Verwaltung an. Smart enthält auch eine GUI.

Warum ist smart besser als apt/YUM/URPMI etc ?
hier die Antwort aus der FAQ:
Smart supports several repository formats, including those used by APT, YUM and URPMI.

Smart has an easily-extensible, clean architecture. It is written in Python with some C code in performance-critical areas.

Smart has the smartest algorithm of all package managers. It can handle inconsistent states, downgrade packages when necessary and do better dependency-checking. See the README for some situations where Smart outperforms APT's and YUM's dependency-checking systems.

Smart is able to handle broken systems: if you have unsatisfied dependencies, Smart won't force you to fix the problem unless it is absolutely necessary to perform the operation you are requesting. Of course, if you really want Smart to fix the problem, you could run smart fix or choose "Fix all problems" in the GUI.
Sehr interessant sind auch die case-studies von smart. Sie befinden sich leider nicht mehr auf der Homepage von smart. Aber in der mitgelieferten Dokumentation von smart in /usr/share/doc/packages/smart/README.html sind sie noch enthalten.

smart bietet nette Features
* es ist möglich lokale Verzeichnisse von RPMs einfach einzubinden !
* die DVD/CDs lassen sich sehr einfach in smart integrieren.
* das kernel-update Problem ist IMHO besser gelöst
Code:
"kernel" should be one of the packages marked with a "multi-version" tag. You can check this by running this:

$ smart flag --show multi-version
multi-version
    kernel
    kernel-doc
    kernel-smp

Or through Edit->Flags in the GUI, where you can also add your own multi-version packages. (or using smart flag --set multi-version <package> in the command line)

When you install a new kernel, Smart may display a dialog saying the new package "upgrades" your old packages. But unless those packages have as their icon they won't be removed. Installation of new multi-version packages does not imply the previous packages will be removed, even if they satisfy the requirements for an "upgrade" operation.
* smart unterstüzt mirrors
Code:
In the GUI, go to Edit->Mirrors, click "New" and set your Origin URL and Mirror URL. Most likely you will be using whatever it is that you used as Base URLs for your repositories as Origin URLs. You may add as many Mirror URLs to an Origin URL as you wish, and you shouldn't worry too much about slow mirrors and mirrors going out of date. Smart automatically handles bad/inefficient mirrors and avoids them in the future.
* Pakete aus unterschiedlichen Quellen können gewichtet werden
Code:
All channels are created equal. Smart will attempt to upgrade to the newest package. If you wish to override that, you may assign priorities to channels and packages. To configure your channel priorities, go to Edit->Channels, pick a channel, click "Properties" and set a value in "Priority". Or you can use the CLI equivalent:

# smart channel --set <mychannel> priority=10

Highest numbers imply higher priority.

If you want more granularity, you can define priorities for individual packages in individual channels. To do that, right-click the package and select "Priority". This setting overrides channel priorities. Also, on the CLI you can:

# smart priority --set <packagename> <mychannel> 10
# smart priority --set <otherpackage> <otherchannel> -- -20

As you can see, it's possible to use negative priorities, given that they should be preceded by '--' (two dashes), otherwise they will be interpreted as command line options. Negative priorities are no different than positive ones, they it's just a matter of taste to use them or not.

If you are familiar with packaging, think of Priorities as user-defined "epochs".

While priorities are powerful, they are also dangerous. A channel with higher priority will always have precedence over other channels, including your local package database. It is easy to get in a situation where your system has to downgrade packages because a remote, out-of-date channel has higher priority than your installed packages. If all you want to do is be sure that your vendor's packages are preferred over third-party packages, it may be easier and safer to lower the third-party channel to a priority below zero (zero being the default) rather than increasing other priorities.

(In fact, priorities are more complicated than this, and in some situations Smart may choose a package in a channel with a lower priority. Priorities influence the weight each possible transaction is given, so it does make a difference whether a priority is set to -1, -5 or -100. The exact way this works is, for now, undocumented.)
* smart kann gezielt das installieren von einzelnen Paketen verhindern
Code:
Right-click them in the GUI and choose "Lock this version" or "Lock all versions", as you wish. Or use smart flag --set lock <package>. Notice that you may lock even packages that are not currently installed. In this case, Smart will never install the locked package.

Smart unterstützt die folgenden Formate:
* RPM repositories
Code:
RPM System Database (locally installed packages)
APT repositories for .rpm
RPM-MD (used by YUM)
Red Carpet (used by Ximian/Novell)
RPM Header List (used by RedHat and Conectiva installation CDs, probably others)
RPM Directory (a directory with a bunch of RPMs in it, no indexing required)
URPMI (used by Mandriva)
* DEB repositories
Code:
DEB System Database (locally installed packages)
APT repositories for .deb
DEB Directory (a directory with a bunch of DEBs in it, no indexing required)
*Slackware
Code:
Slackware installed packages database
Slackware repositories
*Mirrors
Code:
up2date (used by RedHat/Fedora)
Conectiva-style mirror description formats

Installation von smart
Die neuesten smart Pakete für SuSE kann man hier finden: http://linux01.gwdg.de/~pbleser/rpm-navigation.php?cat=/System/smart
Bei manueller Installation sollte man die aktuellen gtk2 and python-gtk von hier verwenden: ftp://ftp.suse.com/pub/suse/i386/supplementary/GNOME
Die 64bit Versionen werden von suser-drcux erstellt und sind hier zu finden: http://ftp.gwdg.de/pub/linux/misc/suser-drcux/100/x86_64/

Ab der Version 0.40-12 ist smart in ZWEI Pakete aufgeteilt (smart und smart-gui)
Wer apt nutzt kann smart einfach mit "apt install smart smart-gui" installieren (Repository suser-guru bzw suser-drcux sollte aktiviert sein)

Nach erfolgreicher Installation sollte sich im KDE-Menu, unter System->Konfiguration->Smart ein Menü-Eintrag befinden um die GUI zu starten.
Achtung: In smart-Paketen <=0.40-9 ist ein kleiner Bug im Desktop File, der aber einfach behoben werden kann: in der Datei /usr/share/applications/smart.desktop folgendes anpassen:
Code:
Exec=kdesu -c "/usr/bin/smart --gui"
dann sollte der Menüeintrag funktionieren. Oder folgende smart.desktop verwenden:
Code:
[Desktop Entry]
X-SuSE-translate=true
Categories=System;PackageManager;System;
Encoding=UTF-8
MultipleArgs=false
Terminal=false
Icon=smart
Exec=smart --gui
Type=Application
StartupNotify=true
Name=Smart Package Manager
GenericName=Package Manager
Comment=Install packages from various sources
X-KDE-SubstituteUID=true
X-KDE-Username=root
X-SuSE-translate=true
==>In den aktuellen Versionen ist dieser "Bug" behoben. Thx to suser-guru.

Es gibt auch eine kleine Extension ksmarttray - ein Systray-Applet, das über ausstehende Updates informiert. Dieses Paket gibt es ebenfalls auf der oben genannten Downloadlink oder besser
Code:
smart install smart-ksmarttray

Um smart etwas zu beschleunigen sollte unbedingt python-psyco installiert werden.
Smart uses the Psyco JIT for Python, that aims to make apps run faster. It should improve Smart speed in most systems, and internal benchmarks proved that. But there's a documented problem: "Drawbacks: Psyco currently uses a lot of memory". There are some specific cases where the problem that makes Smart slow resides on the memory consumption, not the optimizations. Disabling it, could make smart run a little faster because it could avoid memory swapping. If want to try it, run smart -o psyco=0, and if you want to make it permanent, do smart config --set psyco=0.

Um die gpg-Prüfung zu aktivieren ist der folgende Befehl zu verwenden:
Code:
smart config --set rpm-check-signature=true

Per default löscht smart heruntergeladene und installierte Pakete aus dem Cache /var/lib/smart/packages. Diese Option kann deaktiviert werden mit
Code:
smart config --set remove-packages=false

Kurze Befehlsübersicht:
Code:
smart update entspricht apt-get update
Code:
smart install entspricht apt-get install <packetname>
Code:
smart upgrade entspricht apt-get upgrade
Code:
smart --gui startet die GUI für smart, ähnlich zu bedienen wie synaptic
Code:
smart remove deinstalliert Pakete
Code:
smart channel --help  weitere "Channels" zu smart hinzuzufügen, bitte die sehr ausführliche Hilfe lesen
Code:
smart channel --add /media/dvd  SuSE-DVD zu den channels hinzufügen

in /etc/smart/channels finden sich die Channel-Definitionen.
Eine einfache Variante um Channels hinzuzufügen:
a) kopiere eine vorhandene channel Datei
cp suser-guru-gwdg.channel suser-oc2pus-gwd.channel
b) editiere diese
Code:
[oc2pus-apt]
name = suser-oc2pus 3rd party package repository for SUSE Linux on ftp.gwdg.de
baseurl = http://ftp4.gwdg.de/pub/linux/suse/apt/SuSE/9.3-i386
type = apt-rpm
components = suser-oc2pus
c) einfügen des Channels in die Konfiguration
smart channel --add /etc/smart/channels/suser-oc2pus-gwd.channel
d) smart update

Wer apt schon im Einsatz hatte, kann sich das Leben weiter vereinfachen. Es gibt hier im Forum ein Script, welches aus einer apt sources.list die entsprechenden smart-Channel-Dateien erstellt. Das Script und eine kurze Dokumentation findet ihr hier: http://www.linux-club.de/viewtopic.php?t=45241

Smart FAQ: http://labix.org/smart/faq
Smart WIKI: http://de.susewiki.org/index.php?title=Smart

Diese Infos wurden zusammengestellt von der smartpm Homepage:
http://labix.org/smart
 
OP
oc2pus

oc2pus

Ultimate Guru
da es leider noch keine man-page für smart gibt, habe ich ein kleines script geschrieben um mir die Kommandosyntax von smart ausgeben zu lassen.

Code:
#!/bin/bash
if [ -e smart-cmd.txt ]; then
	rm -f smart-cmd.txt
fi

smart --help >> smart-cmd.txt
echo "----------------" >> smart-cmd.txt
echo "----------------" >> smart-cmd.txt

for i in update install reinstall upgrade remove check fix download \
	search query info stats \
	channel priority mirror flag; do
	smart  $i --help >> smart-cmd.txt
	echo "----------------" >> smart-cmd.txt
	echo "----------------" >> smart-cmd.txt
done
diesen Code-Schnipsel speichern als mySmart-cmd.sh und mit chmod +x mySmart-cmd.sh ausführbar machen.

In der Datei smart-cmd.txt steht dann die Hilfe zu allen Befehlen.

Mit einem geeigneten Programm (z.Bsp. txt2man: http://mvertes.free.fr/) kann man sich dann aus dieser Text-Datei eine eigene man-page erstellen.
 
OP
oc2pus

oc2pus

Ultimate Guru
hochschieb Edit 17.12.2005
Beispiel für smart-desktop aus neuestem suser-guru Paket eingefügt (gilt für smart-Versionen <= 0.40-9)
 
Oben