我想从源包安装 openssh。
我的 Ubuntu 没有 GUI。我想禁用 libgtk。
如何禁用 libgtk?
环境
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 18.04.3 LTS
Release: 18.04
Codename: bionic
过程
我启用deb-src
并/etc/apt/sources.list
更新:
sudo apt update
在 build-dep 中,我发现了 libgtk:
$ sudo apt-get build-dep openssh
The following NEW packages will be installed:
comerr-dev dconf-gsettings-backend dconf-service dh-exec gir1.2-atk-1.0 gir1.2-atspi-2.0 gir1.2-gtk-3.0 gir1.2-harfbuzz-0.0 gir1.2-pango-1.0 glib-networking glib-networking-common glib-networking-services gsettings-desktop-schemas
icu-devtools krb5-multidev libatk-bridge2.0-0 libatk-bridge2.0-dev libatk1.0-dev libatspi2.0-0 libatspi2.0-dev libaudit-dev libbsd-dev libcairo-script-interpreter2 libcairo2-dev libcap-ng-dev libcolord2 libdbus-1-dev libdconf1
libdrm-amdgpu1 libdrm-common libdrm-dev libdrm-intel1 libdrm-nouveau2 libdrm-radeon1 libdrm2 libedit-dev libegl-mesa0 libegl1 libegl1-mesa-dev libelf1 libepoxy-dev libepoxy0 libexpat1-dev libfontconfig1-dev libfreetype6-dev libgbm1
libgdk-pixbuf2.0-dev libgl1 libgl1-mesa-dri libglapi-mesa libgles1 libgles2 libglib2.0-bin libglib2.0-dev libglib2.0-dev-bin libglvnd-core-dev libglvnd-dev libglvnd0 libglx-mesa0 libglx0 libgraphite2-dev libgssrpc4 libgtk-3-0
libgtk-3-common libgtk-3-dev libharfbuzz-dev libharfbuzz-gobject0 libharfbuzz-icu0 libice-dev libice6 libicu-dev libicu-le-hb-dev libicu-le-hb0 libiculx60 libjson-glib-1.0-0 libjson-glib-1.0-common libkadm5clnt-mit11 libkadm5srv-mit11
libkdb5-9 libkrb5-dev liblcms2-2 libllvm9 libncurses5-dev libopengl0 libpam0g-dev libpango1.0-dev libpangoxft-1.0-0 libpciaccess0 libpcre16-3 libpcre3-dev libpcre32-3 libpcrecpp0v5 libpixman-1-dev libpng-dev libproxy1v5
libpthread-stubs0-dev librest-0.7-0 libselinux1-dev libsensors4 libsepol1-dev libsm-dev libsm6 libsoup-gnome2.4-1 libsoup2.4-1 libssl1.0-dev libsystemd-dev libtinfo-dev libwayland-bin libwayland-client0 libwayland-cursor0
libwayland-dev libwayland-egl1 libwayland-server0 libwrap0 libwrap0-dev libx11-dev libx11-xcb-dev libx11-xcb1 libxau-dev libxcb-dri2-0 libxcb-dri2-0-dev libxcb-dri3-0 libxcb-dri3-dev libxcb-glx0 libxcb-glx0-dev libxcb-present-dev
libxcb-present0 libxcb-randr0 libxcb-randr0-dev libxcb-render0-dev libxcb-shape0 libxcb-shape0-dev libxcb-shm0-dev libxcb-sync-dev libxcb-sync1 libxcb-xfixes0 libxcb-xfixes0-dev libxcb1-dev libxcomposite-dev libxcursor-dev
libxdamage-dev libxdmcp-dev libxext-dev libxfixes-dev libxft-dev libxft2 libxi-dev libxinerama-dev libxkbcommon-dev libxkbcommon0 libxrandr-dev libxrender-dev libxshmfence-dev libxshmfence1 libxtst-dev libxtst6 libxxf86vm-dev
libxxf86vm1 mesa-common-dev python3-distutils python3-lib2to3 wayland-protocols x11-common x11proto-composite-dev x11proto-core-dev x11proto-damage-dev x11proto-dev x11proto-fixes-dev x11proto-input-dev x11proto-randr-dev
x11proto-record-dev x11proto-xext-dev x11proto-xf86vidmode-dev x11proto-xinerama-dev xkb-data xorg-sgml-doctools xtrans-dev zlib1g-dev
The following packages will be upgraded:
libcom-err2 libglib2.0-0 libicu60 libsystemd0
4 upgraded, 178 newly installed, 0 to remove and 90 not upgraded.
Need to get 63.1 MB of archives.
After this operation, 458 MB of additional disk space will be used.
Do you want to continue? [Y/n]
依赖
我得到了 openssh 源包。
$ dget -u http://archive.ubuntu.com/ubuntu/pool/main/o/openssh/openssh_7.6p1-4ubuntu0.3.dsc
我pkg.openssh.nognome
在发现openssh-7.6p1/debian/control
。
Build-Depends: autotools-dev,
debhelper (>= 9.20160709~),
dh-autoreconf,
dh-exec,
dpkg-dev (>= 1.16.1~),
libaudit-dev [linux-any],
libedit-dev,
libgtk-3-dev <!pkg.openssh.nognome>, <---- this
libkrb5-dev | heimdal-dev,
libpam0g-dev | libpam-dev,
libselinux1-dev [linux-any],
libssl1.0-dev | libssl-dev (<< 1.1.0~),
libsystemd-dev [linux-any],
libwrap0-dev | libwrap-dev,
zlib1g-dev (>= 1:1.2.3),
我认为 libgtk-3-dev 将被安装,因为pkg.openssh.nognome
已被禁用。
我如何启用pkg.openssh.nognome
?
答案1
pkg.openssh.nognome
是“构建配置文件”。要使用它,请应用--build-profiles
/-P
选项apt-get
:
-P, --build-profiles
This option controls the activated build profiles for which a source package is built
by apt-get source --compile and how build dependencies are satisfied. By default no
build profile is active. More than one build profile can be activated at a time by
concatenating them with a comma. Configuration Item: APT::Build-Profiles.
例如,在 Docker 容器中:
# apt-get build-dep openssh --build-profiles pkg.openssh.nognome
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
autoconf automake autopoint autotools-dev binutils binutils-common binutils-x86-64-linux-gnu bsdmainutils build-essential comerr-dev cpp cpp-7 debhelper dh-autoreconf dh-exec
dh-strip-nondeterminism dpkg-dev file g++ g++-7 gcc gcc-7 gcc-7-base gettext gettext-base groff-base intltool-debian krb5-multidev libarchive-zip-perl libasan4 libatomic1
libaudit-dev libbinutils libbsd-dev libbsd0 libc-dev-bin libc6-dev libcap-ng-dev libcc1-0 libcilkrts5 libcroco3 libdpkg-perl libedit-dev libedit2 libfile-stripnondeterminism-perl
libgcc-7-dev libgdbm-compat4 libgdbm5 libglib2.0-0 libgomp1 libgssapi-krb5-2 libgssrpc4 libicu60 libisl19 libitm1 libk5crypto3 libkadm5clnt-mit11 libkadm5srv-mit11 libkdb5-9
libkeyutils1 libkrb5-3 libkrb5-dev libkrb5support0 liblsan0 libmagic-mgc libmagic1 libmpc3 libmpfr6 libmpx2 libncurses5-dev libpam0g-dev libpcre16-3 libpcre3-dev libpcre32-3
libpcrecpp0v5 libperl5.26 libpipeline1 libquadmath0 libselinux1-dev libsepol1-dev libsigsegv2 libssl1.0-dev libssl1.0.0 libstdc++-7-dev libsystemd-dev libtimedate-perl libtinfo-dev
libtool libtsan0 libubsan0 libwrap0 libwrap0-dev libxml2 linux-libc-dev m4 make man-db patch perl perl-modules-5.26 po-debconf xz-utils zlib1g-dev
The following packages will be upgraded:
gcc-8-base libcom-err2 libgcc1 libstdc++6 libsystemd0
5 upgraded, 103 newly installed, 0 to remove and 18 not upgraded.
Need to get 71.2 MB of archives.
After this operation, 295 MB of additional disk space will be used.
Do you want to continue? [Y/n]
沒有libgtk-3-dev
安裝!