How do make a .deb package that reconfigures itself when dependencies are upgraded
I need to build a deb for my application that adjusts some links in my system when installed (I do that in my postinst script). However, when a dependency is upgraded, I might also need to adjust my links. So, ideally I want my prerm (to remove all the links I created) und my postinst (to reestablish them again) to be called whenever my dependencies are updated. Is there a way to force this behavior for my package? If not, is there any other way I can achieve my goal, i.e., some magic script that is called on dependency changes?
See also questions close to this topic
modprobe unknown symbol using existing kernel module
I'm writing a kernel module which uses an existing function (nf_conntrack_in()) from a netfilter kernel module (nf_conntrack) and am having dependency issues.
My module compiles fine, i'm using the Module.symvers from the kernel build so kbuild is aware of the symbol during compilation.
I used depmod -a to ensure that modprobe is aware of the dependancy (my module is called proxy):
line in modules.dep:
I know the symbol is in the kernel because it is in /proc/kallsyms:
ffffffffa06465b0 t nf_conntrack_in [nf_conntrack]
Evrythings seems good to go but when I modprobe my module i ge the following error:
modprobe: ERROR: could not insert 'proxy': Unknown symbol in module, or unknown parameter
and the kernel log states:
proxy: Unknown symbol nf_conntrack_in
Anyone have any suggestion on how to debug/resolve this further?
I have to install Ansible on offline RHEL
While doing it with RPMs, lot of recursive dependencies. How can I get it done quickly ?
Should you shade your dependencies?
For my job I use
Sparkevery day. One of the problems comes from dependency conflicts. I can't help but think that they would all go away if people released their jars already shaded to their own namespace.
For internal jars, I'm considering doing this for all our dependencies. Other than a small bit of work, I'm seeing this as a good idea. Is there any drawbacks/risks I'm missing?
Debian 8 apt-get connection refused
No matter what I do, I receive enough weird behavior from apt on my Jessie. In case I run
apt-get update, I see it downloading all package lists and after that following message is displayed:
Error connecting: could not connect: Connection is refused
The problem is that no address is displayed. So it looks like it tries to update package list from empty repo entry. I've tried to reset my sources.list with no effect.
Since all repositories I have in my source list updated their package lists successfully before error appeared, I tried to ignore it and run, my upgrade which leads to somewhat similar to usual update sequence, but the error appeared:
Error connecting: could not connect: Connection is refused E: Sub-process /usr/bin/dpkg returned an error code (1).
Note once again: no URI is provided for "broken repo entry."
Difference between dpkg -l and apt list
I have spin up a new amazon ubuntu machine for installing docker.
When I type apt list | grep docker I am getting the below output.
root@ubuntu:/home/rhost1/Desktop# apt list | grep docker WARNING: apt does not have a stable CLI interface. Use with caution in scripts. cockpit-docker/xenial-backports,xenial-backports 148-1~ubuntu16.04.1 all docker/xenial 1.5-1 amd64 docker-ce/xenial 17.06.2~ce-0~ubuntu amd64 [upgradable from: 17.06.0~ce-0~ubuntu] docker-compose/xenial-updates,xenial-updates 1.8.0-2~16.04.1 all docker-doc/xenial-updates,xenial-updates 1.12.6-0ubuntu1~16.04.1 all docker-registry/xenial 2.3.0~ds1-1 amd64 docker.io/xenial-updates 1.12.6-0ubuntu1~16.04.1 amd64 golang-docker-dev/xenial-updates,xenial-updates 1.12.6-0ubuntu1~16.04.1 all golang-github-docker-containerd-dev/xenial-updates,xenial-updates 0.2.5-0ubuntu1~16.04.1 all golang-github-docker-distribution-dev/xenial,xenial 2.3.0~ds1-1 all golang-github-docker-docker-dev/xenial-updates,xenial-updates 1.12.6-0ubuntu1~16.04.1 all golang-github-docker-go-units-dev/xenial,xenial 0.3.0-1 all golang-github-docker-libkv-dev/xenial,xenial 0.1.0-2 all golang-github-docker-libtrust-dev/xenial,xenial 0.0~git20150526.0.9cbd2a1-1 all golang-github-docker-notary-dev/xenial,xenial 0.1~ds1-1 all golang-github-docker-spdystream-dev/xenial,xenial 0.0~git20151103.0.4d80814-1 all golang-github-fsouza-go-dockerclient-dev/xenial,xenial 0.0+git20150905-1 all golang-github-opencontainers-runc-dev/xenial-updates,xenial-updates 1.0.0~rc2+docker1.12.6-0ubuntu1~16.04.1 all golang-github-samalba-dockerclient-dev/xenial,xenial 0.0~git20150905.0.77b723e-1 all kdocker/xenial 4.6-2 amd64 libnss-docker/xenial 0.01-1 amd64 ovn-docker/xenial-updates 2.5.2-0ubuntu0.16.04.1 amd64 python-docker/xenial-updates,xenial-updates 1.9.0-1~16.04.1 all python-dockerpty/xenial-updates,xenial-updates 0.4.1-1~16.04.1 all python3-docker/xenial-updates,xenial-updates 1.9.0-1~16.04.1 all python3-dockerpty/xenial-updates,xenial-updates 0.4.1-1~16.04.1 all ruby-docker-api/xenial,xenial 1.22.2-1 all runc/xenial-updates 1.0.0~rc2+docker1.12.6-0ubuntu1~16.04.1 amd64 systemd-docker/xenial 0.2.1+dfsg-1 amd64 vim-syntax-docker/xenial-updates,xenial-updates 1.12.6-0ubuntu1~16.04.1 all
Where as docker commands confirms that docker is not installed at all.
Same is double checked, when I have typed dpkg -l | grep docker, even it is not showing any docker packages.
Why apt list | grep docker is showing the packages? what do they exactly mean?
Note: ubuntu version is ubuntu-xenial-16.04-amd64.
ubuntu server installation with postgresql server using preseed fails
I am trying make unattended ubuntu-server-16.04.3 iso image. I have updated isolinux.cfg and txt.cfg to take the new preseed file. All I need is unattended ubuntu server with postgres server running.
Here is my seed file:
I didn't add any new deb's. Same ISO image if tried manually, I can select postgresql server from option and I can easily complete it.
I have tried so many links and it always ended with below error as in attached image.
If i remove postgresql from preseed file, i can complete the installation without any errors.
Can anyone point me how to resolve it? Anything I am missing/doing wrong in preseed file?
PS: partitions are done as part of kickstart file
How to pack my own code which uses openCV to a .deb?
I posted this same question on askubuntu. But people refused to answer and asked me to ask my question here.
I am running Ubuntu 16.04 and wrote two pieces of code. One which is in C++ and the other which is in Python. Below you will find everything which is related to my C++ code.
I would like to know how I can pack each code in a .deb so that the other person doesn't have any issues related to dynamic linking and doesn't have to install openCV on its machine.
So far I tried to simply create a folder which has the following structure:
~/Desktop/myTestDEB$ tree . ├── DEBIAN │ └── control └── usr └── bin ├── main └── part1.png 3 directories, 3 files
Where main is the executable which I already compiled and afterwards copied to this folder. Which I then packed this folder to a .deb package using:
sudo dpkg-deb --build myTestDEB/
But when the other person installs my .deb on his laptop he gets this error:
main: error while loading shared libraries: libopencv_highgui.so.3.3: cannot open shared object file: No such file or directory
Which is a dynamic linking error. I would have thought that packaging everythinginto a .deb file would solve anything related to dynamic linking.
What should I do to solve this issue? What if I want to do the same for Python code?
How can I use CMake to install a script?
I have a project that builds several executables and also installs them. For the executables the relevant CMake code is:
add_executable(foo "foo.cpp") add_executable(bar "bar.cpp;qux.cpp") install(TARGETS foo bar "/usr/bin")
Then I create a .deb package and when it installs I can run
barfrom the command line. I want to do something like this:
add_executable(foo "foo.cpp") add_executable(bar "bar.cpp;qux.cpp") add_script(hello "hello.sh") install(TARGETS foo bar hello)
hellois executable from the command line. But there isn't actually a CMake command called
add_script. How can I achieve this?
How to clear apt-conf list options in apt-get command line options
I'm trying to use the
#clearsyntax to clear the
DPkg::Pre-Install-Pkgsoptions on command-line
apt-get, but I haven't had any luck. I've tried stuff like
apt-get -o DPkg::Pre-Install-Packages='#clear', but nothing seems to clear it
I'm testing on Ubuntu (17.04) using
apt-config -o DPkg::Pre-Install-Packages='#clear' dump