Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Add translated “basic-snap-usage” tutorial #505
Conversation
webteam-app
commented
Nov 28, 2017
|
User is not a collaborator of this repo. Please start demo manually. |
zyga
approved these changes
Nov 28, 2017
Thank you for translating this guide. I made some remarks (in English so that others can follow) and suggestions (in Polish). I'm not sure how many apply to the original rather than this translation but I focused on the text as presented here.
LGTM assuming those are sorted out.
| + | ||
| +: Switch language: PL | [EN](tutorial/basic-snap-usage) | ||
| + | ||
| +Witamy w świecie snapów! W tym poradniku opisane zostaną podstawy korzystania z pakietów [snap] na Twojej dystrybucji Linuxa oraz poznasz korzyści wynikające z ich działania. |
| +**Arch** | ||
| + | ||
| +```bash | ||
| +$ sudo pacman -S snapd |
zyga
Nov 28, 2017
This is actually confusing and wrong because the Arch maintainer has gone AWOL and we don't have a way to update the package. CC @bboozzoo who is both an Arch user, a snapd developer, a Canonical employee and a Polish speaker.
bboozzoo
Nov 29, 2017
•
Not sure how to work around this. Guess we could try reaching out to the maintainer once more. FWIW there's a snapd-git package in AUR. It's also mentioned in Archwiki Snapd page right here: https://wiki.archlinux.org/index.php/snapd
The user can install the package using one of the AUR helpers (pacaur, yaourt or other) or manually by downloading the package build files.
| +**Fedora** | ||
| + | ||
| +```bash | ||
| +$ sudo dnf copr enable zyga/snapcore |
zyga
Nov 28, 2017
This should be dropped, Fedora ships snapd in their normal repository. (Please also ensure this is dropped in the original)
| +# aktywuj usługę snapd: | ||
| +$ sudo systemctl enable --now snapd.service | ||
| + | ||
| +# wsparcie SELinux jest w fazie beta, obecnie: |
Conan-Kudo
Nov 29, 2017
Contributor
Yeah, this is not necessary at all, and hasn't been for a long time.
| +# wsparcie SELinux jest w fazie beta, obecnie: | ||
| +$ sudo setenforce 0 | ||
| + | ||
| +# aby zachować to ustawienie, edytuj plik /etc/selinux/config, dodaj ustawienia SELINUX=permissive i uruchom system ponownie. |
| +# aby zachować to ustawienie, edytuj plik /etc/selinux/config, dodaj ustawienia SELINUX=permissive i uruchom system ponownie. | ||
| +``` | ||
| + | ||
| +**Gentoo** |
zyga
Nov 28, 2017
Please remove gentoo. The overlay is not supported and there was no desire from the gentoo community to change that.
| +**openSuSE** | ||
| + | ||
| +```bash | ||
| +$ sudo zypper addrepo http://download.opensuse.org/repositories/system:/snappy/openSUSE_Leap_42.2/ snappy |
zyga
Nov 28, 2017
Actually this depends on the version of openSUSE you are using. (Leap or tumbleweed). Not sure what the perfect solution is here.
| +W wersji 16.04 LTS desktop wszystko powinno być domyślnie aktywne. Na 14.04, wykonaj instalację poleceniem: | ||
| + | ||
| +```bash | ||
| +$ sudo apt install snapd |
zyga
Nov 28, 2017
You have to ask the user to reboot after installing snapd because that will pull in a new kernel as a dependency.
| +Ponieważ wszystko jest gotowe, zainstalujmy pierwszego snapa! | ||
| + | ||
| +negative | ||
| +: Ważne: obecnie wyłączyliśmy SELinux na niektórych dystrybucjach, ponieważ nie dostarcza ono pełnej izolacji i bezpieczeństwa na tych platformach. Ciężko pracujemy, aby wszystkie dystrybucje Linuxa mogły czerpać z tych możliwości jak najszybciej. |
| +``` | ||
| + | ||
| +positive | ||
| +: Informacja: kiedy zainstalujesz pierwszego snapa, snapd pobierze postawowy podsystem snapa (który zawiera niewielką liczbę aplikacji o wadze do kilku megabajtów). W rezultacie, czas pobrania pierwszego snapa może być trochę dłuższy niż w przypadku kolejnych. |
zyga
Nov 28, 2017
I'd use precise language for referring to the core snap (or any base snap in general). Let's call this bazowy pakiet uruchomieniowy core. This package is around 87MB as of today. The rest in this paragraph is fine.
| +: Informacja: kiedy zainstalujesz pierwszego snapa, snapd pobierze postawowy podsystem snapa (który zawiera niewielką liczbę aplikacji o wadze do kilku megabajtów). W rezultacie, czas pobrania pierwszego snapa może być trochę dłuższy niż w przypadku kolejnych. | ||
| + | ||
| + | ||
| +Aby uruchomić pakiet, wprowadź hello w wiersz poleceń (jest to polecenie dostarczone przez snap `hello`: |
zyga
Nov 28, 2017
On some distributions you need to log-out and log-in to get $PATH changes that will allow you to run hello rather than snap run hello (snap is always in $PATH as it is installed in /usr/bin/snap while hello will be in either /snap/bin/hello or /var/lib/snapd/snap/bin/hello, depending on distribution used.
| +Hello, world! | ||
| +``` | ||
| + | ||
| +Oczywiście to tylko prosty przykład, który ma cechy wspólne dla wszystkich snapów, więc jest odizolowany i ma dostęp tylko do własnych danych. |
zyga
Nov 28, 2017
Please use two sentences:
Oczywiście to tylko prosty przykład, który ma cechy wspólne dla wszystkich snapów. Aplikacja hello jest odizolowana i ma dostęp tylko do danych snapa w którym się znajduje.
| +core 16.04.1 423 canonical - | ||
| +``` | ||
| + | ||
| +Zauważ, że pakiet `core` zawierający podstawowy podsystem również znajduje się na liście. Zawiera on również aktualna wersję snapd, dzięki czemu będzie on zawsze aktualny. |
zyga
Nov 28, 2017
Snapd can only keep itself up-to-date via the core snap on certain distributions. This list is altered over time, not sure how to best capture that.
| + | ||
| +### Snapy mogą dodawać więcej niż jedno polecenie | ||
| + | ||
| +Nasz pierwszy przykład był prosty i zawierał tylko jedno polecenie, ale zwykle pakiety snap zawierają więcej niż jedno polecenie (na przykład zestaw narzędzi umieszczony w jednym snapie). Wszystkie te polecenia należą do przestrzeni nazw o nazwie pakietu. Wykonaj następujące kroki, aby zobaczyć przykład tego w działaniu: |
| + | ||
| + | ||
| +positive | ||
| +: Informacja: pierwsze polecenie nie posiada przedrostka. To dlatego, że snapy mogą posiadać jedno domyślne polecenie. |
zyga
Nov 28, 2017
Let's highlight that this domyślne polecenie must be exactly the same as the name of the snap itself.
| + | ||
| +### Snap może również zawierać usługi | ||
| + | ||
| +Czym jest usługa? Jest to uruchomione na dłuższy czas (zwykle działające w tle) polecenie, które prawie zawsze ma na celu szybko odpowiadać na dane żądania. |
zyga
Nov 28, 2017
I think the part about responding to requests quickly can be dropped as it is not the primary reason why services exist and is not helping the user to understand what they are. It's better to focus on the aspects of running in the background with the rest of the system rather than being explicitly started by the user.
| +Czym jest usługa? Jest to uruchomione na dłuższy czas (zwykle działające w tle) polecenie, które prawie zawsze ma na celu szybko odpowiadać na dane żądania. | ||
| +Snapy mogą zawierać ogólnosystemowe usługi. Jeżeli zainstalujesz pakiet **shout** (webowy klient IRC), możesz wypróbować tą opcję w działaniu – po prostu przejdź do adresu [http://localhost:9000/] w przeglądarce, aby skorzystać z usługi. | ||
| + | ||
| +Usługi snapów są uruchamiane/zatrzymywane przy uruchamianiu/wyłączaniu systemu. Mogą zostać skonfigurowane, aby uruchamiały się na żądanie. |
zyga
Nov 28, 2017
The aspect of being able to configure services not to start automatically is something I'd leave out as that is not a part of the design of snapd. This may work or may change in the future as snaps gain more control over their services (CC @stolowski who also speaks Polish and is working on the service parts)
| +hello-world removed | ||
| +``` | ||
| + | ||
| +Łatwo i przejrzyście, nic po nim nie pozostało! Kod aplikacji, jej zależności i dane użytkownika są usuwane. Jeżeli snap zawiera usługę, zostanie ona wyłączona i usunięta. |
zyga
Nov 28, 2017
This is good but I would really strongly emphasize that user data belonging to that snap is automatically removed.
| +### Zmiana kanału zainstalowanej aplikacji | ||
| + | ||
| + | ||
| +```bash |
zyga
Nov 28, 2017
NOTE: we also have snap switch that just updates the channel that is being tracked but doesn't force a refresh. Not sure if that is something you want to document (or hint at).
| + | ||
| + | ||
| + | ||
| +[snap]: http://snapcraft.io/ |
m4sk1n
and others
added some commits
Nov 28, 2017
zyga
approved these changes
Nov 29, 2017
LGTM with one more comment, sorry for not noticing earlier.
| +sudo systemctl enable --now snapd.socket | ||
| +``` | ||
| + | ||
| +**Debian (tylko Sid)** |
caldav
approved these changes
Dec 4, 2017
Thanks all for this contribution. Good job @m4sk1n! The mentioned changes will be added to the original one.
| + | ||
| +```bash | ||
| +$ sudo dnf install snapd | ||
| +$ sudo ln -s /var/lib/snapd/snap /snap |
Conan-Kudo
Dec 4, 2017
Contributor
This is not required, and please don't suggest it as something people should do by default.
m4sk1n commentedNov 28, 2017
No description provided.