# How to Build Ubuntu Package for Graphviz

**URL:** <https://forum.graphviz.org/t/how-to-build-ubuntu-package-for-graphviz/892>\
**Category:** Dev\
**Created:** [October 27, 2021, 3:18am UTC](https://forum.graphviz.org/t/how-to-build-ubuntu-package-for-graphviz/892 "2021-10-27T03:18:05Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![utkonos](https://avatars.discourse-cdn.com/v4/letter/u/958977/32.png) [@utkonos](https://forum.graphviz.org/u/utkonos)\
**Post date:** [October 27, 2021, 3:18am UTC](https://forum.graphviz.org/t/how-to-build-ubuntu-package-for-graphviz/892/1 "2021-10-27T03:18:05Z")

</div>

I’m trying to build my own graphviz package using latest stable source as .deb for Ubuntu. The official instructions for packaging contain an error in the basic example so are not usable currently.

I only want the bare minimum dependencies to support Radare2, so just libgd and libpango. The build and install process used below works flawlessly using standard `make install`. But the `checkinstall` process that replaces `make install` results in a package that fails with an error after the package is installed on a new VM.

```auto
/usr/local/bin/dot: error while loading shared libraries: libgvc.so.6: cannot open shared object file: No such file or directory

```

I do see what the problem is here, but I am unsure how to correct for this in the packaging process.

I’m trying checkinstall:  
[https://help.ubuntu.com/community/CheckInstall](https://help.ubuntu.com/community/CheckInstall)

Using the following process for building the package:

```auto
apt install build-essential libgd-dev libpango1.0-dev checkinstall
wget https://gitlab.com/api/v4/projects/4207231/packages/generic/graphviz-releases/2.49.3/graphviz-2.49.3.tar.gz
tar -zxvf graphviz-2.49.3.tar.gz
cd graphviz-2.49.3
./configure
make
checkinstall

```

Inside checkinstall these are the settings:

Should I create a default set of package docs? No  
Description:  
Graphviz with minimum dependencies required for Radare2 (libgd and libpango).

Maintainer: [root@example[.]com ]  
Summary: [Graphviz with minimum dependencies required for Radare2 (libgd and libpango).]  
Name: [graphviz]  
Version: [2.49.3]  
Release: [1]  
License: [GPL]  
Group: [checkinstall]  
Architecture: [amd64]  
Source location: [https[://]gitlab[.]com/api/v4/projects/4207231/packages/generic/graphviz-releases/2.49.3/graphviz-2.49.3.tar.gz ]  
Requires: [libgd3,libpango1.0-0]  
Provides: [graphviz]

Some of the files created by the installation are inside the build  
directory: /root/graphviz-2.49.3  
Should I exclude them from the package? Yes

---

<div class="post-metadata">

**Author:** ![smattr](https://sea2.discourse-cdn.com/graphviz/user_avatar/forum.graphviz.org/smattr/32/85_2.png) [@smattr](https://forum.graphviz.org/u/smattr)\
**Post date:** [October 27, 2021, 3:09pm UTC](https://forum.graphviz.org/t/how-to-build-ubuntu-package-for-graphviz/892/2 "2021-10-27T15:09:36Z")

</div>

If you just want to build Graphviz for your own personal use (not to distribute the .deb), you may want to follow [the procedure in the developers guide](https://gitlab.com/graphviz/graphviz/-/blob/main/DEVELOPERS.md#building) minus the `autogen.sh` step which is only necessary if you’re building from a repository checkout. It lets you install Graphviz to a custom directory. You’ll then need to use the `env` prefix in the section after that for running it, but you can wrap this up in a script.

---

<div class="post-metadata">

**Author:** ![utkonos](https://avatars.discourse-cdn.com/v4/letter/u/958977/32.png) [@utkonos](https://forum.graphviz.org/u/utkonos)\
**Post date:** [October 27, 2021, 3:38pm UTC](https://forum.graphviz.org/t/how-to-build-ubuntu-package-for-graphviz/892/3 "2021-10-27T15:38:43Z")

</div>

Thanks! I’m working on a project that will deploy to a large number of worker VMs. The speed of using a .deb package is ideal, but I will likely need to script a build from source until I sort out packaging.

---

<div class="post-metadata">

**Author:** ![smattr](https://sea2.discourse-cdn.com/graphviz/user_avatar/forum.graphviz.org/smattr/32/85_2.png) [@smattr](https://forum.graphviz.org/u/smattr)\
**Post date:** [October 28, 2021, 3:11pm UTC](https://forum.graphviz.org/t/how-to-build-ubuntu-package-for-graphviz/892/4 "2021-10-28T15:11:41Z")

</div>

Ah I see. In that case, you probably want to look at the steps ci/build.sh does.
