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.