[GNC] Idiots guide to building GNC 4.9 on Ubuntu 20.04LTS

davidcousens49 at gmail.com davidcousens49 at gmail.com
Tue Jan 4 06:38:17 EST 2022


Jeff,

If you are having difficulty Jeff you will have to tell us exactly what you have
done and which commands you have entered into the terminal and exactly what the
terminal output is to each command. We are not mind readers and we are not on
your system so unless you tell us we do not know what is happening, we don't
know. 

We need information to diagnose problems. Even worse a lot of us will not be on
Ubuntu but on other Linux distributions. There are sometimes subtle and
sometimes not so subtle differences to Ubuntu. The build instructions do assume
some general familiarity with building software on Linux and Linux terminal
operation.

If you go to your Ubuntu menu, you should find a heading called something like
Administration and it will have an entry with a name like Software Sources. If
you click on that you will get a dialogue up. It should have a tab on the LH
side with a name like Official Repositories and if you click on that there
should be an entry Optional Sources.  If there is a switch, checkbox or other
control labelled "Software code repositories" or similar make sure it is
selected/checked etc.


I have found for example that the apt -y switch does not work on Linux Mint. I
am not sure about Ubuntu as Linux Mint uses a modified apt command. David
Whiting's script was for Ubuntu 20.04 so it should have worked to install the
dependencies. 

One thing you will have to do is find the script file in the file manager and
check that it is marked for execution. If not the script won't run. You may have
to alter the file manager options to display the file permissions. They should
be "-rwxrwxr-x". The "x" in the last position has to be present.

If not, if you open a terminal in the directory containing the copy of the
script file, then the command

chmod +x <script name>.sh

will mark the script file as executable. Typing

./<script name>.sh 

in the terminal will then execute it

If that does not work then the following will help to establish whether the
dependencies have been installed. In any of the following substitute for any
descriptor of the form enclosed in angle brackets e.g. <script name>, the actual
name for the file on your system. In any output the descriptor will be replaced
with an appropriate name

Open a terminal and type in the following commands one at a time to check
whether the dependencies are installed or not.

sudo apt update
sudo apt upgrade
sudo apt install git
sudo apt build-dep gnucash
sudo apt install libboost-program-options1.71-dev

The first two commands will update and upgrade the apt-cache and upgrade any
installed packages. The last three lines should have the following lines in
their output if the dependencies are installed.  If not the commands will
install them.

"<package name> is is already the newest version (<version number>)
0 to upgrade, 0 to newly install, 0 to remove and 0 not to upgrade."

If not those commands should install the dependencies.


try this and come back and report what happens.

David Cousens


On Tue, 2022-01-04 at 00:49 -0600, Jeff wrote:
> On 12/24/21 8:30 AM, david whiting wrote:
> > On Fri, 24 Dec 2021 at 09:11, Jeff <beastmaster126 at hotmail.com> wrote:
> > 
> > [...]
> > > But it appears I am not even a day old computer programmer, after 40
> > > plus years of coding.  For the life of me I cannot get the 4.9 code and
> > > tools for Ubuntu to install.  I've followed every link I can find, even
> > > those that David Cousins provided and I still cannot get the source or
> > > dependencies to install or download.
> > > 
> > > Would someone please list for me in baby steps howto download and build
> > > GNC 4.9 for Ubuntu?
> > > 
> > Hi Jeff,
> > 
> > The script below will build version 4.9 on Ubuntu 20.04 LTS. I have
> > verified this on a clean installation of Ubuntu.
> > One thing that tripped me up a few times is remembering to tick
> > "Source Code" in the Software And Updates dialogue. If you don't do
> > this, it will fail.
> > Please note that I have used -y with apt install so it will install
> > and build without asking.
> > 
> > I will try to get around to putting this in the wiki to make it easier
> > for people to find.
> > 
> > === build.sh ===
> > 
> > ## Ubuntu 20.04
> > ## In "Software and Updates":
> > ## Tick "Source code"
> > ## Tick "Community-maintained free and open-source software (Universe)"
> > 
> > ## Change this if you want to build it somewhere else.
> > SOURCEDIR="$HOME/Documents/gnucash/source"
> > BUILDDIR="$HOME/Documents/gnucash/build"
> > 
> > ## Change this if you want to install it somewhere else.
> > INSTALLDIR=/opt/gnucash
> > 
> > sudo apt -y update
> > sudo apt -y upgrade
> > sudo apt -y install git
> > sudo apt -y build-dep gnucash
> > 
> > ## To build series 4 of gnucash on Ubuntu 20.04
> > sudo apt -y install libboost-program-options1.71-dev
> > 
> > mkdir -p $SOURCEDIR
> > mkdir -p $BUILDDIR
> > 
> > ## Clone gnucash source from git
> > git clone https://github.com/Gnucash/gnucash.git $SOURCEDIR
> > 
> > ## Checkout version 4.9
> > cd $SOURCEDIR
> > git checkout -b 4.9 4.9
> > 
> > cd $BUILDDIR
> > cmake -DCMAKE_INSTALL_PREFIX=$INSTALLDIR $SOURCEDIR
> > 
> > make
> > 
> > === End of build.sh ===
> > 
> > Fingers-crossed this will work for you.
> > 
> > 
> > David
> 
> I executed the above script but it did not build an executable version 
> of GNC.  Correction, it built an executable program, that immediately 
> started spouting error messages then even faster closed its terminal window.
> 
> A couple of posts remind to remember to "tick Source Code in the 
> Software And Updates dialogue" or the script would not work.  They fail 
> to mention for what PPA.
> 
> What PPA's do I need for GNC?  (on Ubuntu 20.04LTS)
> 
> The desktop icon file was also a complete gremlin. That issue may 
> resolve itself once I can successfully build a live, healthy, vivacious, 
> running version of 4.9 from source.
> 
> As of now I am renaming the thread from "how to remove both GNC 4.2 and 
> Flathub version 4.8 so can upgrade to 4.9 on Ubuntu 20.04LTS" to "Idiots 
> guide to building GNC 4.9 on Ubuntu 20.04LTS" as we have moved way past 
> removing 4.2 and Flathub 4.8.  Right now I feel like a CSC 101 student 
> in a CSC 401 class, even though I went to CSC 640 in college and 880 in 
> the real world, yet I cannot successfully build GNC.  Both irritating 
> and humiliating.
> 
> Somewhere I am overlooking that one simple first year programmers error.
> 



More information about the gnucash-user mailing list