16 Aralık 2020 Çarşamba

snap komutu - Package Manager

Giriş
snap paketlerinin çıkış noktası .deb paketlerinin sadece tek bir Linux türevi ve sürümü için çalışması. Açıklaması şöyle
In Linux, packages are specifically built for a single version of a single distribution. With a lot of tweaking, it is possible to make one .deb package that runs on all Debian based systems, but this is complicated and limits developers.

If I create a deb package for Ubuntu 20.04, it will only work on that version. I also have to make a different package for 16.04, 18.04, 19.10 and so on. I already have to make four packages just for Ubuntu. I also need to make one for every Debian version, every Fedora version and every openSUSE version.

This means if I want to release a new version of my application, I have to create over 20 packages to cover the majority of Linux distributions, and that still won't cover every distro.
snap ile amaç snap paketleme sistemini kullanan her sistemde çalışacak tek bir paket yaratmak. 
Bu yüzden snap paketleri biraz daha büyük oluyor. Açıklaması şöyle
Difference between the packages

- APT packages are compiled and tested for a specific version of Ubuntu. During the lifetime of the Ubuntu version, the LibreOffice version will essentially remain the same. Only minor security updates are provided.

- snap versions, on the other hand, are containerized and thus will run in a range of Linux distributions without change. That is a significant advantage of the latter packaging version. That also makes it much more manageable to regularly update the package. Therefore, you will typically see that the snap is a newer version. A disadvantage is that snaps use more disk space and, currently, still are somewhat slower during initial startup.
Snap Alternatifleri
- "GNOME Software Center" kullanılabilir.
- "Ubuntu Software Center" kullanılabilir.
- Pip ve apt zaten diğer çok bilinen Package Manager'lar. Açıklaması burada.

Bu Nasıl Mümkün Oluyor?
debian paketleri bağımlı oldukları her dosyayı içermezler. snap paketleri ise yekpare bir pakettir. İhtiyaç duydukları her şeyi beraberinde getirir. Açıklaması şöyle
Snappy package contains all the required files, where .deb packages have dependencies to other packages.

The negative side is that snappy is bigger because it contains all the files. But the big advantage is that you don't get in trouble with other packages and if you remove this package, no other package will be affected by missing dependencies.
install seçeneği
Örnek
Şöyle yaparız
snap install onlyoffice-desktopeditors
Örnek
Şöyle yaparız
sudo snap install libreoffice
list seçeneği
Örnek
Şöyle yaparız
snap list
purge seçeneği

remove seçeneği
remove seçeneği ile alt seçenekler de kullanılabilir. Açıklaması şöyle
[remove command options]
      --no-wait     Do not wait for the operation to finish but just print the change id.
      --revision=   Remove only the given revision
      --purge       Remove the snap without saving a snapshot of its data
Örnek
snap yeteneğini tamamen kaldırmak için şöyle yaparız
sudo snap remove snap-store
Örnek
Şöyle yaparız. Burada --purge kullanılıyor
snap remove firefox --purge
Örnek
Şöyle yaparız
sudo snap remove vlc

sudo apt update && sudo apt install vlc








Hiç yorum yok:

Yorum Gönder