Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

help needed to build a package from source

If none of the specific sub-forums seem right for your thread, ask here.
Message
Author
MagicPoulp
Posts: 431
Joined: 2018-11-05 21:30

help needed to build a package from source

#1 Post by MagicPoulp »

Please help me to understand how to build a package from source.

I tried to follow this tutorial given by Head_on_a_Stick on this forum.
http://forums.debian.net/viewtopic.php?f=16&t=38976
http://forums.debian.net/viewtopic.php?f=16&t=130057

On debian stable, I tried to build from source the package ruby from debian unstable.

The command devchange that is contained in the package devscripts is not installed. There is a debian stable backport for it.

When just running the basic commands, it will miss a dependency.

Code: Select all

> apt-get source ruby -t unstable
etc
> dpkg-buildpackage -rfakeroot -us -uc
dpkg-checkbuilddeps: error: Unmet build dependencies: debhelper (>= 9)

I tried to use build-dep, but it did not work.
> sudo apt-get build-dep debhelper
Reading package lists... Done
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 builddeps:debhelper : Depends: po4a but it is not installable
E: Unable to correct problems, you have held broken packages.

> sudo apt-get build-dep debhelper po4a
Reading package lists... Done
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 builddeps:debhelper : Depends: po4a but it is not installable
 builddeps:po4a : Depends: debhelper (>= 11) but it is not installable
                  Depends: docbook but it is not installable
                  Depends: docbook-xsl but it is not installable
                  Depends: gettext
                  Depends: libmodule-build-perl but it is not installable
                  Depends: libsgmls-perl but it is not installable
                  Depends: libterm-readkey-perl but it is not installable
                  Depends: libunicode-linebreak-perl but it is not installable
                  Depends: libyaml-tiny-perl but it is not installable
                  Depends: opensp but it is not installable
                  Depends: texlive-binaries
                  Depends: texlive-latex-base but it is not installable
                  Depends: xsltproc
E: Unable to correct problems, you have held broken packages.

--> Should I make a long line with all packages on the command build-dep?

--> Does build-dep actually install on the system the pacakges required to build a source package? Or is it just in a buffer for helping building source packages?

milomak
Posts: 2160
Joined: 2009-06-09 22:20
Been thanked: 1 time

Re: help needed to build a package from source

#2 Post by milomak »

have you addressed this part of the error message

Code: Select all

E: Unable to correct problems, you have held broken packages.
Desktop: A320M-A PRO MAX, AMD Ryzen 5 3600, GALAX GeForce RTX™ 2060 Super EX (1-Click OC) - Sid, Win10, Arch Linux, Gentoo, Solus
Laptop: hp 250 G8 i3 11th Gen - Sid
Kodi: AMD Athlon 5150 APU w/Radeon HD 8400 - Sid

MagicPoulp
Posts: 431
Joined: 2018-11-05 21:30

Re: help needed to build a package from source

#3 Post by MagicPoulp »

milomak wrote:have you addressed this part of the error message

Code: Select all

E: Unable to correct problems, you have held broken packages.
It seems to me the error means that the package po4a has many dependencies that are only in unstable and not in stable.

po4a is only in unstable and not in stable. it seems to me that the build-dep command should build a stable version of it.

Maybe I misunderstood the change to sources.list. With the configuration I have for apt, I can only reach the unstable repo using the pinning tag -t unstable. Maybe I should add -t unstable to the build-dep command.

xepan
Posts: 89
Joined: 2018-11-28 06:38

Re: help needed to build a package from source

#4 Post by xepan »

Not sure, but it seems to work here:

Code: Select all

user_CHROOT$ pwd
/home/user/Build/ruby-defaults-2.5.1
user_CHROOT$ ls ../*deb
../libruby_2.5.1_all.deb  ../ruby_2.5.1_i386.deb          ../ruby-dev_2.5.1_i386.deb
../ri_2.5.1_all.deb       ../ruby-all-dev_2.5.1_i386.deb  ../ruby-full_2.5.1_all.deb
user_CHROOT$
]

All i did was

Code: Select all

apt-get install devscripts build-essential.
Add:

Code: Select all

 deb-src http://deb.debian.org/debian sid main 

to sources.list and apt-get update
I ran

Code: Select all

apt-get build-dep ruby
but it installed nothing, so was superfluous.

Code: Select all

apt-get source ruby 
cd ruby-defaults-2.5.1
dpkg-buildpackage -us -uc
Not sure if you understood that already, but you do:
apt-get build-dep <package-you-want-to-compile>
Maybe i misunderstood something.

MagicPoulp
Posts: 431
Joined: 2018-11-05 21:30

Re: help needed to build a package from source

#5 Post by MagicPoulp »

What does build-dep do?

Does it modify the existing system? It should not for a local build change the system. It is strange that when I try it it says it will upgrade cmake.
I have restricted the preferences of apt so that it cannot fetch from unstable without the tag -t unstable.

When I say I am blocked, it is because I get long lists of packages to install from unstable. And it could corrupt my system.

Code: Select all

> sudo apt-get build-dep ruby
Reading package lists... Done
Picking 'ruby-defaults' as source package instead of 'ruby'
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 builddeps:ruby-defaults : Depends: debhelper (>= 9) but it is not installable
E: Unable to correct problems, you have held broken packages.
>:~/tmp/ruby-defaults-2.5.1$ sudo apt-get build-dep ruby -t unstable
Reading package lists... Done
Picking 'ruby-defaults' as source package instead of 'ruby'
Selected version '1:2.5.1' (unstable) for ruby-defaults
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages will be REMOVED:
  libcurl3
The following NEW packages will be installed:
  autopoint debhelper dh-autoreconf dh-strip-nondeterminism dwz gettext intltool-debian libarchive-zip-perl libcom-err2 libcurl4 libfile-stripnondeterminism-perl libncurses6
  librhash0 libunistring2 po-debconf
The following packages will be upgraded:
  cmake cmake-data curl libc-bin libc-dev-bin libc-l10n libc6 libc6:i386 libc6-dev libc6-dev-i386 libc6-dev-x32 libc6-i386 libc6-x32 libcomerr2 libncursesw6 libssl-dev libssl1.1
  libtinfo6 libuv1 locales
20 upgraded, 15 newly installed, 1 to remove and 1455 not upgraded.
Need to get 37.9 MB of archives.
After this operation, 22.3 MB of additional disk space will be used.
Do you want to continue? [Y/n] 

xepan
Posts: 89
Joined: 2018-11-28 06:38

Re: help needed to build a package from source

#6 Post by xepan »

apt-get build-dep pkg
will install the packages mentioned in debian/control file as Build-Depends: . (the Depends: too? not sure. probably).

Looks like you screwed your sources list. Post it (or them).

milomak
Posts: 2160
Joined: 2009-06-09 22:20
Been thanked: 1 time

Re: help needed to build a package from source

#7 Post by milomak »

MagicPoulp wrote:
milomak wrote:have you addressed this part of the error message

Code: Select all

E: Unable to correct problems, you have held broken packages.
It seems to me the error means that the package po4a has many dependencies that are only in unstable and not in stable.

po4a is only in unstable and not in stable. it seems to me that the build-dep command should build a stable version of it.

Maybe I misunderstood the change to sources.list. With the configuration I have for apt, I can only reach the unstable repo using the pinning tag -t unstable. Maybe I should add -t unstable to the build-dep command.
it most definitely is in stable

Code: Select all

$ apt-cache policy po4a
po4a:
  Installed: (none)
  Candidate: 0.55-1
  Version table:
     0.55-1 500
        500 http://debian.mirror.ac.za/debian testing/main amd64 Packages
        500 http://debian.mirror.ac.za/debian testing/main i386 Packages
        500 http://debian.mirror.ac.za/debian sid/main amd64 Packages
        500 http://debian.mirror.ac.za/debian sid/main i386 Packages
        500 http://ftp.is.co.za/debian testing/main amd64 Packages
        500 http://ftp.is.co.za/debian testing/main i386 Packages
        500 http://ftp.is.co.za/debian sid/main amd64 Packages
        500 http://ftp.is.co.za/debian sid/main i386 Packages
        500 http://debian.saix.net testing/main amd64 Packages
        500 http://debian.saix.net testing/main i386 Packages
        500 http://debian.saix.net sid/main amd64 Packages
        500 http://debian.saix.net sid/main i386 Packages
        500 http://deb-mir1.naitways.net/debian testing/main amd64 Packages
        500 http://deb-mir1.naitways.net/debian testing/main i386 Packages
        500 http://deb-mir1.naitways.net/debian sid/main amd64 Packages
        500 http://deb-mir1.naitways.net/debian sid/main i386 Packages
     0.47-2 500
        500 http://debian.mirror.ac.za/debian stable/main amd64 Packages
        500 http://debian.mirror.ac.za/debian stable/main i386 Packages
        500 http://ftp.is.co.za/debian stable/main amd64 Packages
        500 http://ftp.is.co.za/debian stable/main i386 Packages
        500 http://debian.saix.net stable/main amd64 Packages
        500 http://debian.saix.net stable/main i386 Packages
        500 http://deb-mir1.naitways.net/debian stable/main amd64 Packages
        500 http://deb-mir1.naitways.net/debian stable/main i386 Packages
Desktop: A320M-A PRO MAX, AMD Ryzen 5 3600, GALAX GeForce RTX™ 2060 Super EX (1-Click OC) - Sid, Win10, Arch Linux, Gentoo, Solus
Laptop: hp 250 G8 i3 11th Gen - Sid
Kodi: AMD Athlon 5150 APU w/Radeon HD 8400 - Sid

User avatar
stevepusser
Posts: 12930
Joined: 2009-10-06 05:53
Has thanked: 41 times
Been thanked: 71 times

Re: help needed to build a package from source

#8 Post by stevepusser »

Debhelper 10 is also standard in Stretch, so you either started out with a broken system, or broke it in the attempt to get a newer ruby. Your software sources.list is probably quite interesting.
MX Linux packager and developer

MagicPoulp
Posts: 431
Joined: 2018-11-05 21:30

Re: help needed to build a package from source

#9 Post by MagicPoulp »

OK thank you for the comments. Yes my system is corrupted since debhelper should be available.

The reason was because of my preferences file with a bad priority on the release branch. Now it works.

MagicPoulp
Posts: 431
Joined: 2018-11-05 21:30

Re: help needed to build a package from source

#10 Post by MagicPoulp »

Please explain. Does the command below really require to install several packages on the system to build a source? Can't it be neutral and not impact the system with no installation?

Code: Select all

sudo apt-get build-dep ruby
Reading package lists... Done
Picking 'ruby-defaults' as source package instead of 'ruby'
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following NEW packages will be installed:
  autopoint debhelper dh-autoreconf dh-strip-nondeterminism gettext intltool-debian libarchive-zip-perl libfile-stripnondeterminism-perl po-debconf
0 upgraded, 9 newly installed, 0 to remove and 236 not upgraded.
Need to get 3,302 kB of archives.
After this operation, 10.2 MB of additional disk space will be used.

xepan
Posts: 89
Joined: 2018-11-28 06:38

Re: help needed to build a package from source

#11 Post by xepan »

I for one will probably not be able to help with such a confusing situation, but for others being able to help you later, you may provide the following info
The output of the command:

Code: Select all

apt-cache policy
That will probably cover the following already. If so, just omit:
whatever repos you have in /etc/apt/sources.list.d # looks as if there was no sid or such, apt-get update would have listed them. Just post them anyway,
content of /etc/apt/conf /etc/apt/conf.d and /etc/apt/preferences and preferences.d #whatever you find in /etc/apt sounding like "conf" or "preferences"

Well possible more info would be helpful, but the above is what i can think of for now.
Please explain. Does the command below really require to install several packages on the system to build a source? Can't it be neutral and not impact the system with no installation?
yes and
probably neutral, but quite a few prefer to "build" packages in a chroot anyway (or with pbuilder, etc). quick search gives renv/ruby-build
chroot might be a solution for you to work around the restrictions you got (i doubt it, but you might want to think about it).

is it only about building ruby? If so there might well be a solution similar to perlbrew for perl (install versions of perl in the users home).

MagicPoulp
Posts: 431
Joined: 2018-11-05 21:30

Re: help needed to build a package from source

#12 Post by MagicPoulp »

It is fine now. I could build ruby from source. I did not know about chroot and pbuilder. Thanks for the information.

Code: Select all

find .
.
./debian
./debian/ruby-dev.substvars
./debian/ruby
./debian/ruby/usr
./debian/ruby/usr/bin
./debian/ruby/usr/bin/ruby
./debian/ruby/usr/bin/rdoc
./debian/ruby/usr/bin/ri
./debian/ruby/usr/bin/irb
./debian/ruby/usr/bin/gem
./debian/ruby/usr/bin/erb
./debian/ruby/usr/share
./debian/ruby/usr/share/man
./debian/ruby/usr/share/man/man1
./debian/ruby/usr/share/man/man1/rdoc.1.gz
./debian/ruby/usr/share/man/man1/erb.1.gz
./debian/ruby/usr/share/man/man1/gem.1.gz
./debian/ruby/usr/share/man/man1/irb.1.gz
./debian/ruby/usr/share/man/man1/ruby.1.gz
./debian/ruby/usr/share/man/man1/ri.1.gz
./debian/ruby/usr/share/doc
./debian/ruby/usr/share/doc/ruby
./debian/ruby/usr/share/doc/ruby/README.Debian
./debian/ruby/usr/share/doc/ruby/NEWS.Debian.gz
./debian/ruby/usr/share/doc/ruby/copyright
./debian/ruby/usr/share/doc/ruby/changelog.gz
./debian/ruby/DEBIAN
./debian/ruby/DEBIAN/md5sums
./debian/ruby/DEBIAN/postinst
./debian/ruby/DEBIAN/preinst
./debian/ruby/DEBIAN/control
./debian/ruby-full
./debian/ruby-full/usr
./debian/ruby-full/usr/share
./debian/ruby-full/usr/share/doc
./debian/ruby-full/usr/share/doc/ruby-full
./debian/ruby-full/usr/share/doc/ruby-full/NEWS.Debian.gz
./debian/ruby-full/usr/share/doc/ruby-full/copyright
./debian/ruby-full/usr/share/doc/ruby-full/changelog.gz
./debian/ruby-full/DEBIAN
./debian/ruby-full/DEBIAN/md5sums
./debian/ruby-full/DEBIAN/control
./debian/ruby-all-dev.debhelper.log
./debian/ruby.substvars
./debian/ruby-full.debhelper.log
./debian/debhelper-build-stamp
./debian/files
./debian/rules
./debian/ri.debhelper.log
./debian/ruby.debhelper.log
./debian/README.Debian
./debian/ri.substvars
./debian/ruby-full.substvars
./debian/dump_data.rb
./debian/ruby-all-dev-depends
./debian/ruby.postinst
./debian/ruby-all-dev.substvars
./debian/libruby.debhelper.log
./debian/newruby
./debian/ruby.postinst.in
./debian/ri
./debian/ri/usr
./debian/ri/usr/share
./debian/ri/usr/share/doc
./debian/ri/usr/share/doc/ri
./debian/ri/usr/share/doc/ri/NEWS.Debian.gz
./debian/ri/usr/share/doc/ri/copyright
./debian/ri/usr/share/doc/ri/changelog.gz
./debian/ri/DEBIAN
./debian/ri/DEBIAN/md5sums
./debian/ri/DEBIAN/control
./debian/ruby-all-dev.install
./debian/NEWS
./debian/version-check
./debian/source
./debian/source/format
./debian/tests
./debian/tests/smoke-test
./debian/tests/wheezy2jessie.control
./debian/tests/wheezy2jessie-ruby-version
./debian/tests/wheezy2jessie-apt-listbugs-ruby1.8
./debian/tests/control
./debian/tests/ruby-all-dev
./debian/libruby
./debian/libruby/usr
./debian/libruby/usr/share
./debian/libruby/usr/share/doc
./debian/libruby/usr/share/doc/libruby
./debian/libruby/usr/share/doc/libruby/NEWS.Debian.gz
./debian/libruby/usr/share/doc/libruby/copyright
./debian/libruby/usr/share/doc/libruby/changelog.gz
./debian/libruby/DEBIAN
./debian/libruby/DEBIAN/md5sums
./debian/libruby/DEBIAN/control
./debian/control
./debian/ruby-all-dev
./debian/ruby-all-dev/usr
./debian/ruby-all-dev/usr/lib
./debian/ruby-all-dev/usr/lib/ruby
./debian/ruby-all-dev/usr/lib/ruby/vendor_ruby
./debian/ruby-all-dev/usr/lib/ruby/vendor_ruby/ruby_debian_dev.rb
./debian/ruby-all-dev/usr/share
./debian/ruby-all-dev/usr/share/doc
./debian/ruby-all-dev/usr/share/doc/ruby-all-dev
./debian/ruby-all-dev/usr/share/doc/ruby-all-dev/NEWS.Debian.gz
./debian/ruby-all-dev/usr/share/doc/ruby-all-dev/copyright
./debian/ruby-all-dev/usr/share/doc/ruby-all-dev/changelog.gz
./debian/ruby-all-dev/DEBIAN
./debian/ruby-all-dev/DEBIAN/md5sums
./debian/ruby-all-dev/DEBIAN/control
./debian/ruby-dev
./debian/ruby-dev/usr
./debian/ruby-dev/usr/lib
./debian/ruby-dev/usr/lib/x86_64-linux-gnu
./debian/ruby-dev/usr/lib/x86_64-linux-gnu/pkgconfig
./debian/ruby-dev/usr/lib/x86_64-linux-gnu/pkgconfig/ruby.pc
./debian/ruby-dev/usr/share
./debian/ruby-dev/usr/share/doc
./debian/ruby-dev/usr/share/doc/ruby-dev
./debian/ruby-dev/usr/share/doc/ruby-dev/NEWS.Debian.gz
./debian/ruby-dev/usr/share/doc/ruby-dev/copyright
./debian/ruby-dev/usr/share/doc/ruby-dev/changelog.gz
./debian/ruby-dev/DEBIAN
./debian/ruby-dev/DEBIAN/md5sums
./debian/ruby-dev/DEBIAN/control
./debian/ruby.links
./debian/libruby.substvars
./debian/copyright
./debian/ruby.preinst
./debian/changelog
./debian/ruby-dev.debhelper.log
./debian/compat
./ruby_debian_dev.rb

MagicPoulp
Posts: 431
Joined: 2018-11-05 21:30

Re: help needed to build a package from source

#13 Post by MagicPoulp »

Does chroot allow to install programs in a sandbox way?

Can one install docker in a chroot?

The documentation says it fakes the root folder. But will the program be runnable?
https://wiki.debian.org/chroot

MagicPoulp
Posts: 431
Joined: 2018-11-05 21:30

Re: help needed to build a package from source

#14 Post by MagicPoulp »

And what does the extension "~bpo50+1" mean in the first tutorial link I gave? Why a so strange notation?
http://forums.debian.net/viewtopic.php?f=16&t=38976

bp = backport I guess.

MagicPoulp
Posts: 431
Joined: 2018-11-05 21:30

Re: help needed to build a package from source

#15 Post by MagicPoulp »

For gcc 8, the package version looks like this:

4:8.1.0-1

Why a prefix "4:" and a sufix with a dash "-1" ?

This prefix can cause confusion because the version of gcc is not 4. It is 8.

Code: Select all

dpkg -s gcc
Package: gcc
Status: install ok installed
Priority: optional
Section: devel
Installed-Size: 45
Maintainer: Debian GCC Maintainers <debian-gcc@lists.debian.org>
Architecture: amd64
Source: gcc-defaults (1.178)
Version: 4:8.1.0-1

User avatar
stevepusser
Posts: 12930
Joined: 2009-10-06 05:53
Has thanked: 41 times
Been thanked: 71 times

Re: help needed to build a package from source

#16 Post by stevepusser »

So many questions!

The guide which recommended "~bpo50+1" dates back to Debian 5. You can actually put anything you want instead--the important part is the tilde "~" at the beginning, which will make it a lower version than the original. This is important if you want to do a smooth in-place upgrade to the next Debian release, and want that release's version to upgrade over your backport instead of having it stay installed and possibly not work.

The numbers with the colon at the beginning of the version are called epochs, and are usually used to fix packager's mistakes (at least in my case :oops:) A version with a higher epoch number will always be seen as higher than one with a lower one, no matter what the actual version is.

But you should read the Debian packager's manual if you want these answers and more.
MX Linux packager and developer

MagicPoulp
Posts: 431
Joined: 2018-11-05 21:30

Re: help needed to build a package from source

#17 Post by MagicPoulp »

Thank you.

What about the previous question?

Does chroot allow to install programs in a sandbox way?

Can one install docker in a chroot?

The documentation says it fakes the root folder. But will the program be runnable?
https://wiki.debian.org/chroot

xepan
Posts: 89
Joined: 2018-11-28 06:38

Re: help needed to build a package from source

#18 Post by xepan »

#chroot /media/debian_chroot
DEBIAN_CHROOT# apt-get install lynx
...
...
...
DEBIAN_CHROOT# which lynx
/usr/bin/lynx
DEBIAN_CHROOT#


https://help.ubuntu.com/community/BasicChroot

In general the default answer:
tias
try it and see.

MagicPoulp
Posts: 431
Joined: 2018-11-05 21:30

Re: help needed to build a package from source

#19 Post by MagicPoulp »

But how can an application mix things it needs from the real root folder and from the fake root folder?

If you run docker, you need to use things only the real root has access to.

Is there a way to duplicate the dependency of the root to sandbox?

xepan
Posts: 89
Joined: 2018-11-28 06:38

Re: help needed to build a package from source

#20 Post by xepan »

MagicPoulp wrote:But how can an application mix things it needs from the real root folder and from the fake root folder?
It doesn't mix things.

At least not usually, crap knows if and how this is possible.
ls /media/debian_chroot/
bin boot dev etc home lib media mnt opt proc root run sbin srv sys tmp usr var
$
Just a typical filesystem, and you enter it via "chroot /path/to/"
Well: you usually do mount proc, sys and dev from the host-system, you can get away without, depending on what you are planning to do.

And if you want to run docker, then run docker.

Post Reply