Rozwiązania

Skocz do: nawigacja, szukaj
32px-Icon-cleanup.png Ten artykuł wymaga uporządkowania ponieważ nie spełnia standardów jakości wiki.
Jeśli chcesz go edytować pamiętaj o trzymaniu się zasad tego wiki a jeśli masz pytania, nie wahaj się skontaktować z zespołem wiki, jesteśmy gotowi Ci pomóc! :-)

Podstawowe rozwiązania Linuksa openSUSE


Artykuł ten prezentuje kilka podstawowych rozwiązań openSUSE i prezentuje kilka podstawowych aplikacji. Jest on przeznaczony dla nowych użytkowników Linuksa openSUSE. Załorzenie tego artykułu jest, że nowy użytkownik Linuksa ma podstawowe doświadczenie obsługi komputera.


Pierwsze Rzeczy, Które Powinien Zrobić Nowy Użytkownik openSUSE

Przed rozpoczęciem pracy w openSUSE dobrze jest zapoznać się z zasadą pracy Linuksa, co może wyeliminować problemy związane z pracą w Linuksie. Powodem potencjalnych problemów może być różnica w pracy Linuksa w porównaniu z MacOS czy MS Windows. Aby je wyeliminować należy zrozumieć jego specyfikę.

Są dwie podstawowe różnice.
Pierwszą jest powłoka, do której dostęp ma każdy użytkownik.
Graficzny Interfejs Użytkownika (GIU z ang. GUI) jest czymś innym. Mimo że większość użytkowników nie widzi wielu różnic w pracy GUI, w szczególności użytkownicy K Desktop Environment (KDE) . Podstawowe rzeczy są takie same, ale dokonywanie zmian wyglądu GUI może spowodować trochę zamieszania.

Drugą jest różnica pod maską
Różnica jest znacząca. Po pierwsze nowy użytkownik szybko zorientuje się, że programy tworzone dla Windows potrzebują emulator, jak np.: Wine (Windows Emulator), na którym można uruchomić większość programów windowsowych. Po drugie praca na Linuksie jako administrator (zwanym root) nie jest mądrym rozwiązaniem. Lista różnic jest długa, ale te dwa przykłady powinny zwrócić uwagę bardziej doświadczonym użytkownikom na fakt, że muszą dostosować swoje nawyki do specyfiki Linuksa. Dlaczego bardziej doświadczeni? Ponieważ będą oni używać pliki konfiguracyjne z poziomu powłoki i rozumiejąc je, zauważą że każdy system na bazie Linuksa jest taki sam.

Wolne oprogramowanie


Linuks jest rozwijany na podstawie idei "Wolne oprogramowanie". Gdu w tekście użyty jest zwrot "wolne" oznacza on:

  • można kopiować,
  • użytkownik ma dostęp do kodu źródłowego,
  • użytkownik może dowolnie modyfikować kod,
  • użytkownik może rozpowszechniać wersję oryginalną,
  • użytkownik może rozpowszechniać swoją zmodyfikowaną wersję.

Więcej możesz przeczytać w here

Dlaczego wolne (darmowe) oprogramowanie jest ważne dla nowego użytkownika Linuksa? To jest ważne, ponieważ prowadzi to do poznania filozofii struktury Linuksa i prawie całego jego oprogramowania.

Jądro Linuksa i Projekt GNU

Jądro jest bazowym oprogramowaniem, które współpracuje ze sprzętem. Wolne jądro Linuksa zostało stworzone przez Linusa Torvaldsa w 1991 roku. W tym czasie projekt GNU stworzył wiele z wymaganych komponentów dla wolnego oprogramowania systemu operacyjnego, ale własne jądro było niekompletne i niedostępne. Od tej chwili użycie oprogramowania projektu GNU i jądra Linuksa tworzy bazę pod system operacyjny taki jak np. openSUSE.

Dystrybucje


Jak to było wspomniane wcześniej, Linuks to jądro systemu operacyjnego. Cały system operacyjny jest zwany dystrybucją GNU/Linuksa. Tak więc dystrybucja Linuksa to jądro systemu operacyjnego oraz oprogramowanie (np. Graficzne Interfejs Użytkownika KDE). Poznanie różnicy pomiędzy Linuksem, a dystrybucją Linuksa jest pomocne w rozwiązywaniu problemów.

Tak więc, korzystając z idei "wolnego" oprogramowania (możliwości modyfikacji i dystrybucji oprogramowania) twórcy (np. Novell) tworzą własne dystrybucje Linuksa.

Software handling in openSUSE (Package Management)


W openSUSE występują dwa podstawowe rodzaje pakietów:

  • Tarball (spakowane archiwum) i
  • RPM (Manager Pakietów RedHat).

Kilka informacji na ich temat:

Tarball

Tarball jest skompresowanym plikiem. Tarball zawiera kod źródłowy programu i skrypty do jego kompilacji. A czasami tarball zawiera też dokumentację z pomocnymi informacjami odnośnie obsługi pakietu, najczęściej jest to plik "readme.txt" or "install.txt". Bardzo często tarbll wymaga kompilacji. Najczęściej używanymi rozszerzeniami tarbll są: "tar.gz", "tgz" lub "tar.bz2".

RPM

Uaktualnianie oprogramowania za pomocą RPM jest popularną metodą instalacji oprogramowania używaną przez użytkowników openSUSE. RPM jest narzędziem, które instaluje, uaktualnia, usuwa i weryfikuje oprogramowanie spakowane w tym formacie i oczywiście pliki stworzone przez to narzędzie (RPMy).

Dlaczego RPM jest użyteczny?

W wielu przypadkach twórca oprogramowania będzie tworzył tarball dla swojego oprogramowania. Używając tarball użytkownik może kompilować jego zawartość, aby umieścić pliki w odpowiednich folderach. Jednak czasami nie jest to takie proste, co może spowodować problemy dla początkującego w Linuksie. To jest właśnie powód, dlaczego stworzono RPM. RPM może być zainstalowany za pomocą prostej komendy w przeciwieństwie do tarball, które wymaga więcej niż jedną komendę do instalacji.

Inne aspekty RPM:

Utworzenie RPM nie jest takie proste ponieważ często wymaga zaawansowanej wiedzy w obsłudze kodu źródłowego i plików z kodem źródłowym. Z tego powodu zdolni twórcy pakietów oferują swoje pakiety społeczności.

RPM jest często tworzone dla specyficznej wersji danej dystrybucji, np. dla openSUSE Linux 9.3, 10.0, 10.1, 11.0, etc. RPM tworzony dla openSUSE 9.3 może pracować lub nie pracować pod openSUSE 11.0 z powodu zależności pomiędzy wersjami openSUSE (wersje mogą się różnić rozwiązaniami).

Programy i biblioteki linuksowe często są tworzone na bazie wcześniej stworzonego kodu źródłowego oprogramowania. Powodem jest oszczędzanie czasu przy tworzeniu oprogramowania przez programistów. Te współzależności mogą doprowadzić do sytuacji, że oprogramowanie A wymaga oprogramowania B, oprogramowanie B wymaga oprogramowania C, itd. Ostatecznie aby aplikacja mogła działać współzależności muszą byś sprawdzone i jeżeli wystąpi błąd, znaczy to że współzależności nie zostały spełnione w czasie instalacji oprogramowania.


Menagery Pakietów Oprogramowania (MPOsy)

Jak to było wspomniane wcześniej, w czasie instalowania oprogramowania (RPMów) w Linuksie może spowodować problemy ze współzależnościami. Aby rozwiązać takie problemy stworzono MPOsy, które zajmują się procesem instalacji. Jeżeli wystąpi problem współzależności MPOsy rozwiążą go za pomocą odszukania i zainstalowania współzależnego oprogramowania korzystając z dostępnych źródeł (repositoriów, płyt źródłowych, itp.).

Przykładem MPO jest: YaST/Zypper stworzony przez SUSE.

Więcej informacji:


Nieoficjalne repozytoria pakietów oprogramowania:

Zarówno jak oficjalne znaleźć można także nieoficjalne repozytoria, które mogą zawierać poprawione lub specjalne wersje RPMów, bądź nowe lub nieznane RPMy. Najbardziej popularnym nieoficjalnym SUSE Linux\openSUSE repozytorium jest Packman, które zawiera pakiety samodzielnie stworzone przez Guru tuż przez powstaniem openSUSE 10.3. Jeśli chcesz dodać jedno z tych repozytoriów zajrzyj tutaj aby otrzymać pomoc.

Multimedia w openSUSE


Multimedia - świeża instalacja openSUSE jest bardzo ograniczona nawet jeśli chodzi o najbardziej podstawowe funkcje multimedialne (jak na przykład odtwarzanie własnościowego formatu mp3 za pomocą jakiegokolwiek pakietu innego niż RealPlayer) z powodów licencyjnych. Dlatego też każdy nowy użytkownik openSUSE, jeśli zechce odtwarzać pliki audio w formacie mp3, avi skompresowane różnymi kodekami, komercyjne DVD, etc... będzie musiał skorzystać z repozytoriów oprogramowania należących do innych podmiotów, i zainstalować wersję potrzebnej aplikacji, przygotowaną przez różnych "twórców pakietów rpm openSUSE" (tam, gdzie owe aplikacje przygotowane przez twórców niezależnych działają lepiej niż wersje Novell/SuSe).

Stroną, która wyjaśnia co nieco podejście open source jest witryna społeczności opensuse: http://opensuse-community.org

Począwszy od wersji openSUSE-10.3, aby uprościć proces instalowania wsparcia dla multimediów, zaimplementowano prostą, "jednokliknięciową" metodę upgrade'u systemu, pół-automatyzującą całe zadanie dla nowych użytkowników openSUSE.

OpenSUSE-10.3 oraz 11.0 One-Click-Multimedia-Install: http://opensuse-community.org/Multimedia

Dźwięk

Sterowniki dźwięku dla openSUSE są typowymi pakietami RPM tworzonymi dla ALSA. Opis teorii dźwięku w openSUSE jest opisany w Koncepcja dźwięku. Poradnik odnośnie rozwiązywania problemów z dźwiękiem jest opisany w openSUSE Audio poradnik rozwiązywania problemów.

Linux shell / Interfejs linii poleceń


Shell (powłoka) to interfejs Linii-Poleceń, podobny do MS-DOS kiedyś (a linii poleceń w WinXP dzisiaj), lecz wsparty całą potęgą linuksowej wielozadaniowości. W zależności od sposobu wywołania, shell możemy mieć na pełnym ekranie, lub jako okienko w Menedżerze Okien. Najczęściej spotykanym jest "bash shell" - bash to nic innego jak powłoka systemowa napisana na system UNIX dla projektu GNU. Bash jest domyślną powłoką na większości systemów linuksowych, jak również w Mac OS X oraz z powodzeniem funkcjonuje na większości systemów uniksopodobnych. W przypadku openSUSE, powłokę bash można najprościej uruchomić klikając "konsole" w menu poleceń, poprzez jednoczesne naciśnięcie <ALT><F2> (uruchom) i wpisanie "konsole", lub przez uruchomienie "xterm". Linia poleceń jest przydatna w Linuksie podczas interakcji z niższymi warstwami systemu. (runlevel 1 - 3). Poza tym, w konsoli można też uruchamiać aplikacje, co bywa przydatne z różnych przyczyn - na przykład dla debugowania problemów.


Poniższy obrazek pokazuje uproszczoną wersję przepływu komend i informacji, gdy jeden użytkownik pracuje z komputerem pod kontrolą Linuksa.

Plik:Flow1.jpg




X window – basic concepts


Often a newbie user will read references to X window. X window (commonly known as X11 or X) provides Linux PCs a graphical environment, in which different graphical desktops can run (giving a graphical appearance that is typical of the OS of modern computers, such as seen in the Mac, or in MS-Windows). Without X window one would only have a simple ascii prompt/shell type environment on their Linux PC (with no graphics). In Linux X window, to obtain a user friendly Graphical User Environment (GUI), on top of X window runs a Window Manager, or a Desktop Environment. (Note in a Mac and in MS-Windows, there is typically no such clear distinction between the ascii shell, and the upper level graphical environment, and hence Mac/MS-Windows have only one GUI, while a Linux user can choose from many). More detail on this can be found on this Window Manager and Desktop Environment wiki: Window managers and desktop environments. Three of the more popular desktops for openSUSE are

There are also many other desktops available for openSUSE, with more information here on the openSUSE implemented Graphical user interface (GUI); see GUI One can also find more on X window here:

X window aspects

X window is very powerful, in that its architecture is deliberately structured, with separate "client" and "server" aspects. For a one PC user, both the "client" and the "server" run on the same PC (and hence the this client/server division is transparent). But X window is designed such that the "client" and "server" can be run on different machines. Hence, for example, with X11 and the Secure Shell (ssh) program (see below), an X window application can run on a remote Linux PC, but with the graphics window of the same application being displayed locally on a "local" Linux PC.

Networking With Linux


Linux PC networking with MS-Windows PCs

MS-Windows/Linux file/printer sharing

For file and printer sharing between an MS-Windows and a Linux PC, most Linux users use an application known as "samba", that runs on the Linux machine.

With Samba running, the Windows-to-Linux networking (with there being a Linux PC in the Local Area Net (LAN)) is mostly transparent to the MS-Windows PC user. Thus files and printers can be shared transparently, using standard file/print managers.

Files can also be transfered from the Linux PC to the MS-Windows PC, using KDE & smb (Server Message Block) supported by KDE application Konqueror, and from the MS-Windows PC to Linux PC, using Secure Copy (scp) or Secure FTP (sftp) via packages such as the WINscp freeware software. In openSUSE, scp is not as seamlessly "integrated" as nfs nor as samba.

One can also share printers between Linux and Windows PCs using CUPS and/or IPP.

Linux-PC to another Linux-PC sharing

Linux/Linux file sharing

For file sharing between Linux PCs, most Linux users use an application known as Network File System (NFS), that enables file sharing (including remote directory/drive mounting, such that remote drives are treated as local), etc ...

Instead of using NFS, one can also transfer files using ssh (via the “scp” mentioned above). One ssh network file transfer implementation is “FIles transferred over SHell” (known as “fish”), which can be used to transfer files from Linux PC to Linux PC. KDE's Konqueror File Manager and Gnome's Nautilus and also Midnight Commander file manager, support “fish” network file transfers using a user friendly GUI.

And as noted previous, SFTP (SSH File Transfer Protocol) can be used for transfering files from Linux PC to Linux PC. KDE's Konqueror File Manager and Gnome's Nautilus support “SFTP” network file transfers using a user friendly GUI.

Linux remote Command Shell

With Linux, a remote PC's konsole/shell can be opened on a local PC and thus remote command line applications can be controlled locally. This is possible by using applications such as telnet or ssh. ssh provides more secure data transfers than telnet and is typically preferred.

Zdalny pulpit Linux

Jest kilka dróg do uzyskania zdalnego pulpitu. Jedną z nich jest użycie Virtual Network Computing (vnc) aby uzyskać zdalny dostęp do komputera, z Linuxa bądź Windowsa. Vnc przesyła zdarzenia klawiatury i myszy z jednego do drugiego komputera przekazując graficzne uaktualnienia w drugą stronę, z pomocą sieci.

Jedna z aplikacji dającą taką możliwość jest "x11vnc". Zdalny pulpit może być realizowany za pomocą lokalnej sieci LAN albo po przez Internet. W przypadku używania komputera z Windows do połączenia z pulpitem Xwindow jest wiele klientów, wiele darmowych. Poniższe strony wikipedii prowadzą do wielu klientów na platformę Windows.

Linux Directory Structure


The Linux Directory Structure (also known as the Filesystem Hierarchy Standard): In Linux, the files are stored in a directory structure that is significantly different from MS-Windows. Everything in Linux starts from the root directory (represented by / ) and it then expands into sub-directories, instead of having “drives”, as in MS-Windows. Linux sorts directories descending from the root directory / , theoretically according to their importance to the boot process. Typically, upon boot, the system does not know of the existence of different partitions or devices. Instead, different hard drives, and different partitions, are mounted seamlessly into the Linux directory structure, such that they are completely transparent to the user. This is known as the Unified Filesystem. More detail can be found here:

Hardware under Linux


Support for hardware under openSUSE varies. Some manufacturers provide drivers for their hardware, some do not. In many cases free-software enthusiasts have created Linux drivers for hardware. Because some manufacturers have proprietary (and not free) drivers for their hardware, an "out of the box openSUSE" may, or may not, initially include those drivers, and hence may not have initial support for all hardware. One may need to spend some time setting up their hardware. And one may not have to. It simply depends. For example, one's graphics, audio, wifi may work immediately. It may not work. Typically a Linux beginner needs to give their graphics, Internet, and audio their top priorities in setting up their hardware.

If one is purchasing new hardware, it is often useful to check for Linux compatibility HCL prior to purchasing.

Hard Drives: Terminology, Partition Table


In Linux, hard drives are known by different names than what they are in MS-Windows. In openSUSE Linux (prior to openSUSE-10.3) an EIDE/IDE hard drive is known as “hd” and are alphabetized starting with “a” (ie hda, hdb, hdc ... etc ). A scsi/sata drive is typically known as “sd” and are also alphabetized starting with an “a” (ie sda, sdb, sdc ... etc). Various partitions are numbered, staring with the number 1 (ie hda1, hdb1, hdb2, hdb3, hdc1, sda1, sda2). A floppy disk will be known as fd.

Commencing with openSUSE-10.3, through the use of the libata application, EIDE/IDE hard drives also share the sda, sdb ... etc naming convention.

The partitioning of the hard drives in Linux follows the PC standard and is not Linux-specific (that is, the partitioning is the same as in Windows). Every hard drive must have one partition table. There can be 0 - 4 entries in that table. Out of the maximum four entries, 0 - 4 can be primary partition descriptions, and 0 - 1 can be extended partition descriptions. The extended partition holds several logical partitions, its number can be from 1 to 4; the logical partition numbering begins with five. Here is how typically a hard drive is partitioned when there is one hard drive in the PC, used both for Windows and Linux:

Name Filesystem type Size Used for Mountpoint Notes
hda1 NTFS 32 GB Windows OS /windows/C Has been squeezed
hda2 NTFS 8 GB Windows Restore Do not mount Has been moved
hda3 - 80 GB Hold all Linux files - Extended part-n
hda5 ext3 12 GB Linux OS / Logical part-n
hda6 swap 1 GB Extension of RAM - Logical part-n
hda7 ext3 or reiserfs 67 GB Users' files /home Logical part-n


A more advanced version of partitioning (this time using the openSUSE-10.3 libata naming convention):

Name Filesystem type Size Used for Mountpoint Notes
sda1 NTFS 32 GB Windows OS /windows/C Has been squeezed
sda2 NTFS 8 GB Windows Restore Do not mount Has been moved
sda3 - 80 GB Hold all Linux files - Extended part-n
sda5 reiserfs 14 GB Linux OS / Logical part-n
sda6 reiserfs 5 GB User-installed programs /usr/local Logical part-n
sda7 swap 2 GB Swapping - Logical part-n
sda8 ext3 or reiserfs 20 GB Users' files /home Logical part-n
sda9 ext3 or reiserfs 35 GB Users' data /data Logical part-n
sda10 reiserfs 4 GB Encrypted data /enc (no mounting by default) Logical part-n

Again, as reflected above, under openSUSE-10.3 and 11.0 the EIDE/IDE hard drives may be referred to as sdx, as opposed to hdx.

Linux Security


Root / Regular Linux User

In Linux there is a “root” user (which is the administrator) and there are regular “users” (often called “user”). Linux users should always log in as a regular user, and type “su” or “sudo” to obtain root permissions only on an as-required-basis. Keeping root permissions, or indeed logging in as root user as a routine matter, creates a major security risk for the beginner (if their PC is connected to the Internet). It also creates a significant operating risk, in that it is relatively easy for experts and newbies alike, to trash their system when operating with root permissions. An example of such operation is, being su in directory / and having forgotten about that, to attempt to change ownerships of files to user with:

 chown -R sammy:users *


Some super user definitions are:

Printing under Linux


Philosophy of a common printing format

Linux uses a common print format to simplify the support for printing. The general concept of print format under Linux is for an application developer to code the application to print to only one format (the PostScript format), and to have a printer driver (to work with Linux) only have to accept that one format and modify it into a language that the printer accepts. This is very efficient, as it means the application developer only has one print format to support, and it means the printer manufacturer only has one print format to support when writing native code for a driver for Linux.

Hence under Linux, all printers are typically treated as PostScript printers, and the applications usually produce a PostScript output. If a printer does not understand PostScript by itself (which happens in the majority of cases) the Linux PostScript interpreter GhostScript/foomatic is used to translate the incoming PostScript into the printer's own language (PCL, ESC/P 2, ... or something proprietary) with the support of the printer driver.

There is a good theoretical background to printing (using postscript) under an Operating System such as Linux here: http://www.linuxprinting.org/kpfeifle/LinuxKongress2002/Tutorial/III.PostScript-and-PPDs/III.PostScript-and-PPDs.html

PPD Files/PostScript printers

There are many Linux applications which use PostScript Printer Definition (PPD) files to know about the capabilities of printers, so that their printing dialogs can make available all options which the printer and its driver provide and also show additional information about the printer. A PPD is just a text file which exactly describes (in a well-defined format) all supported features of a printer and contains the exact code that needs to be injected into the print jobs to invoke each desired feature. Print software programs can read PPDs, and know how to display the supported features in the printer driver's user interface shown on screen. If the user makes specific choices (like duplex, stapling) the program will know what specific code to inject into the print job and how to work with print device. In addition PPD files can also be used on Windows, Mac, or Line Printer Remote / Line Printer Daemon (LPR/LPD) clients to get access to the printer's capabilities and options.

For every PostScript printer the manufacturers typically provide a PPD file which contains all printer-specific information about the particular printer model. In turn the Linux printing system Common Unix Printing System (CUPS) and LPR/LPD support them natively, with all other printing systems they can be used with the help of a configurable printer filter (Foomatic). Foomatic is a piece of software that transforms PostScript data to the printer's native format, using the PPD as configuration. It needs a low level driver (specific to each printer) to generate the final code. Typically foomatic uses ghostscript in the background, using options according to the PPD file of the printer. CUPS also supports the Internet Printing Protocol or IPP, which defines a standard protocol for printing as well as managing print jobs, media size, resolution, and so forth.

openSUSE printing implementation:

Details on the openSUSE specific printing implementation can be found here:

LSB (Linux Standard Base) DDK (Driver Development Kit):

There is currently development work ongoing to provide distribution-independent driver packages for Linux, called the LSB (Linux Standard Base) DDK (Driver development kit). The intention here is to permit print manufacturers (or anyone else interested) to easily package their printer driver (or any other driver) to make it available as a distribution-independent binary package.

This way users can easily install drivers which their distribution does not ship or only in an outdated version. No compilers need to be installed and no knowledge about building from source is needed. The intention is that packages can easily be un-installed later.

In addition support is planned for fully automatic download of these drivers by printer setup tools. The intention is that as soon as printer setup tools pick up this functionality, printing will "just work" also for printers which are not supported by the distributions.

Additional References


  • Wikibook Linux For Newbies Guide: [1]
  • Wikpedia on Linux [2]