Build from Source: The Toolchain, Source Repository, User Privilege, Build Directory, Example, Download Source, Build Source, Examine Directory, Install Result
Developer Script: debcheckout, Build Dependency, Build Package, Lintian, Source Compile, debi, Deb Checksums, Show Source
Conclusion
Dependency
There are two main topics in package dependency,
the dependency itself, and reverse dependency.
Beside these two, there are other topic as well,
such as managing conflict that we do not cover here.
Dependency
Package that required by: such as man-db need groff-base and other.
This will show required parts of the package.
Almost equal to:
This apt show provide dependency too.
aptitude search also works too.
Reverse Dependency
Package that require: such as groff-base needed by man-db or other.
Almost equal to:
aptitude search also works too.
This aptitude why also provide reverse dependency.
Test
Removing groff-base would remove man-db.
Dotty
there are also graphviz output named dotty
Repository
Switch repository in Debian based is simple.
Configuration
Most of the time I manage repository using
sources.list
configuration directly in Debian based distribution.
I don’t know if there is better way.
Case: Other derivation may use different repository.
Case: Sometimes there is additional PPA as well,
inside /etc/apt/sources.list.d/ directory.
Policy
However if you insist using command line,
you can get a list anyway by using apt-cache policy
Add Repository
This require a few steps.
(1) Append the repository to /etc/apt/sources.list. I usually utilize text editor.
(2) Add the repository key to the machine, if needed such as in PPA case.
Or maybe using apt-key if necessary.
(3) Do not forget to apt update to refresh.
Note that Ubuntu based have this add-apt-repository command.
Mirror
Consider change our repository to nearest local server such as university.
No need any repository key.
We can update directly.
Distribution Upgrade
There are cases that a system need more than upgrade,
such as migrating python from python2 to python3,
or ncurse case, especially when many application involved.
Switching from one release to other release
require dist-upgrade.
I have never had issue with Debian,
but I experienced issues in Debian derivatives.
No need to dist-upgrade in rolling release
Now consider pulling oldstable jessie container.
And do some basic task so that we can edit sources.list.
From Jessie
To Stretch
Do not forget to update.
And dist-upgrade.
This example above using minimal install,
in this case upgrade is sufficient
and the same result with dist-upgrade.
Nothing to worry about, the command finished successfully.
Repository Pinning
Sometimes we need a package from unstable repository.
There are few reason, such as trying latest version,
or such version has not available yet in testing or stable.
I did when I curious about tomahawk while it was just landed in_unstable_.
Do not be afraid to do this as long you do not mess with system packages.
nmap Case
Consider have a look at this nmap case.
nmap has different version for stable and unstable.
https://packages.debian.org/search?keywords=nmap
stretch (stable): 7.40-1
sid (unstable): 7.60-1
nmap from sid (unstable) can be installed in stretch (stable).
Steps below.
New Docker for Stretch
Ww need a new docker,
because we use stable release for nmap.
Now update and upgrade silently using -qq option.
Stable nmap
Pinning Unstable
We need to switch the repository,
to contain both stable and unstable.
And give negative number in pinning preferences,
so that this unstable repository ignored,
except for direct install with target.
.
Make sure that system cannot be upgraded to unstable.
Unstable nmap
Have a look at thispolicy before we install nmap.
Install nmap with explicit target -t unstable.
Consider examine,
have a look at the nmap version difference.
Now we have unstable package in stable system.
What’s Next
There are still, build form source topic.
Consider finish reading [ Part Four ].