Testing the apt-build command

This is a follow-up of the post

by @skaunov

I made a new hard install of Linux Mint 21.1 for this investigation.
I acknowledge help from @easyt50 with the procedure to install without grub.

In most distros which use the apt package system, there is a package called apt-build which offers to build and install either selected packages, or the whole system , by a source code download followed by a configure and a compile.
In what follows I used the Ubuntu instructions

Step 1:
Apt-build may not be installed by default, but it can be installed as follows

nevj@trinity:~$ apt-cache search apt-build
apt-build - frontend to apt to build, optimize and install packages
nevj@trinity:~$  su
Password: 
root@trinity:/home/nevj# apt-get install apt-build
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following additional packages will be installed:
  build-essential cpp-11 devscripts dput g++ g++-11 gcc-11 gcc-11-base git
  git-man libappconfig-perl libarray-intspan-perl libasan6 libc-dev-bin
  libc-devtools libc6-dev libcommon-sense-perl libcontextual-return-perl
  libcrypt-dev libdistro-info-perl liberror-perl libfile-chdir-perl
  libfile-dirlist-perl libfile-homedir-perl libfile-touch-perl
  libfile-which-perl libgcc-11-dev libgit-wrapper-perl libgitlab-api-v4-perl
  libhash-fieldhash-perl libhttp-tiny-multipart-perl libio-prompter-perl
  libio-pty-perl libipc-run-perl libjson-perl libjson-xs-perl
  liblog-any-adapter-screen-perl liblog-any-perl libmoox-struct-perl
  libnamespace-autoclean-perl libnsl-dev libobject-id-perl
  libpath-iterator-rule-perl libpod-constants-perl libpod-parser-perl
  libre-engine-re2-perl libre2-9 libreadonly-perl libref-util-perl
  libref-util-xs-perl libregexp-pattern-license-perl libregexp-pattern-perl
  libset-intspan-perl libstdc++-11-dev libstring-copyright-perl
  libstring-escape-perl libstring-shellquote-perl libtirpc-dev libtsan0
  libtype-tiny-perl libtype-tiny-xs-perl libtypes-serialiser-perl libwant-perl
  licensecheck python3-gpg python3-unidiff rpcsvc-proto wdiff
Suggested packages:
  gfortran gcc-11-locales adequate at autopkgtest bls-standalone bsd-mailx
  | mailx check-all-the-things cvs-buildpackage debhelper diffoscope
  disorderfs dose-extra duck elpa-devscripts faketime gnuplot how-can-i-help
  libdbd-pg-perl libnet-smtps-perl libterm-size-perl libyaml-syck-perl
  mmdebstrap mozilla-devscripts mutt piuparts postgresql-client pristine-lfs
  quilt ratt reprotest svn-buildpackage w3m debian-keyring equivs
  libsoap-lite-perl pristine-tar python3-paramiko mini-dinstall g++-multilib
  g++-11-multilib gcc-11-doc gcc-11-multilib git-daemon-run
  | git-daemon-sysvinit git-doc git-email git-gui gitk gitweb git-cvs
  git-mediawiki git-svn glibc-doc libossp-uuid-perl libstdc++-11-doc
  libdevel-lexalias-perl wdiff-doc
The following NEW packages will be installed:
  apt-build build-essential devscripts dput g++ g++-11 git git-man
  libappconfig-perl libarray-intspan-perl libc-dev-bin libc-devtools libc6-dev
  libcommon-sense-perl libcontextual-return-perl libcrypt-dev
  libdistro-info-perl liberror-perl libfile-chdir-perl libfile-dirlist-perl
  libfile-homedir-perl libfile-touch-perl libfile-which-perl
  libgit-wrapper-perl libgitlab-api-v4-perl libhash-fieldhash-perl
  libhttp-tiny-multipart-perl libio-prompter-perl libio-pty-perl
  libipc-run-perl libjson-perl libjson-xs-perl liblog-any-adapter-screen-perl
  liblog-any-perl libmoox-struct-perl libnamespace-autoclean-perl libnsl-dev
  libobject-id-perl libpath-iterator-rule-perl libpod-constants-perl
  libpod-parser-perl libre-engine-re2-perl libre2-9 libreadonly-perl
  libref-util-perl libref-util-xs-perl libregexp-pattern-license-perl
  libregexp-pattern-perl libset-intspan-perl libstdc++-11-dev
  libstring-copyright-perl libstring-escape-perl libstring-shellquote-perl
  libtirpc-dev libtype-tiny-perl libtype-tiny-xs-perl libtypes-serialiser-perl
  libwant-perl licensecheck python3-gpg python3-unidiff rpcsvc-proto wdiff
The following packages will be upgraded:
  cpp-11 gcc-11 gcc-11-base libasan6 libgcc-11-dev libtsan0
6 to upgrade, 63 to newly install, 0 to remove and 325 not to upgrade.
Need to get 60.6 MB of archives.
After this operation, 96.0 MB of additional disk space will be used.
Do you want to continue? [Y/n] 

.................

 In order to install built package via APT, you must add a line like this  โ”‚ 
 โ”‚ to your sources.list:                                                     โ”‚ 
 โ”‚   deb file:/var/cache/apt-build/repository apt-build main                 โ”‚ 
 โ”‚                                                                           โ”‚ 
 โ”‚ Add apt-build repository to sources.list?                                 โ”‚ 
 โ”‚                                                                           โ”‚ 
 โ”‚                    <Yes>                       <No>                       


......................

These are equivalent to -O1, -O2 and -O3. Optimization level is time     โ”‚ 
  โ”‚ dependant. The higher optimization level you choose, more time will be   โ”‚ 
  โ”‚ required for compiling, but the faster your programs will be. Warning:   โ”‚ 
  โ”‚ Strong optimization may lead to stability problems.                      โ”‚ 
  โ”‚                                                                          โ”‚ 
  โ”‚ Optimization level:                                                      โ”‚ 
  โ”‚                                                                          โ”‚ 
  โ”‚                                 Light                                    โ”‚ 
  โ”‚                                 Medium                                   โ”‚ 
  โ”‚                                 Strong                                   โ”‚ 
  โ”‚                                                                          โ”‚ 
  โ”‚                                                                          โ”‚ 
  โ”‚                                  <Ok>                                    


..........................

Options to add to make:          โ”‚ 
                      โ”‚                                  โ”‚ 
                      โ”‚ -j12____________________________ โ”‚ 
                      โ”‚                                  โ”‚ 
                      โ”‚              <Ok>                โ”‚ 
                      โ”‚                              

......................

architecture   choose corei7

.......................

Setting up licensecheck (3.2.14-2) ...
Setting up libstdc++-11-dev:amd64 (11.3.0-1ubuntu1~22.04.1) ...
Setting up g++-11 (11.3.0-1ubuntu1~22.04.1) ...
Setting up g++ (4:11.2.0-1ubuntu1) ...
update-alternatives: using /usr/bin/g++ to provide /usr/bin/c++ (c++) in auto mode
Setting up build-essential (12.9ubuntu3) ...
Setting up apt-build (0.12.49) ...
-----> Building repository <-----
Processing triggers for man-db (2.10.2-1) ...
Processing triggers for install-info (6.8-4build1) ...
Processing triggers for libc-bin (2.35-0ubuntu3.1) ...
root@trinity:/home/nevj# 

It set up some files in /etc/apt/sources.list.d. We need to look at those

nevj@trinity:~$ cd /etc/apt/sources.list.d
nevj@trinity:/etc/apt/sources.list.d$ ls
apt-build.list                      official-source-repositories.list
official-package-repositories.list

The ones of interest are

deb-src https://mirror.aarnet.edu.au/pub/linuxmint-packages vera main upstream import backport 

deb-src http://mirror.aarnet.edu.au/pub/ubuntu/archive jammy main restricted universe multiverse
deb-src http://mirror.aarnet.edu.au/pub/ubuntu/archive jammy-updates main restricted universe multiverse
deb-src http://mirror.aarnet.edu.au/pub/ubuntu/archive jammy-backports main restricted universe multiverse

deb-src http://security.ubuntu.com/ubuntu/ jammy-security main restricted universe multiverse

and

nevj@trinity:/etc/apt/sources.list.d$ cat apt-build.list
deb [trusted=yes] file:/var/cache/apt-build/repository apt-build main

The other one is the standard repo for binary packages.

Step 2:
There are some further configurations for apt-build , setting up a directory in /var/cache and setting gcc and make options


โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค Configuring apt-build โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
        โ”‚                                                              โ”‚ 
        โ”‚                                                              โ”‚ 
        โ”‚ Directory used by apt-build to download and build packages:  โ”‚ 
        โ”‚                                                              โ”‚ 
        โ”‚ /var/cache/apt-build/build__________________________________ โ”‚ 
        โ”‚                                                              โ”‚ 
        โ”‚                            <Ok>                              โ”‚ 
        โ”‚                                                              โ”‚ 
        โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ 
                                                                         



โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค Configuring apt-build โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
           โ”‚                                                       โ”‚ 
           โ”‚                                                       โ”‚ 
           โ”‚ Directory used to store packages built by apt-build:  โ”‚ 
           โ”‚                                                       โ”‚ 
           โ”‚ /var/cache/apt-build/repository______________________ โ”‚ 
           โ”‚                                                       โ”‚ 
           โ”‚                        <Ok>                           โ”‚ 
           โ”‚                                                       โ”‚ 
           โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ 
                                                                     

โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค Configuring apt-build โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
 โ”‚                                                                           โ”‚ 
 โ”‚ In order to install built package via APT, you must add a line like this  โ”‚ 
 โ”‚ to your sources.list:                                                     โ”‚ 
 โ”‚   deb file:/var/cache/apt-build/repository apt-build main                 โ”‚ 
 โ”‚                                                                           โ”‚ 
 โ”‚ Add apt-build repository to sources.list?                                 โ”‚ 
 โ”‚                                                                           โ”‚ 
 โ”‚                    <Yes>                       <No>             




These are equivalent to -O1, -O2 and -O3. Optimization level is time     โ”‚ 
  โ”‚ dependant. The higher optimization level you choose, more time will be   โ”‚ 
  โ”‚ required for compiling, but the faster your programs will be. Warning:   โ”‚ 
  โ”‚ Strong optimization may lead to stability problems.                      โ”‚ 
  โ”‚                                                                          โ”‚ 
  โ”‚ Optimization level:                                                      โ”‚ 
  โ”‚                                                                          โ”‚ 
  โ”‚                                 Light                                    โ”‚ 
  โ”‚                                 Medium                                   โ”‚ 
  โ”‚                                 Strong                                   โ”‚ 
  โ”‚                                                                          โ”‚ 
  โ”‚                                                                          โ”‚ 
  โ”‚                                  <Ok>                          

โ”€โ”€โ”€โ”€โ”ค Configuring apt-build โ”œโ”€โ”€โ”€โ”€โ”€โ”
                      โ”‚                                  โ”‚ 
                      โ”‚                                  โ”‚ 
                      โ”‚ Options to add to gcc:           โ”‚ 
                      โ”‚                                  โ”‚ 
                      โ”‚ ________________________________ โ”‚ 
                      โ”‚                                  โ”‚ 
                      โ”‚              <Ok>                โ”‚ 
                      โ”‚                                  โ”‚ 
                      โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ 
                                                           

                      โ”Œโ”€โ”€โ”€โ”€โ”ค Configuring apt-build โ”œโ”€โ”€โ”€โ”€โ”€โ”
                      โ”‚                                  โ”‚ 
                      โ”‚                                  โ”‚ 
                      โ”‚ Options to add to make:          โ”‚ 
                      โ”‚                                  โ”‚ 
                      โ”‚ -j12____________________________ โ”‚ 
                      โ”‚                                  โ”‚ 
                      โ”‚              <Ok>                โ”‚ 
                      โ”‚                                  โ”‚ 
                      โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ 
                                                           

If your architecture is not here, choose one and edit your configuration  โ”‚ 
 โ”‚ file (/etc/apt/apt-build.conf) by hand, and please do a wishlist          โ”‚ 
 โ”‚ bugreport.                                                                โ”‚ 
 โ”‚                                                                           โ”‚ 
 โ”‚ Architecture:                                                             โ”‚ 
 โ”‚                                                                           โ”‚ 
 โ”‚                             native            โ†‘                           โ”‚ 
 โ”‚                             nocona            โ–’                           โ”‚ 
 โ”‚                             core2             โ–ฎ                           โ”‚ 
 โ”‚                             corei7            โ–’                           โ”‚ 
 โ”‚                             corei7-avx        โ–’                           โ”‚ 
 โ”‚                             core-avx-i        โ–’                           โ”‚ 
 โ”‚                             atom              โ–’                           โ”‚ 
 โ”‚                             k8                โ†“                           โ”‚ 
 โ”‚                                                                           โ”‚ 
 โ”‚                                                                           โ”‚ 
 โ”‚                                  <Ok>                                
choose corei7

Install is now finished

Step 3:
Let us try installing one package โ€ฆI chose gimp



E: Could not get lock /var/lib/dpkg/lock-frontend. It is held by process 5261 (apt-ge
t)
N: Be aware that removing the lock file is not a solution and may break your system.
E: Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), is another
 process using it?
-----> Updating package lists <-----

N: Skipping acquire of configured file 'main/binary-i386/Packages' as repository 'fil
e:/var/cache/apt-build/repository apt-build InRelease' doesn't support architecture '
i386'
-----> Downloading source gimp (2.10.30-1build1) <-----

NOTICE: 'gimp' packaging is maintained in the 'Git' version control system at:
https://salsa.debian.org/gnome-team/gimp.git
Please use:
git clone https://salsa.debian.org/gnome-team/gimp.git
to retrieve the latest (possibly unreleased) updates to the package.
Need to get 31.8 MB of source archives.
dpkg-source: info: extracting gimp in gimp-2.10.30
dpkg-source: info: unpacking gimp_2.10.30.orig.tar.bz2
dpkg-source: info: unpacking gimp_2.10.30-1build1.debian.tar.xz
dpkg-source: info: using patch list from debian/patches/series
dpkg-source: info: applying 01_hurd_ftbfs.patch
dpkg-source: info: applying 02_hurd_ftbfs.patch
W: Download is performed unsandboxed as root as file 'gimp_2.10.30-1build1.dsc' could
n't be accessed by user '_apt'. - pkgAcquire::Run (13: Permission denied)
-----> Building gimp <-----
debchange warning: neither DEBEMAIL nor EMAIL environment variable is set
ebchange warning: building email address from username and FQDN
debchange: Did you see those 2 warnings?  Press RETURN to continue...

debchange warning: neither DEBEMAIL nor EMAIL environment variable is set
debchange warning: building email address from username and FQDN
debchange: Did you see those 2 warnings?  Press RETURN to continue...

dpkg-buildpackage: info: source package gimp
dpkg-buildpackage: info: source version 2.10.30-1build1+aptbuild1
dpkg-buildpackage: info: source distribution UNRELEASED
dpkg-buildpackage: info: source changed by root <root@trinity>
dpkg-buildpackage: info: host architecture amd64
 dpkg-source --before-build .
 debian/rules clean
dh clean
   dh_gnome_clean
   dh_clean
 debian/rules binary
dh binary
   dh_update_autotools_config
   debian/rules override_dh_autoreconf
make[1]: Entering directory '/var/cache/apt-build/build/gimp-2.10.30'
dh_autoreconf --as-needed
libtoolize: putting auxiliary files in '.'.
libtoolize: copying file './ltmain.sh'
libtoolize: putting macros in AC_CONFIG_MACRO_DIRS, 'm4macros'.
libtoolize: copying file 'm4macros/libtool.m4'
libtoolize: copying file 'm4macros/ltoptions.m4'
libtoolize: copying file 'm4macros/ltsugar.m4'
libtoolize: copying file 'm4macros/ltversion.m4'
libtoolize: copying file 'm4macros/lt~obsolete.m4'
configure.ac:469: warning: The macro `AC_TRY_COMPILE' is obsolete.
configure.ac:469: You should run autoupdate.
./lib/autoconf/general.m4:2847: AC_TRY_COMPILE is expanded from...
m4macros/detectcflags.m4:4: GIMP_DETECT_CFLAGS is expanded from...
configure.ac:469: the top level
configure.ac:472: warning: The macro `AC_TRY_COMPILE' is obsolete.
configure.ac:472: You should run autoupdate.
./lib/autoconf/general.m4:2847: AC_TRY_COMPILE is expanded from...
m4macros/detectcflags.m4:4: GIMP_DETECT_CFLAGS is expanded from...
configure.ac:472: the top level
configure.ac:479: warning: The macro `AC_TRY_COMPILE' is obsolete.
configure.ac:479: You should run autoupdate.
.....
Unpacking gimp (2.10.30-1build1+aptbuild1) ...
Selecting previously unselected package libgts-bin.
Preparing to unpack .../12-libgts-bin_0.7.6+darcs121130-5_amd64.deb ...
Unpacking libgts-bin (0.7.6+darcs121130-5) ...
Setting up liblab-gamut1:amd64 (2.42.2-6) ...
Setting up libgts-0.7-5:amd64 (0.7.6+darcs121130-5) ...
Setting up libpathplan4:amd64 (2.42.2-6) ...
Setting up libann0 (1.1.2+doc-7build1) ...
Setting up gimp-data (2.10.30-1build1+aptbuild1) ...
Setting up libcdt5:amd64 (2.42.2-6) ...
Setting up libcgraph6:amd64 (2.42.2-6) ...
Setting up libgimp2.0:amd64 (2.10.30-1build1+aptbuild1) ...
Setting up libgts-bin (0.7.6+darcs121130-5) ...
Setting up libgvc6 (2.42.2-6) ...
Setting up libgvpr2:amd64 (2.42.2-6) ...
Setting up graphviz (2.42.2-6) ...
Setting up gimp (2.10.30-1build1+aptbuild1) ...
Processing triggers for hicolor-icon-theme (0.17-2) ...
Processing triggers for gnome-menus (3.36.0-1ubuntu3) ...
Processing triggers for libc-bin (2.35-0ubuntu3.1) ...
Processing triggers for man-db (2.10.2-1) ...
Processing triggers for mailcap (3.70+nmu1ubuntu1) ...
Processing triggers for desktop-file-utils (0.26+mint2+vera) ...
root@trinity:/home/nevj# 
exit

Script done on 2023-06-10 21:27:14+10:00 [COMMAND_EXIT_CODE="0"]
nevj@trinity:~$ 

It worked, despite a few complaints. Gimp seems to run normally.

Step 4:
Before attempting apt-build world, there is a need to setup a list of all packages in /etc/apt/apt-build.list . We do this with

dpkg --get-selections | awk '{if ($2 == "install") print $1}'> /etc/apt/apt-build.list

Then we need to edit /etc/apt/apt-build.list to remove the compiler from the list . This is because we should not compile gcc or g++ from source. Compiling a compiler is a very difficult and multi-round process with many checks. Because everything depends on the compiler being correctly compiled, we are advised to leave it alone and accept the supplied binaries of gcc and g++.
I edited /etc/apt/apt-build.list and removed the following lines

g++
g++-11

gcc
gcc-11
gcc-11-base:amd64
gcc-12-base:amd64

What remains is just a long list of package names.

accountsservice
acl
acpi-support
acpid
add-apt-key
adduser
adwaita-icon-theme
adwaita-icon-theme-full
alsa-base
alsa-topology-conf
.....

Step 5:
Attempt a world build

root@trinity:/etc/apt# apt-build --yes --force-yes world

-----> Building package list <-----
-----> Installing build dependencies (for accountsservice=22.07.5-2ubuntu1.3) <-----

The following NEW packages will be installed:
......

Processing triggers for sgml-base (1.30) ...
W: --force-yes is deprecated, use one of the options starting with --allow instead.
-----> Updating package lists <-----
......
dpkg-source: info: extracting accountsservice in accountsservice-22.07.5

dpkg-source: info: unpacking accountsservice_22.07.5.orig.tar.xz
dpkg-source: info: unpacking accountsservice_22.07.5-2ubuntu1.3.debian.t
ar.xz
dpkg-source: info: using patch list from debian/patches/series
dpkg-source: info: applying 0001-formats-locale-property.patch
dpkg-source: info: applying 0002-create-and-manage-groups-like-on-a-debi
an-system.patch
dpkg-source: info: applying 0007-add-lightdm-support.patch
......
pkg-source: info: applying adduser_invocation.patch
dpkg-source: info: applying setlocked_signature.patch
W: --force-yes is deprecated, use one of the options starting with --allow instead.
W: Download is performed unsandboxed as root as file 'accountsservice_22.07.5-2ubuntu
1.3.dsc' couldn't be accessed by user '_apt'. - pkgAcquire::Run (13: Permission denie
d)
-----> Building accountsservice <-----
debchange warning: neither DEBEMAIL nor EMAIL environment variable is set
debchange warning: building email address from username and FQDN
debchange: Did you see those 2 warnings?  Press RETURN to continue...

debchange warning: neither DEBEMAIL nor EMAIL environment variable is set
debchange warning: building email address from username and FQDN
debchange: Did you see those 2 warnings?  Press RETURN to continue...

So it runs into these messages about missing environment variables DEBEMAIL or EMAIL.
Major problem because I refuse to sit there all night pressing return.
So I define the environment variable

export EMAIL=myemailaddress

Run it again โ€ฆ same message

debchange warning: neither DEBEMAIL nor EMAIL environment variable is set
debchange warning: building email address from username and FQDN
debchange: Did you see those 2 warnings?  Press RETURN to continue...

After 3 days of fiddling around I discover that what it really wants is to set the environment variable NAME. Nothing like a misleading error message to make my day (3days)

export NAME=myname

OK, solved that so run it again

oot@trinity:/home/nevj# apt-build --yes --force-yes world
-----> Rebuilding the world! <-----
-----> Building package list <-----
-----> Installing build dependencies (for accountsservice=22.07.5-2ubuntu1.3) <-----
Reading package lists... Done

......

Preparing to unpack .../adwaita-icon-theme_41.0-1ubuntu1+aptbuild5_all.deb ...
Unpacking adwaita-icon-theme (41.0-1ubuntu1+aptbuild5) over (41.0-1ubuntu1+aptbuild4) ...
Setting up adwaita-icon-theme-full (41.0-1ubuntu1+aptbuild5) ...
Setting up adwaita-icon-theme (41.0-1ubuntu1+aptbuild5) ...
W: --force-yes is deprecated, use one of the options starting with --allow instead.
Missing source package name for source_by_source().
root@trinity:/home/nevj# exit
exit

It drops out because it cant find the source code for package adwaita-icon-theme.

At this stage I am going to wind up and consider my options.
So far apt-build has shown that it

  • produces misleading error messages
  • is not configured properly and cant find the source code for at least one package.
  • Mint itself is fine. All the problems belong to apt-build.

I might back off and see if I can compile just the kernel.

1 Like

I have further evidence that apt-build has a defective configuration.
The Mint Software Manager told me that a language pack was missing.
It was gimp-help-en
Gimp was not installed until I compiled it with apt-build. Therefore apt-build missed out on installing this package that is required by Gimp.
It is beginning to look like it is unmaintained.

The apt-build man page is out of date. It defines the option --force-yes which is rejected by the running program with a warning

W: --force-yes is deprecated, use one of the options starting with --allow instead.

and the --allow options are nowhere on the man page.

The last line of the man page says it all

BUGS
       Many.

Compiling gives your computer a real workout.
Here is a shot of my system monitor while compiling gimp
Screenshot from 2023-06-10 21-13-25

Well it did not take long
I edited the file /etc/apt/apt-build.list , deleted all packages except the following

linux-base
linux-firmware
linux-generic
linux-headers-5.15.0-56
linux-headers-5.15.0-56-generic
linux-headers-generic
linux-image-5.15.0-56-generic
linux-image-generic
linux-libc-dev:amd64
linux-modules-5.15.0-56-generic
linux-modules-extra-5.15.0-56-generic
linux-sound-base

Then

root@trinity:/home/nevj# apt-build --yes --force-yes world
-----> Rebuilding the world! <-----
-----> Building package list <-----
-----> Installing build dependencies (for linux-base=4.5ubuntu9) <-----
Reading package lists... Done
Reading package lists... Done
......
W: Possible missing firmware /lib/firmware/amdgpu/sienna_cichlid_mes.bin for module amdgpu
W: Possible missing firmware /lib/firmware/amdgpu/navi10_mes.bin for module amdgpu
I: The initramfs will attempt to resume from /dev/sda3
I: (UUID=23785d73-fcac-40f2-bcd6-e2a77432bdf7)
I: Set the RESUME variable to override this.
W: --force-yes is deprecated, use one of the options starting with --allow instead.
linux-headers-5.15.0-56 will not be built because it doesn't have a source package.
Missing source package name for source_by_source().
root@trinity:/home/nevj# 

So it only got as far as linux-headers-5.15.0-56 and again could not find the source code.

That is enough for me. Apt-build belongs in the trash bin.
I shall do something else with my lovely Mint install.

apt-build left a few traces behind

root@trinity:/home/nevj# apt-get update
Get:1 file:/var/cache/apt-build/repository apt-build InRelease
Ign:1 file:/var/cache/apt-build/repository apt-build InRelease
Get:2 file:/var/cache/apt-build/repository apt-build Release [1,530 B]
Get:2 file:/var/cache/apt-build/repository apt-build Release [1,530 B]
Get:3 file:/var/cache/apt-build/repository apt-build Release.gpg
Ign:3 file:/var/cache/apt-build/repository apt-build Release.gpg
Hit:4 http://mirror.aarnet.edu.au/pub/ubuntu/archive jammy InRelease
Hit:5 http://mirror.aarnet.edu.au/pub/ubuntu/archive jammy-updates InRelease   
Hit:6 http://mirror.aarnet.edu.au/pub/ubuntu/archive jammy-backports InRelease 
Ign:7 https://mirror.aarnet.edu.au/pub/linuxmint-packages vera InRelease       
Hit:8 https://mirror.aarnet.edu.au/pub/linuxmint-packages vera Release       
Hit:10 http://security.ubuntu.com/ubuntu jammy-security InRelease
Reading package lists... Done
N: Skipping acquire of configured file 'main/binary-i386/Packages' as repository 'file:/var/cache/apt-build/repository apt-build InRelease' doesn't support architecture 'i386'

I think it is saying that the actual install of apt-build missed out on something related to the i386 architecture ?

The following apt-get upgrade went OK so I dont think apt-build has ruined my package system .
I might try removing it

root@trinity:/home/nevj# apt-get purge apt-build
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following package was automatically installed and is no longer required:
  libappconfig-perl
Use 'apt autoremove' to remove it.
The following packages will be REMOVED:
  apt-build*
0 to upgrade, 0 to newly install, 1 to remove and 10 not to upgrade.
After this operation, 155 kB disk space will be freed.
Do you want to continue? [Y/n] y
(Reading database ... 628192 files and directories currently installed.)
Removing apt-build (0.12.49+aptbuild1) ...
Processing triggers for man-db (2.10.2-1) ...
(Reading database ... 628174 files and directories currently installed.)
Purging configuration files for apt-build (0.12.49+aptbuild1) ...
root@trinity:/home/nevj# exit

So did it really purge the config files
before

evj@trinity:/etc/apt$ ls
apt-build.conf  apt-build.list.orig  auth.conf.d  preferences.d  sources.list.d
apt-build.list  apt.conf.d           keyrings     sources.list   trusted.gpg.d

after

nevj@trinity:/etc/apt$ ls
apt-build.list       apt.conf.d   keyrings       sources.list    trusted.gpg.d
apt-build.list.orig  auth.conf.d  preferences.d  sources.list.d

so apt-build.conf is gone but not apt-build.list, so remove it too

root@trinity:/etc/apt# cd sources.list.d
root@trinity:/etc/apt/sources.list.d# ls
official-package-repositories.list  official-source-repositories.list

and it has removed the source repo.

And just to check

root@trinity:/home/nevj# apt-get update
Hit:1 http://mirror.aarnet.edu.au/pub/ubuntu/archive jammy InRelease
Hit:2 http://mirror.aarnet.edu.au/pub/ubuntu/archive jammy-updates InRelease
Ign:3 https://mirror.aarnet.edu.au/pub/linuxmint-packages vera InRelease       
Hit:4 http://mirror.aarnet.edu.au/pub/ubuntu/archive jammy-backports InRelease 
Hit:5 https://mirror.aarnet.edu.au/pub/linuxmint-packages vera Release         
Hit:7 http://security.ubuntu.com/ubuntu jammy-security InRelease               
Reading package lists... Done                             
root@trinity:/home/nevj# 

That is OK now, none of this i386 rubbish.

So hopefully now I have a nice clean Mint.
I may have compiled versions of gimp and a few other packages, but they will be overwritten with updates.

Conclusion:
Apt-build is unusable. You might get away with compiling one package, but if you want to compile the whole system, use Gentoo.
Gentoo has the additional advantage that its packages are more recent.