如何阻止 nvidia-settings 安装 gnome 桌面?

如何阻止 nvidia-settings 安装 gnome 桌面?

我正在运行 Ubuntu 20.04 Server 版本,安装了最少的 X11(没有桌面管理器)

我想安装 nvidia-settings ver 470,但它似乎想要引入 gnome 桌面。有什么办法可以阻止这种情况吗?我读得对吗?它会引入 gnome 桌面?我用过,sudo apt-get install nvidia-settings --no-install-recommends --no-install-suggests但它仍然引入了大量 gnome 软件。

需要注意的是...在我的 Gentoo 系统上,nvidia-settings 版本 370 没有引入 gnome 桌面。不知道为什么 Ubuntu 版本 470 上会出现这种情况

答案1

这是因为依赖关系。查看从以下位置安装的 20.04 LTS 的终端输出:迷你iso

$ apt-cache 依赖于 nvidia-settings
nvidia-设置
  依赖: pkg-config
    包管理
  依靠:屏幕分辨率额外
  依赖: libvdpau1
 |依赖: libgtk-3-0
  依赖: libgtk2.0-0
  依赖: libc6
  依赖: libcairo2
  依赖: libgdk-pixbuf2.0-0
  依赖: libglib2.0-0
  依赖: libjansson4
  依赖: libpango-1.0-0
  依赖: libpangocairo-1.0-0
  依赖: libx11-6
  依赖: libxnvctrl0
  依赖: libxxf86vm1
  冲突:
  取代:
    nvidia-设置
apt-cache 依赖于屏幕分辨率额外
屏幕分辨率额外
  依靠:
    python3
  依赖: python3-xkit
 |依赖: gnome-shell
 |依赖:policykit-1-gnome
  依靠:
    gnome-flashback
    gnome 外壳
    波克特
    lxqt-policykit
    伴侣波尔基特
    policykit-1-gnome
    polkit-kde-agent-1
    乌库伊-波尔基特
  依赖: python3-gi

在上面的输出中您应该注意到 gnome-shell 不在推荐或建议部分,因此不是可选的。

或者使用 packages.ubuntu.com - 检查页面nvidia-settings及其依赖项名为screen-resolution-extra

用已知的 Gentoo 术语来说,这意味着 Ubuntu 使用 gnome 或 gnome-shell USE-flag 作为 nvidia-settings 包。


获取最小依赖包集的可能方法是安装lxpolkit包,而不是gnome-shell像下面这样:

$ sudo apt install lxpolkit nvidia-settings --no-install-recommends --no-install-suggests
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following additional packages will be installed:
  adwaita-icon-theme dbus-user-session dconf-gsettings-backend dconf-service fontconfig fontconfig-config fonts-dejavu-core glib-networking
  glib-networking-common glib-networking-services gsettings-desktop-schemas gtk-update-icon-cache hicolor-icon-theme humanity-icon-theme
  libatk-bridge2.0-0 libatk1.0-0 libatk1.0-data libatspi2.0-0 libavahi-client3 libavahi-common-data libavahi-common3 libbrotli1 libcairo-gobject2
  libcairo2 libcolord2 libcups2 libdatrie1 libdbus-glib-1-2 libdconf1 libdpkg-perl libepoxy0 libfontconfig1 libgdbm-compat4 libgdk-pixbuf2.0-0
  libgdk-pixbuf2.0-common libgraphite2-3 libgtk-3-0 libgtk-3-common libgtk2.0-0 libgtk2.0-common libharfbuzz0b libjansson4 libjbig0 libjpeg-turbo8
  libjpeg8 libjson-glib-1.0-0 libjson-glib-1.0-common liblcms2-2 libpango-1.0-0 libpangocairo-1.0-0 libpangoft2-1.0-0 libperl5.30 libpixman-1-0
  libpolkit-agent-1-0 libproxy1v5 librest-0.7-0 librsvg2-2 librsvg2-common libsoup-gnome2.4-1 libsoup2.4-1 libthai-data libthai0 libtiff5
  libunique-1.0-0 libvdpau1 libwayland-client0 libwayland-cursor0 libwayland-egl1 libwebp6 libxcb-render0 libxcb-shm0 libxcomposite1 libxcursor1
  libxdamage1 libxfixes3 libxi6 libxinerama1 libxkbcommon0 libxnvctrl0 libxrandr2 libxrender1 libxxf86vm1 lxsession-data perl perl-modules-5.30
  pkg-config policykit-1 python3-xkit screen-resolution-extra ubuntu-mono
Suggested packages:
  colord cups-common debian-keyring gnupg | gnupg2 gcc | c-compiler binutils patch git bzr gvfs liblcms2-utils librsvg2-bin perl-doc
  libterm-readline-gnu-perl | libterm-readline-perl-perl make libb-debug-perl liblocale-codes-perl dpkg-dev
Recommended packages:
  at-spi2-core libfile-fcntllock-perl libgdk-pixbuf2.0-bin libgtk-3-bin libgail-common libgtk2.0-bin vdpau-driver-all | vdpau-driver
The following NEW packages will be installed:
  adwaita-icon-theme dbus-user-session dconf-gsettings-backend dconf-service fontconfig fontconfig-config fonts-dejavu-core glib-networking
  glib-networking-common glib-networking-services gsettings-desktop-schemas gtk-update-icon-cache hicolor-icon-theme humanity-icon-theme
  libatk-bridge2.0-0 libatk1.0-0 libatk1.0-data libatspi2.0-0 libavahi-client3 libavahi-common-data libavahi-common3 libbrotli1 libcairo-gobject2
  libcairo2 libcolord2 libcups2 libdatrie1 libdbus-glib-1-2 libdconf1 libdpkg-perl libepoxy0 libfontconfig1 libgdbm-compat4 libgdk-pixbuf2.0-0
  libgdk-pixbuf2.0-common libgraphite2-3 libgtk-3-0 libgtk-3-common libgtk2.0-0 libgtk2.0-common libharfbuzz0b libjansson4 libjbig0 libjpeg-turbo8
  libjpeg8 libjson-glib-1.0-0 libjson-glib-1.0-common liblcms2-2 libpango-1.0-0 libpangocairo-1.0-0 libpangoft2-1.0-0 libperl5.30 libpixman-1-0
  libpolkit-agent-1-0 libproxy1v5 librest-0.7-0 librsvg2-2 librsvg2-common libsoup-gnome2.4-1 libsoup2.4-1 libthai-data libthai0 libtiff5
  libunique-1.0-0 libvdpau1 libwayland-client0 libwayland-cursor0 libwayland-egl1 libwebp6 libxcb-render0 libxcb-shm0 libxcomposite1 libxcursor1
  libxdamage1 libxfixes3 libxi6 libxinerama1 libxkbcommon0 libxnvctrl0 libxrandr2 libxrender1 libxxf86vm1 lxpolkit lxsession-data nvidia-settings
  perl perl-modules-5.30 pkg-config policykit-1 python3-xkit screen-resolution-extra ubuntu-mono
0 upgraded, 92 newly installed, 0 to remove and 0 not upgraded.
Need to get 26.2 MB/26.2 MB of archives.
After this operation, 133 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
...

并可选择安装最小桌面环境

sudo apt-get install xinit openbox slim

或者安装完整的 Lubuntu 桌面

sudo apt-get install lubuntu-desktop^

相关内容