我正在以编程方式配置用户,我不希望他们看到要求他们“连接您的在线帐户”的对话框。
使用命令行,我该如何防止这种情况发生?
使用 Ubuntu 19.04 桌面
谢谢
答案1
解决方法- 在 Ubuntu 19.04 中测试
在这篇文章的帮助下......https://askubuntu.com/a/1123001/739431
执行 Ubuntu 19.04 初始设置的命令是/usr/libexec/gnome-initial-setup --existing-user
如果你的问题只是禁用“要求他们“连接您的在线帐户”的对话框。这个帖子不适合。。
初始设置来自包gnome-initial-setup
pratap@i7-6550U:~$ apt show gnome-initial-setup
Package: gnome-initial-setup
Version: 3.32.1-1ubuntu3
Priority: optional
Section: gnome
Origin: Ubuntu
Maintainer: Ubuntu Developers <[email protected]>
Original-Maintainer: Debian GNOME Maintainers <[email protected]>
Bugs: https://bugs.launchpad.net/ubuntu/+filebug
Installed-Size: 1,966 kB
Depends: libaccountsservice0 (>= 0.6.24), libc6 (>= 2.29), libcairo2 (>= 1.2.4), libcheese-gtk25 (>= 3.18.0), libcheese8 (>= 3.18.0), libfontconfig1 (>= 2.12.6), libgdk-pixbuf2.0-0 (>= 2.25.2), libgdm1 (>= 3.8.3), libgeoclue-2-0 (>= 2.4.0), libglib2.0-0 (>= 2.46.0), libgnome-desktop-3-17 (>= 3.17.92), libgoa-1.0-0b (>= 3.5.90), libgoa-backend-1.0-1 (>= 3.10.0), libgtk-3-0 (>= 3.22.29), libgweather-3-15 (>= 3.13.91), libibus-1.0-5 (>= 1.5.2), libjson-glib-1.0-0 (>= 0.12.0), libkrb5-3 (>= 1.8+dfsg), libnm0 (>= 1.0.0), libnma0 (>= 1.1.90), libpango-1.0-0 (>= 1.32.5), libpangocairo-1.0-0 (>= 1.32.5), libpolkit-gobject-1-0 (>= 0.99), libpwquality1 (>= 1.1.0), librest-0.7-0 (>= 0.7), libsecret-1-0 (>= 0.18), libsnapd-glib1 (>= 1.42), libsoup2.4-1 (>= 2.41.90), libsysmetrics1 (>= 1.0.5), libwebkit2gtk-4.0-37 (>= 2.5.3), policykit-1 (>= 0.103), adduser, gnome-settings-daemon (>= 3.24), gnome-control-center-data
Recommends: gnome-getting-started-docs
Suggests: gdm3
Homepage: https://git.gnome.org/browse/gnome-initial-setup/
Task: ubuntu-desktop-minimal, ubuntu-desktop
Supported: 9m
Download-Size: 1,166 kB
APT-Manual-Installed: yes
APT-Sources: http://in.archive.ubuntu.com/ubuntu disco/main amd64 Packages
Description: Initial GNOME system setup helper
After acquiring or installing a new system there are a few essential things
to set up before use. GNOME Initial Setup aims to provide a simple, easy,
and safe way to prepare a new system.
.
GNOME Initial Setup runs the first time you log in to the GNOME desktop
and lets you easily configure your language, keyboard layout, online accounts
integration, and more.
.
If you want to configure these things at any other time, run the Settings app.
pratap@i7-6550U:~$
online accounts
因此,除非可以编辑源文件,否则不可能仅禁用对话。
选项 1:删除包 -sudo apt purge gnome-initial-setup
Exec=
选项 2:注释掉文件中以 开头的第 5 行/etc/xdg/autostart/gnome-initial-setup-first-login.desktop
注释该行,因为您提到您想要自动化,请将以下命令保存在您的脚本中。
sudo sed -i 5d /etc/xdg/autostart/gnome-initial-setup-first-login.desktop && sudo sed -i '5i#Exec=/usr/libexec/gnome-initial-setup --existing-user' /etc/xdg/autostart/gnome-initial-setup-first-login.desktop
要随时恢复更改,请运行以下命令
sudo sed -i 5d /etc/xdg/autostart/gnome-initial-setup-first-login.desktop && sudo sed -i '5iExec=/usr/libexec/gnome-initial-setup --existing-user' /etc/xdg/autostart/gnome-initial-setup-first-login.desktop
输出 nano /etc/xdg/autostart/gnome-initial-setup-first-login.desktop
[Desktop Entry]
Name=Initial Setup
# Translators: Do NOT translate or transliterate this text (this is an icon file name)!
Icon=preferences-system
Exec=/usr/libexec/gnome-initial-setup --existing-user
Terminal=false
Type=Application
StartupNotify=true
Categories=GNOME;GTK;System;
OnlyShowIn=GNOME;Unity;
NoDisplay=true
AutostartCondition=unless-exists gnome-initial-setup-done
X-GNOME-Bugzilla-Bugzilla=GNOME
X-GNOME-Bugzilla-Product=gnome-initial-setup
X-GNOME-Bugzilla-Component=general
X-GNOME-Bugzilla-Version=unknown
X-Ubuntu-Gettext-Domain=gnome-initial-setup
请注意,当用户新创建并且首次登录时,如果该Exec=
行是commented
.. 则用户将看不到 gnome-initial-setup,但是... 如果在稍后阶段,当 Exec 行是uncommented
.. 时,用户将gnome-initial-setup
在下次登录时看到并且仅显示一次...