Linux arch install snap

Linux arch install snap

Snap is a software deployment and package management system. The packages are called ‘snaps’ and the tool for using them is ‘snapd’, which works across a range of Linux distributions and allows, therefore, distro-agnostic upstream software deployment. Snap was originally designed and built by Canonical.

snapd is a REST API daemon for managing snap packages. Users can interact with it by using the snap client, which is part of the same package.

Snaps can be confined using AppArmor which is now enabled in the default kernel. Consult relevant wiki pages to find steps for enabling AppArmor in your system.

Contents

Installation

snapd supports the AppArmor security model if it is enabled on your system, to install it follow AppArmor#Installation.

If you are using AppArmor, enable and start both apparmor.service and snapd.apparmor.service .

Configuration

To launch the snapd daemon when snap tries to use it, start and/or enable the snapd.socket .

Usage

The snap tool is used to manage the snaps.

Finding

To find snaps to install, you can query the Ubuntu Store with:

Installing

Once you found the snap you are looking for you can install it with:

This requires root privileges. Per user installation of snaps is not possible, yet. This will download the snap into /var/lib/snapd/snaps and mount it to /var/lib/snapd/snap/snapname to make it available to the system.

It will also create mount units for each snap and add them to /etc/systemd/system/multi-user.target.wants/ as symlinks to make all snaps available when the system is booted. Once that is done you should find it in the list of installed snaps together with its version number, revision and developer using:

You can also sideload snaps from your local hard drive with:

Updating

To update your snaps manually use:

Snaps are refreshed automatically according to snap refresh.timer setting.

To view the next/last refresh times use:

To set a different refresh time, eg. twice a day:

See system options documentation page for details on customizing the refresh time.

Removing

Snaps can be removed by executing:

Tips and tricks

Classic snaps

Some snaps (e.g. Skype and Pycharm) use classic confinement. However, classic confinement requires the /snap directory, which is not FHS-compliant. The snapd package does not ship this directory, however the user can manually create a symbolic link between /var/lib/snapd/snap and /snap to allow the installation of classic snaps:

Confinement

When using AppArmor, snapd will generate the same profiles for snaps as on Ubuntu. The AppArmor parser is smart enough to drop the rules that are not yet supported by the mainline kernel.

To verify that basic confinement is working, install hello-world snap. Then run the following:

The denial was caused by AppArmor and should have been logged:

If you do not see the denial, verify that the profiles were loaded:

Also, you can check what sandbox features are available in the system according to snapd:

Troubleshooting

Text unreadable

If you are seeing squares instead of readable characters, you need to clear the font cache:

Snapctl also stores internal caches for each individual snap, which need to be cleared seperately. First, find them by running:

Then either remove them individually or use this simple loop.

Читайте также:  Radeon hd 8330 linux

Finally, Restart your session.

Error: cannot mount squashfs

Snap packages use the SquashFS file system. In the event of an error similar to the following:

you may verify that the SquashFS kernel module is loaded with

Graphical management

Both Gnome Software Center and KDE Discover can provide native snap support. For KDE Discover install discover-snap AUR package.

Support

Arch Linux related mailing lists and other official Arch Linux support channels are not an appropriate place to request help with snaps on Arch Linux. An appropriate place to ask for support is the Snapcraft forum.

Источник

Snap в Arch Linux, Fedora и OpenSUSE

Недавно мы рассматривали snap-пакеты в Ubuntu. И, хотя snap является разработкой компании Canonical, данный способ установки доступен и во многих других дистрибутивах Linux. Сегодня поговорим, как включить поддержку snap-пакетов в Arch Linux, Fedora и OpenSUSE.

Основное преимущество snap-пакетов в том, что они содержат в себе и программу, и все её зависимости. Snap-пакеты не требуют адаптации под конкретный дистрибутив Linux, позволяют очень быстро переключаться со стабильных выпусков ПО на тестовые, а также автоматически обновляют установленные с их помощью программы. Для работы со snap-пакетами нам необходима утилита snapd.

Установка snapd в Arch Linux

snapd в Arch Linux доступен через AUR. Для его установки используйте команды:

Установка snapd в Fedora

Для установки snapd в Fedora используйте команду

Установка snapd в OpenSUSE

Для начала нужно добавить нужный репозиторий:

Смените openSUSE_Leap_15.0 на openSUSE_Leap_42.3 или openSUSE_Tumbleweed в зависимости от используемой системы.

После этого импортируем GPG-ключ:

Теперь можно установить snapd:

Перезагрузитесь и запустите службу:

Пользователи Tumbleweed должны также выполнить команды:

После данных манипуляций можно устанавливать приложения через терминал или Магазин Snappy. Что касается основ работы со snap-пакетами, то они изложены в заметке, ссылка на которую дана в начале этой статьи.

Источник

Snap (Русский)

snapd это REST API демон для управления snap-пакетами («snaps»). Пользователи могут взаимодействовать с ним с помощью snap клиента, входящего в тот же пакет.

Contents

Установка

В пакет входит snapd демон, а также snap-confine, который обеспечивает монтирование, изоляцию и запуск snap-пакетов.

Настройка

В пакет также входят несколько systemd unit файлов, которые обеспечивают возможность обновления всех установленных snap-пакетов, при выходе новой версии.

Для того чтобы snapd демон запускался, когда snap обращается к нему, запустите snapd.socket .

Вы также можете активировать его при старте системы.

Для того чтобы автоматически обновлять пакеты активируйте snapd.refresh.timer :

Управление snap-пакетами

Для управления пакетами используется утилита snap.

Поиск

Для поиска пакетов, доступных для установки используйте команду find:

Это выведет список всех доступных пакетов. Для поиска конкретного пакета используйте:

Установка пакетов

Установить snap-пакет можно с помощью команды:

Установка требует root привилегий. Установка с правами пользователя на данный момент невозможна. При установке snap загружается в /var/lib/snapd/snaps и монтируется в /snap/имя_пакета .

Кроме того, создаются также юнит-файлы для каждого snap-пакета и добавляются в /etc/systemd/system/multi-user.target.wants/ , для того чтобы snap-пакеты монтировались при каждом запуске системы. Вы можете просмотреть список установленных пакетов командой:

Вы также можете устанавливать snap-пакеты локально, с жесткого диска:

Обновление пакетов

Для того чтобы обновить snap-пакеты выполните:

Удаление пакетов

Для того чтобы удалить пакет выполните:

Удаление

Удаление пакета snapd AUR не приводит к удалению всех каталогов и файлов, которые создаются при его использовании. Лучше всего удалить все snap-пакеты с помощью snap remove, перед тем как удалять сам пакет. Однако, на данный момент невозможно удалить snap-пакет ubuntu-core. Для того чтобы полностью удалить все файлы следуйте инструкции ниже.

1. Отмонтируйте все активные snap-пакеты из /snap .

2. Удалите следующие каталоги:

3. Удалите все файлы, отвечающие за монтирование snap-пакетов из /var/lib/snapd/snaps в /snap при загрузке.

Советы и рекомендации

Classic snaps

Some snaps (e.g. Skype and Pycharm) use classic confinement. However, classic confinement requires the /snap directory, which is not FHS-compliant. Therefore, the snapd package does not ship this directory. However, if the user wants to, he can manually create a symlink from /snap to /var/lib/snapd/snap , to allow the installation of classic snaps:

Помощь

Почтовая рассылка Arch Linux и другие официальные каналы поддержки Arch Linux не являются подходящим местом для запроса помощи по snap-пакетам на Arch Linux. Подходящим местом для запроса поддержки является Snapcraft forum.

Источник

How to Install and Use Snap in Various Linux Distributions

Last updated July 16, 2018 By Ambarish Kumar 62 Comments

Brief: Snaps are Canonical’s way of providing a cross-distribution package management system. In this article, we will see how to install and use snaps in various Linux distributions.

You might be hearing about Snap applications these days. Canonical describes Snap as a universal Linux package which can work on any distribution.

Читайте также:  Windows copy all files from folder

Snaps are basically an application compiled together with its dependencies and libraries – providing a sandboxed environment for the application to run. These are easier and faster to install, can receive latest updates and is confined from the OS and other apps.

An application can be packaged for every Linux desktop, server, cloud or devices in the form of snap. For an application developer, maintaining different package formats and subsequent updates is a pain, which Canonical in the form of Snaps has tried to overcome. It has worked well because more and more applications are now providing Snap packages.

In other words, instead of worrying about DEB packages for Debian/Ubuntu, RPM packages for Fedora etc, you can use Snap package that would work on all Linux distributions with Snap support.

Advantages of snaps

  • Easier to create and manage for Developers: Snaps are easier to create and contain all the dependencies and libraries needed to run, which also means the application uses the latest libraries and do not face any dependencies issues.
  • Automatic Updates: Updates to a snap are delivered automatically on a daily basis, and reaches out to everyone irrespective of the base OS.
  • One snap for everything: be it a desktop, server or cloud.
  • Different releases availability: A snap can be maintained in the stable release, beta versions, and daily build at the same time and you can switch between each other whenever you want.
  • Security: Snaps run in a sandboxed environment, isolated from the rest of your system.

How to install Snap on Linux

Before you Snap packages, you will have to install snapd. snapd is a management environment that handles installation and updates of snaps. Installing snapd will enable Snap support on your Linux distribution.

Let’s see how to install it for different Linux distributions.

Enabling Snap support on Debian and Ubuntu based distributions

If you want to use Snap applications on Linux Mint and other Debian or Ubuntu based distributions, use the command below:

Enabling Snap support on Fedora based distributions

Enabling Snap support on Arch-based distributions

snapd is available in Arch User Repository. Run the below command to install and enable it.

Enabling Snap support on OpenSUSE based distributions

snapd is not officially included for OpenSUSE. To install in Tumbleweed use the below commands:

Once the package is successfully installed from the community repo, enable the systemd unit.

How to use snap with the basic Snap commands

Once you are done with the snapd installation, it’s time to see how to use it. We have already covered Snap commands in detail. Here, I’ll just quickly list out the most useful Snap commands.

You can search different snaps and install it. There is a Snap store which holds different public and private apps (or snaps) for clouds, desktops, devices etc.

Finding a snap

Anyone can publish a snap in the store, however, you only see the snaps that are published to the stable release and has been reviewed. Use the below command to search for a snap:

Installing snaps

Once you found the snap you are looking for, you can install it with the below command:

List out installed snaps

You can use the below command to see the snaps you have installed along with their versions and the developer:

Update an installed snap app

Snaps are updated periodically to their latest version. In case you are trying to do it manually, type in the below command in the terminal:

Uninstall a snap package

To remove a snap

Final Words

With different Linux distributions running different package managers and formats, there is no single way of installing an application in every Linux distribution the same way. Snap can be the solution to this problem, over-coming the installation issues (like a missing library) and making sure you are running the latest version!

What do you think about snaps? Do tell us in the comments.

Like what you read? Please share it with others.

Источник

Install Snap packages in Arch Linux, and Fedora

In our previous tutorial, we have discussed what is Snap packages, its advantages and disadvantages, where you can get the Snap packages, and how to create your own Snap packages etc. For more details, check our previous article titled «An introduction to Ubuntu’s Snap packages». Today, we will see how to install Snap packages and use them in real time. As you may already know, Snapd, which is used to install Snap packages, comes preinstalled by default in Ubuntu 16.04 LTS. So, we don’t have to install it in Ubuntu 16.04 Desktop or Server. If you’re a Ubuntu 16.04 user, just skip the installation part and go to the ‘Usage’ part.

Читайте также:  Windows 10 произошла ошибка при распаковке не совпадает контрольная сумма

Install Snapd in Arch Linux

Snapd is not available in the Arch Linux’s official repositories . Yes, it is available now. To install Snapd on Arch linux and its derivatives like Antergos, Manjaro Linux, run the following command:

After installing Snapd, enable and start snapd service using commands:

If you want your apps to be automatically updated from the store start/enable the snapd.refresh.timer.

After installing Snapd, reboot once before start using it.

Install Snapd in Fedora

Snapd is not available in Fedora’s default repositories. So, we need to add Copr Repository for snapcore to install it. To do so, run the following commands as root user:

Then, Enable Copr repository for snapcore using command:

Update the repository lists:

Finally, Install Snapd using command:

Then, set SELinux to permissive mode.

Find the following line:

And, Set the value as ‘permissive’ as shown below:

Save and close the file.

And then, log out and login or reboot your system to start installing snaps.

Usage

Snapd usage is fairly simple, and it is same for all distributions that supports snapd. Let us see some examples.

Search Snaps

Let us search the available snaps with command:

Sample output:

The above command displays the list of available snaps in a nice tabular column. You can check a snap package version, developer name, and its description etc.

To search a specific package, for example htop, run:

Sample output:

Install a Snap package

To install a snap package, run:

Krita is a free digital painting studio application. It is one of the best alternative to MS-PAINT application.

Then, launch the installed snap either.

Note: If the Snap package is not shown in the Menu, reboot your system. And then try to launch it. I hope this is a bug. Since Snapd is in earlier stages, you might have some problems while using it.

Here it is my Krita snap package in Arch Linux.

As I mentioned in the previous article, each Snap package will be installed in a separate directory and doesn’t mess up with other system directories.

See Krita application is installed in a separate ( ex. /home/sk/snap/krita) directory in my Arch Linux desktop.

Similarly, All future snaps will be stored in separate directory within /home/sk/snap/ directory as well.

Updating Snap packages

To update a snap package, run:

Example:

If there is any update available for the snap package, it will be installed.

If there isn’t any update, you will see a message something like below.

List out installed Snap packages

We can find the list of available snaps from the repository using command «sudo snap find», right? But what about installed snap packages? It is simple too.

To list out the installed snaps in our system, run:

Sample output:

Removing Snap packages

To remove an installed snap, run:

The above command will remove krita snap package from your system.

You can also view the list of system changes during installing or updating or removing snap packages.

To view any recent changes in the snap packages, run:

Sample output:

Summary

I hope you got a basic usage idea of snap packages. Though, snap is still in its early development stage, it worked well as I expected. I have tested only few snap packages. You can find all available snaps either using command — ‘snap find’ or on the snap store. I will keep you updated more about snap’s usage in the days to come.

For more details about snap, check the man pages.

Please note that Manual entry for snap is available only in Ubuntu, not in other distros. If you are testing snap in other distros, you will not have any man pages for snap command.

That’s all for now. If you find this guide useful, please share it on your social, professional networks and support OSTechNix.

Источник

Оцените статью