Home Wiki > Conceitos
Sign up | Login

(Redireccionado de Concepts)

Conceitos

tagline: Da openSUSE


Este artigo apresenta alguns conceitos básicos do openSUSE e algumas referências básicas sobre aplicativos. Esta direcionado a novos usuários Linux que estejam utilizando a distribuição openSUSE.

Conceitos básicos do openSUSE

Este artigo apresenta alguns conceitos básicos do openSUSE e algumas referências básicas sobre aplicativos. Esta direcionado a novos usuários Linux que estejam utilizando a distribuição openSUSE. Ested artigo considera, outrossim, que o novo usuário Linux já tem alguma experiência com computador.

Primeiras coisas a fazer com o novo openSUSE

Geralmente, a primeira coisa que um novo usuário do openSUSE deseja fazer é começar a trabalhar em algum de seus projetos preferidos, tão logo o seu openSUSE esteja instalado. Mas antes que o faça, é útil aprender algo básico, sobre como o Linux trabalha, para evitar o deperdício de tempo mais tarde. O Linux trabalha de uma forma diferente a dos Sistemas Operacionais do MacOS ou do MS-Windows System, e para não desperdiçar tempo, estas diferenças devem ser entendidas.

Existem duas diferenças principais

A mais imediata diferença é a interface de usuário:
A Interface Gráfica de Usuário (GUI), no openSUSE, é levemente diferente da interface do Windows ou MacOS, mas as diferenças são, em grande parte, cosméticos. O Ambiente de Interface Gráfica K (KDE) (em oposição a GNOME, um ambiente de interface gráfica alternativo) é especialmente semelhante a outras interfaces de usuário: a maioria dos princípios são os mesmos, as janelas são janelas e têm uma moldura e uma barra de título, a janela de configurações de botão à esquerda na barra de título, e o botões minimizar, maximizar e fechar do lado direito da barra de título. Essa configuração padrão pode ser facilmente alterada se o usuário decidir usar um tema diferente, mas os padrões são projetados para permitir aos novos usuários se sentirem em casa no Linux.

O segundo tipo são as diferenças sob o capô:
Estas são grandes. Uma das primeiras diferenças que qualquer novo usuário vai encontrar muito rápido é que os programas desenvolvidos para o Windows precisam de uma camada de emulação especial previstas pelo programa Wine (Windows Emulador) que trabalha para muitos, mas nem todos os programas do Windows. Em seguida é que rodar o Linux como administrador (tradicionalmente chamado root) não é sábio e é fortemente desencorajada. A arquitetura do sistema de arquivos em Linux é também signficativamente diferente do Windows e MacOS. Outra diferença importante é a maneira pela qual o software é instalado e é mantido, também significativamente diferente do Windows e do MacOS. A lista é grande e será explicada mais detalhadamente mais tarde, mas estes quatro exemplos salientam que usuários avançados (que não usavam o Linux) terão de ajustar seus hábitos de operação do computador para o do Linux. Por que usuários avançados apenas? Simples, tentarão aproximar-se das opções equivalentes de configuração àquelas do Windows, sob a superfície Linux, e eles encontrarão diferenças entre o Windows e o Linux. Usuários avançados, frequentemente, necessitam escavar 'sob o capô' para entender e ou configurar detalhes avançados quando usam um computador e com o Linux não é diferente, na medida em que tal compreensão e configuração também é necessária.

Software Livre e Software de Código Aberto

O Linux tem sido desenvolvido sob os conceitos do Software Livre e do Software de Código Aberto (FOSS). Quando o termo "free" (livre) é usado, não significa "free" (grátis) como em "free beer" (cerveja grátis). Ao inés disto significa "free" (livre) no sentido de que:

  • se é "livre para copiá-lo",
  • se é "livre para acessar o código fonte",
  • se é "livre para modificar o código de acordo com as necessidades próprias",
  • se é "livre para distribuir a versão original", e
  • se é "livre para redistribuir a versão modificada".

Leia mais sobre isto Software Livre e de Código Aberto.

Assim, por que o Software Livre e de Código Aberto é importante para o novo usuário de Linux? É importante porque conduz a um nível filosófico do como o Linux, e quase todos os softwares Linux são estruturados (i.e., como são desenvolvidos, enpacotados, distribuídos, instalados e mantidos).

Kernel Linux & Projeto GNU

Kernel é o núcleo de baixo nível do sistema que precisa interagir com o hardware. O kernel Linux livre foi originalmente criado por Linus Torvalds em 1991. Na época, o projeto GNU tinha criado muitos dos componentes necessários para um sistema operacional livre, mas o seu próprio Kernel estava incompleto e indisponível. Assim, usando o software do Projeto GNU e o Kernel Linux, a base para sistemas operacionais como o openSUSE foi criada.

Distribuições

Como mencionado acima o Linux é somente o kernel do sistema operacional. O Sistema Operacional completo é chamada uma Distribuição GNU/Linux. Constituída de muitos mais software do que apenas o kernel. Por exemplo, você poderia estar usando o Ambiente de Interface Gráfica K (KDE) como sua interface gráfica de usuário, isto não é o "Linux". Esta construção modular é o que permite uma grande variedade de distribuições Linux. Vindo de certos sistemas operacionais, pode ser um pouco difícil de se acostumar com a ideia de que nem tudo no sistema operacional é simplesmente Linux ou Windows, mas sim uma combinação de muitos, muitos projetos mais ou menos desenvolvida de forma independente (chamado: upstream). Quando houver problema é muito útil para entender qual parte está com o problema.

Claro isto é legal e praticamente possibilita aos distribuidores (por exemplo, a Novell ou a Red Hat ou o Ubuntu) produzirem as distribuições Linux somente porque o software está coberto pelas liberdades de software acima mencionadas. Que permite aos distribuidores modificar, empacotar e redistribuir o software.


Manipulação de Software (gestão de pacotes)

No openSUSE, existem dois tipos de pacotes de software principalmente usados:

  • O Tarball (tape archiver) e o
  • RPM (RPM Package Manager).

Algumas observações sobre ambos:

Tarball

The tarball is a bundled/compressed file. Tarballs contain the source code of the program and are mostly comprised of compilation scripts. In addition, a tarball often contains documentation with useful information, how to handle the package, often called "readme.txt" or "install.txt". Often the content of a tarball requires compilation. Common extensions of a tarball are "tar.gz", "tgz" or "tar.bz2". Linux beginners may wish to avoid installing software from tarballs, until after they obtain more experience. This is because tarball installations are not a one click install and tarball installations typically require average to advanced knowledge.

RPM

Updating software via RPM is the more common software installation method used by the average openSUSE user. RPM stands for RPM Package Manager, and was originally developed by Red Hat. This tool installs, updates, uninstalls, verifies and queries software packaged in this format, and also for the files, made by that tool (RPMs).

Why is RPM useful?

In many cases a software developer will create a tarball of his software. The use of a tarball is such that the average to advanced Linux user can compile the content to get the files to the right directories. This is not always as easy as it sounds, it can be tricky and at times intense for a Linux beginner. For that reason RPM was created. An RPM can be installed by a beginner with a single command, in difference to the content of a tarball, which needs more than one command to get installed (often requiring advanced Linux and application specific knowledge).

Further RPM aspects:

Creating RPMs is not that easy, often it needs advanced knowledge in handling source code and source code files. For that reason capable packagers adopted that job and offer their packages of software applications to the community.

An RPM is often built for a specific version of the distribution, e.g. for SUSE Linux 9.3, 10.0, 10.1, openSUSE 10.2, 10.3, 11.0, 11.1 etc. An RPM created for SUSE Linux 9.3 may or may not run on openSUSE 11.1 without fail, because software dependencies between SUSE versions can change.

Linux programs or libraries are often built on previous coded software. The reason is the programmer wants to save development time and because the programmer is re-using legally free open source software coded by others. Using previously coded software can mean there are interdependencies (and other ramifications) between the the software versions. These interdependencies\ramifications can be large, such that software A needs software B, software B needs software C and so on. Finally the application must run; that's why these interdependencies\ramifications needs to be checked, and when the checks fail, thats when there can be dependency problems when installing software.

Software package managers (SPMs)

As said, installing Linux software (RPMs) can lead to a dependency problem. To solve such problems, SPMs were created, they handle the installation and they look after the interdependencies. If needed, the SPM will get software from CDs, DVDs, file servers, etc.

To get a SPM communicating with an Internet file server, the file server link needs to be added to the SPM. These file servers are referred to as channels or repositories. The SPM can be used with or without GUI.

Such programs are e.g. Smart, YUM, and indeed YaST and Zypper, the default openSUSE tools. Further informations:


Repositories of 3rd party packaged software:

Beside the official repositories there are 3rd party repositories, which contain improved or special versions of RPMs or RPMs with quite new or unknown packages. The most popular 3rd party SUSE Linux\openSUSE repository is Packman. If you want to add one of these repositories, look here for a guide.

The openSUSE Build Service has also contributed to there being more 3rd party repositories and more packaged applications available for openSUSE users. However care should be exercised in adding 3rd party repositories to one's SPM as the 3rd party repositories are not always compatible with each other, and the packages on 3rd party repositories often have had only very limited testing.


Multimedia on openSUSE

Reference multimedia - openSUSE out of the box comes very limited for even some very basic multimedia functions (such as playing the proprietary mp3 format with any package other than RealPlayer) due to licensing reasons. Hence a new openSUSE user, who wishes to play mp3 format audio files, play avi video files with various codecs, play commercial video dvds, etc .... will need to go to 3rd party packaged repositories of applications, and install versions of these software applications, packaged by various openSUSE rpm packagers (where those software programs packaged by the packagers, work better than the Novell/SuSE versions).

A site that has some guidance on an open source approach to this is the opensuse-community site here: http://opensuse-community.org

Starting in openSUSE-10.3, to simplify the multimedia installation experience, a "one-click" multimedia upgrade method was implemented, semi-automating the upgrade of the multimedia for new open SUSE users.

openSUSE-One-Click-Multimedia-Install: http://opensuse-community.org/Multimedia

New users should be careful when using the one click install not to leave additional repositories enabled if they do not understand the implications of doing so. Also, if one wishes more control over the installation, then the traditional method of adding a repository to one's SPM works well. There is guidance here describing how to do that: http://opensuse-community.org/Repositories


Sound

The sound drivers for openSUSE are typically provided by the alsa family of rpm packages that are installed by default in openSUSE Linux. In most cases the sound configuration should be automatic upon booting. A general theoretical overview of sound on openSUSE is described in Sound-concepts. A basic guide for helping one trouble shoot their openSUSE Linux PC to get audio working is the openSUSE Audio Troubleshooting Guide Detailed help for setting up one's sound can also be obtained via IRC chat on freenode IRC channel #suse and also be posting for help on openSUSE forums: http://forums.opensuse.org/



Linux shell / command line interface

The shell is a Command-Line Interface (CLI), much like MS-DOS was (and the Command Prompt in WinXP is), but with the full power of Linux multitasking available. Dependent on how the shell is entered, it may be full screen, or it may be in a window under a Window Manager. Most common is the bash (Bourne-again shell), where bash is a Unix shell written for the GNU Project. Bash is the default shell on most Linux systems, as well as on Mac OS X and it can be run on most Unix-like operating systems. In the case of openSUSE, a bash shell can typically be used by starting the program konsole (<ALT><F2> and type "konsole") or by starting xterm (<ALT><F2> and "xterm"). A Linux shell is used when interfacing with the lower Linux boot levels (such as run levels 1 to 3) wikipedia:Runlevel . Applications can be started from a shell, which can also be very useful a number of reasons, such as for debugging problems.

The following picture shows simplified version of information and command flow when one user interacts with the computer running Linux.

Flow1.jpg


External links (shell/CLI)



X window – basic concepts

Often a new Linux 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 the user 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. In such a case an openSUSE Linux user is then typically running their PC in what is referred to as run level 5. (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. Four of the more popular desktops available 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. This is very useful for remote support/access not only on a LAN, but also across the Internet.



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.

Alternatively to setting up Samba, files can also be transfered from the Linux PC to the MS-Windows PC, in KDE using smb (Server Message Block) supported by KDE (applications Konqueror and Dolphin), by Gnome (application Nautilus), by LXDE (application PCManFM), 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" into the User Interface 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.

Linux remote desktop

There are various ways to do have a remote desktop using Linux. One way is to use Virtual Network Computing (vnc) to remotely access a Linux PC from either another Linux PC, or from an MS-Windows PC. vnc transmits the keyboard and mouse events from one computer to another relaying the graphical display updates back in the other direction, over a network. One Linux application that provides this capability is "x11vnc". A remote desktop can be done using a local LAN, or across the Internet. In the case of using an "MS-windows" PC to access a Linux pc's Xwindow desktop, there are many client applications, some of which are free. The vnc wikipedia link below lists many of the MS-Windows packages.

These applications for remote access/control are very useful for providing remote support, maintenance, and training.



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:

For example, for the MS-Windows user who is new to Linux, this will mean they will not see their PC's C: nor D: drive as such, even if they are still present when booting Linux in a dual boot (Linux/Windows) configuration. Instead the C: and D: drives may appear in openSUSE Linux as /windows/C or as /windows/D (or in a conceptually similar nominclature per the Filesystem Hierarchy Standard).


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.

Hardware drivers under Linux

Drivers in Linux are often implemented as "kernel modules" which may be loaded during Linux boot, or may be dynamically loaded and unloaded during a Linux session. Many drivers/modules are provided as part of the kernel packaging, and others have to be provided separately. Typically openSUSE does not come with proprietary hardware drivers, and hence such proprietary drivers need to be provided by the manufacturer or by other 3rd party. Instead, openSUSE is typically packaged with openSource free software drivers that work with most hardware.

Some links providing more detail on setting up some different graphic drivers with openSUSE are:

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 (and later openSUSE version) 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, starting from openSUSE-10.3 to the current openSUSE version, the EIDE/IDE hard drives may be referred to as sdx, as opposed to hdx.

More detail on this is contained here: SDB:Basics_of_partitions,_filesystems,_mount_points


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.

Some super user definitions are:



Printing under Linux

Portal:Printing

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.

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.


External links

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