
Я создал новую виртуальную машину с помощью функции быстрого создания в Hyper-V на Windows 10.
После настройки виртуальной машины (выбора языковых настроек, создания пароля и т. д.) я попытался установить Visual Studio Code и получил следующее сообщение об ошибке:
Unable to install "Visual Studio Code": too early for operation, device not yet seeded or device model not acknowledged
.
Расследование показало, что это несложная проблема.
Вот некоторые подробности
snap --version
:
snap 2.38
snapd 2.38
series 16
ubuntu 18.04
kernel 4.15.0-50-generic
snap changes
:
ID Status Spawn Ready Summary
1 Doing today at 10:58 BST - Initialize system state
2 Done today at 10:58 BST today at 10:58 BST Initialize device
snap tasks --last=seed
:
Status Spawn Ready Summary
Done today at 10:58 BST today at 10:58 BST Ensure prerequisites for "core" are available
Done today at 10:58 BST today at 10:58 BST Prepare snap "/var/lib/snapd/seed/snaps/core_6673.snap" (6673)
Done today at 10:58 BST today at 10:58 BST Mount snap "core" (6673)
Done today at 10:58 BST today at 10:58 BST Copy snap "core" data
Done today at 10:58 BST today at 10:58 BST Setup snap "core" (6673) security profiles
Done today at 10:58 BST today at 10:58 BST Make snap "core" (6673) available to the system
Done today at 10:58 BST today at 10:59 BST Automatically connect eligible plugs and slots of snap "core"
Done today at 10:58 BST today at 10:59 BST Set automatic aliases for snap "core"
Done today at 10:58 BST today at 10:59 BST Setup snap "core" aliases
Done today at 10:58 BST today at 10:59 BST Run install hook of "core" snap if present
Done today at 10:58 BST today at 10:59 BST Start snap "core" (6673) services
Done today at 10:58 BST today at 10:59 BST Run configure hook of "core" snap if present
Done today at 10:58 BST today at 10:59 BST Ensure prerequisites for "gnome-3-26-1604" are available
Done today at 10:58 BST today at 10:59 BST Prepare snap "/var/lib/snapd/seed/snaps/gnome-3-26-1604_82.snap" (82)
Done today at 10:58 BST today at 10:59 BST Mount snap "gnome-3-26-1604" (82)
Done today at 10:58 BST today at 10:59 BST Copy snap "gnome-3-26-1604" data
Done today at 10:58 BST today at 10:59 BST Setup snap "gnome-3-26-1604" (82) security profiles
Done today at 10:58 BST today at 10:59 BST Make snap "gnome-3-26-1604" (82) available to the system
Done today at 10:58 BST today at 10:59 BST Automatically connect eligible plugs and slots of snap "gnome-3-26-1604"
Done today at 10:58 BST today at 10:59 BST Set automatic aliases for snap "gnome-3-26-1604"
Done today at 10:58 BST today at 10:59 BST Setup snap "gnome-3-26-1604" aliases
Done today at 10:58 BST today at 10:59 BST Run install hook of "gnome-3-26-1604" snap if present
Done today at 10:58 BST today at 10:59 BST Start snap "gnome-3-26-1604" (82) services
Done today at 10:58 BST today at 10:59 BST Run configure hook of "gnome-3-26-1604" snap if present
Doing today at 10:58 BST - Ensure prerequisites for "gnome-calculator" are available
Do today at 10:58 BST - Prepare snap "/var/lib/snapd/seed/snaps/gnome-calculator_352.snap" (352)
Do today at 10:58 BST - Mount snap "gnome-calculator" (352)
Do today at 10:58 BST - Copy snap "gnome-calculator" data
Do today at 10:58 BST - Setup snap "gnome-calculator" (352) security profiles
Do today at 10:58 BST - Make snap "gnome-calculator" (352) available to the system
Do today at 10:58 BST - Automatically connect eligible plugs and slots of snap "gnome-calculator"
Do today at 10:58 BST - Set automatic aliases for snap "gnome-calculator"
Do today at 10:58 BST - Setup snap "gnome-calculator" aliases
Do today at 10:58 BST - Run install hook of "gnome-calculator" snap if present
Do today at 10:58 BST - Start snap "gnome-calculator" (352) services
Do today at 10:58 BST - Run configure hook of "gnome-calculator" snap if present
Do today at 10:58 BST - Ensure prerequisites for "gnome-characters" are available
Do today at 10:58 BST - Prepare snap "/var/lib/snapd/seed/snaps/gnome-characters_206.snap" (206)
Do today at 10:58 BST - Mount snap "gnome-characters" (206)
Do today at 10:58 BST - Copy snap "gnome-characters" data
Do today at 10:58 BST - Setup snap "gnome-characters" (206) security profiles
Do today at 10:58 BST - Make snap "gnome-characters" (206) available to the system
Do today at 10:58 BST - Automatically connect eligible plugs and slots of snap "gnome-characters"
Do today at 10:58 BST - Set automatic aliases for snap "gnome-characters"
Do today at 10:58 BST - Setup snap "gnome-characters" aliases
Do today at 10:58 BST - Run install hook of "gnome-characters" snap if present
Do today at 10:58 BST - Start snap "gnome-characters" (206) services
Do today at 10:58 BST - Run configure hook of "gnome-characters" snap if present
Do today at 10:58 BST - Ensure prerequisites for "gnome-logs" are available
Do today at 10:58 BST - Prepare snap "/var/lib/snapd/seed/snaps/gnome-logs_57.snap" (57)
Do today at 10:58 BST - Mount snap "gnome-logs" (57)
Do today at 10:58 BST - Copy snap "gnome-logs" data
Do today at 10:58 BST - Setup snap "gnome-logs" (57) security profiles
Do today at 10:58 BST - Make snap "gnome-logs" (57) available to the system
Do today at 10:58 BST - Automatically connect eligible plugs and slots of snap "gnome-logs"
Do today at 10:58 BST - Set automatic aliases for snap "gnome-logs"
Do today at 10:58 BST - Setup snap "gnome-logs" aliases
Do today at 10:58 BST - Run install hook of "gnome-logs" snap if present
Do today at 10:58 BST - Start snap "gnome-logs" (57) services
Do today at 10:58 BST - Run configure hook of "gnome-logs" snap if present
Do today at 10:58 BST - Ensure prerequisites for "gnome-system-monitor" are available
Do today at 10:58 BST - Prepare snap "/var/lib/snapd/seed/snaps/gnome-system-monitor_70.snap" (70)
Do today at 10:58 BST - Mount snap "gnome-system-monitor" (70)
Do today at 10:58 BST - Copy snap "gnome-system-monitor" data
Do today at 10:58 BST - Setup snap "gnome-system-monitor" (70) security profiles
Do today at 10:58 BST - Make snap "gnome-system-monitor" (70) available to the system
Do today at 10:58 BST - Automatically connect eligible plugs and slots of snap "gnome-system-monitor"
Do today at 10:58 BST - Set automatic aliases for snap "gnome-system-monitor"
Do today at 10:58 BST - Setup snap "gnome-system-monitor" aliases
Do today at 10:58 BST - Run install hook of "gnome-system-monitor" snap if present
Do today at 10:58 BST - Start snap "gnome-system-monitor" (70) services
Do today at 10:58 BST - Run configure hook of "gnome-system-monitor" snap if present
Do today at 10:58 BST - Ensure prerequisites for "gtk-common-themes" are available
Do today at 10:58 BST - Prepare snap "/var/lib/snapd/seed/snaps/gtk-common-themes_1198.snap" (1198)
Do today at 10:58 BST - Mount snap "gtk-common-themes" (1198)
Do today at 10:58 BST - Copy snap "gtk-common-themes" data
Do today at 10:58 BST - Setup snap "gtk-common-themes" (1198) security profiles
Do today at 10:58 BST - Make snap "gtk-common-themes" (1198) available to the system
Do today at 10:58 BST - Automatically connect eligible plugs and slots of snap "gtk-common-themes"
Do today at 10:58 BST - Set automatic aliases for snap "gtk-common-themes"
Do today at 10:58 BST - Setup snap "gtk-common-themes" aliases
Do today at 10:58 BST - Run install hook of "gtk-common-themes" snap if present
Do today at 10:58 BST - Start snap "gtk-common-themes" (1198) services
Do today at 10:58 BST - Run configure hook of "gtk-common-themes" snap if present
Do today at 10:58 BST - Mark system seeded
......................................................................
Make snap "core" (6673) available to the system
2019-05-17T10:58:58+01:00 INFO Requested daemon restart.
......................................................................
Automatically connect eligible plugs and slots of snap "core"
2019-05-17T10:58:58+01:00 INFO Waiting for restart...
sudo systemctl status snapd.autoimport
:
● snapd.autoimport.service - Auto import assertions from block devices
Loaded: loaded (/lib/systemd/system/snapd.autoimport.service; enabled; vendor preset: enabled)
Active: inactive (dead)
Condition: start condition failed at Fri 2019-05-17 16:31:20 BST; 33min ago
└─ ConditionKernelCommandLine=snap_core was not met
Сведения о Windows: - Windows 10, версия 1809, (сборка ОС 17763.437)
Что я пробовал
1 - возиться с/var/lib/snapd/state.json
Я попробовал следующее предложение:https://forum.snapcraft.io/t/cant-install-or-refresh-snaps-on-arch-linux/8690/28
Выглядит это примерно так:
sudo systemctl stop snapd
sudo cat /var/lib/snapd/state.json | \
jq 'delpaths([["data", "auth", "device"]])' > state.json-new
sudo cp state.json-new /var/lib/snapd/state.json
sudo systemctl start snapd
Однако (вероятно, это из-за того, что я новичок в Ubuntu) я не могу jq
установить его и не совсем понимаю, что он делает, поэтому не могу сделать это вручную.
2 — Использование образа Ubuntu 19
По-видимому, здесь та же проблема.
3 - Коллега попробовал на своем ноутбуке
У него была та же проблема.
4 - Переустановитьsnapd
Я запустил это: sudo apt install --reinstall snapd
установка застряла на 67%.
5 - возиться с/var/lib/snapd/seed/seed.yaml
Согласно этой ошибке:https://www.mail-archive.com/[email protected]/msg5400922.html
Я попробовал переупорядочить часть gtk-common-themes, а также удалить часть gnome-calculator (перезагружая после каждого изменения), это, похоже, не дало результата. Команда snap tasks --last=seed
все еще показывала, что она застряла на задаче gnome-calculator.
6 - удар головой по клавиатуре
Я почувствовал себя лучше, но проблема осталась.
7 - использование образа не быстрого запуска
Я скачал образ Ubuntu 18.04.2 ISO и использовал его. ЭТО СРАБОТАЛО (я смог установить Visual Studio Code, и команды snap выглядели здорово). Однако в нем нет всех замечательных вещей hyper-v, поэтому разрешение экрана отстойное, нет копирования и вставки, мышь сильно тормозит и т. д.
Я мог бы установить различные биты, чтобы сделать этот образ более дружественным к hyper-v, но у меня есть чувство, что я никогда не стану таким же гладким, как официальный. Если я смогу исправить это, snap
я думаю, что в конечном итоге получу лучший UX.
8 - ЭТО РАБОТАЕТ. возимся с /var/lib/snapd/seed/seed.yaml
частью 2
Я удалила кучу всего из своего архива /var/lib/snapd/seed/seed.yaml
, и теперь он выглядит так:
snaps:
-
name: core
channel: stable
file: core_6673.snap
-
name: gtk-common-themes
channel: stable/ubuntu-18.04
file: gtk-common-themes_1198.snap
-
name: gnome-3-26-1604
channel: stable/ubuntu-18.04
file: gnome-3-26-1604_82.snap
А затем сделал, а затем snap abort --last=seed
последовало sudo systemctl restart snapd
. Проверьте snap tasks --last=seed
- они все должны быть завершены, и вы можете выполнить установку snaps (например, Visual Studio Code).
Кто-нибудь умнее меня, вероятно, укажет на ужасные побочные эффекты, которые это вызовет.
решение1
Судя по всему, файл seed.yml указывает приложения, которые нужно установить при новой установке ОС.
Если удалить те, которые застряли, а затем вручную установить их, то это сработает.
Шаги:
Измените ваш
/var/lib/snapd/seed/seed.yaml
файл так, чтобы он выглядел следующим образом:snaps: - name: core channel: stable file: core_6673.snap - name: gtk-common-themes channel: stable/ubuntu-18.04 file: gtk-common-themes_1198.snap - name: gnome-3-26-1604 channel: stable/ubuntu-18.04 file: gnome-3-26-1604_82.snap
По сути, я удаляю все записи, из-за которых зависали задачи Snap.
Прервите текущие запущенные задачи Snap и перезапустите службу:
snap abort --last=seed
sudo systemctl restart snapd
- Продолжайте работу
snap tasks --last=seed
, чтобы увидеть ход выполнения задач Snap и дождитесь, пока все задачи будут «Выполнены».
Вручную установите все приложения, которые вы удалили из .
/var/lib/snapd/seed/seed.yaml
К ним могут относиться:gnome-calculator
gnome-characters
gnome-logs
gnome-system-monitor
Команда для переустановки:
snap install gnome-calculator gnome-characters gnome-logs gnome-system-monitor`
Кредит
БлагодаряСтефан Яриназа помощь в решении этой проблемы!