date
int64
1,220B
1,719B
question_description
stringlengths
28
29.9k
accepted_answer
stringlengths
12
26.4k
question_title
stringlengths
14
159
1,282,094,234,000
Is it possible to specify the dependency of another library that is within a specific range of versions? Like: Depends: Lib (<= 4) -- dependency of a library that has version less or equal to 4 Depends: Lib (>= 2) -- dependency of a library that has version more or equal to 2 But could we combine them? So that the overall constraint expressed the version is more or equal to 2 and less or equal to 4? PS: this is just an academic question, out of curiosity (since I couldn't find it in debian http://www.debian.org/doc/debian-policy/ch-relationships.html)
I didn't test it but as comma is equal to an and this could work: Depends: Lib (<= 4), Lib (>= 2)
Specifying a dependency of a version greater than N and less than M
1,282,094,234,000
I am looking for a succinct howto on the basics.
The ubuntu packaging guide is a good introduction. The rest you can learn by studying existing packages, and reading manuals (CDBS, and of course Debian Policy). However, as directhex said, it depends a lot on the kind of package you work on. For RPM, I liked the Mandriva wiki, and some Fedora RPM Guide and Guidelines.
Where are some good guides for making packages (deb, rpm, etc)?
1,526,491,902,000
I'd like to embed checksum information into file, that I transfer. It's tar.gz or tar.xz file and I can only transfer one file to remote side. How do you recommend I embed checksum information? I want checksum of whole archive, not it's contents (I'd like to check it's integrity "before" unpacking). I know I could pack it again in some format supporting checksums (like rar) but it's computational cost to "repack" stuff, just for adding checksum (on the other hand I don't like rar format). So preferred would be something like gzip & gunzip etc , but for adding, checking, and removing checksum. Any tools, ideas, scripts, workarounds? Am I right .xz and .gz support concatenation? Maybe it's worth to use this feature to append compressed checksum on the end of file ?
cat file.gz file.gz.sig > transfer_me.signed Then, on the remote host, you split out the appended checksum using tail -c length_of_the_checksum_info transfer_me.signed > file.gz.sig head -c -length_of_the_checksum_info transfer_me.signed > file.gz Note the minus in the second command. The length depends on the type of checksum you use. You can have just md5sum file.gz | cut -d ' ' -f 1 > file.gz.sig Notice also, that in this way you can also unpack the transfer_me.signed file straight away without splitting, because tar will ignore the trailing "garbage". A similar solution, with additional encryption or scrambling mechanisms, is used for signing updates for many mobile devices - for example the Amazon Kindles. But in their case, archive file identification is undesired, so they put all the fingerprinting information at the beginning of an update file.
Appending checksum information to file
1,526,491,902,000
Which distros support RPMs? Which distros support DEB packages? What other distros and package formats exists? Here is what I think I know, but am interested in getting a more precise answer: RPM - Redhat, Fedora, CentOS, SUSE DEB - Debian, Ubuntu, Pacman - Arch tar.gz - all, depends on what is in the compressed file though Lots of others probably in the long tail. I know you can use 'alien' to convert RPM to DEB, but it isn't installed by default in new Ubuntu setup so not counting that.
There's a list of Linux Package Formats on wikipedia here and a list of common package management systems here.
What are the different software packaging formats and which distributions support them as part of base install?
1,526,491,902,000
Since RPM 4.7, there has been the ability to specify that a file in an RPM package should be installed with capabilities set (via %caps). Is there a similar feature for Debian packages?
Sadly, no. There isn't a way to make dpkg use file capabilities, and apparently nobody has ever asked, though the library itself is available. I skimmed through the Debian Policy Manual, and there isn't a single entry that reference this feature. That said, you can use dh_override_install (if you use debhelper), pre/post maintainer scripts or modifying the debian/rules file to reproduce this behavior, but I don't see any obviously easy way to implement it.
Can capabilities be specified in Debian packages?
1,526,491,902,000
If I install a binary with non-standard prefix, e.g. /opt/bin/foo, which needs some static files from /opt/share/foo, how does it find them? Using back references relative to the executable (../share/foo)? Hardcoded at compile time? What's the idiomatic way for an application to handle variable installation prefix? Should all directories be prefixed? (what about /var?)
It's common to hard-code such references at compile time, and perhaps provide a command line option or environment variable to override the compile-time default. Often the program just remembers the location of one configuration file (typically under /etc) where any compile-time defaults can be overridden. This approach makes most sense for open source software that is compiled by the same people that make the operating system, as part of a Linux distribution or BSD ports. For applications distributed in a binary form, the usual approach is to locate the application binary from its zeroth argument. By convention, the zeroth argument to execve (i.e. argv[0]) is the path to the binary (it's up to the caller, often a shell, to respect the convention). If argv[0] doesn't contain any /, the application should perform $PATH lookup on it.
How do idiomatic Unix programs detect what prefix they are installed under?
1,526,491,902,000
Is there a way to predict when the next release will be out? I read somewhere that it has to do with number of bugs remaining in the testing branch. Could someone please explain how this works and when the next release will happen based on what variables?
See Debian Release Management; for Debian 9, it stated: As always, Debian 9 “Stretch” will be released “when it’s ready”. and that’s the general rule for all releases. The planned release date for Debian 9, June 17 2017, was announced on May 26 of that year. The planned release date for Debian 10, July 6 2019, was announced on June 11 of that year. (Both releases happened on the planned date.) Debian 11 is currently frozen, and the release is planned for August 14 2021. Generally speaking, you’re right that “when it’s ready” correlates to the number of (release-critical) bugs in the testing distribution, to a large extent. The release team give regular updates on debian-devel-announce, which are linked from the release management page. These updates list the items which still need to be fixed (including bugs, but not only), and explain how you can help; that’s mainly: test the current testing distribution; help triage bugs; help fix bugs. The best way of knowing when a Debian release will happen is to help fix the issues preventing it — as the number of such issues goes down, so does the release date get closer. You can track the release-critical bugs; those which matter for the next release are counted as “number concerning the next release”. Other important ingredients for a Debian release are its installer and its documentation.
How can we predict when the next Debian release will be out?
1,526,491,902,000
When I run fpm with --rpm-sign I get the following error, rpm: /usr/bin/rpmsign: No such file or directory I am using CentOS
This error occurs because the utility rpmsign is something you have to install. The package you want is rpm-sign You'll want to do yum install rpm-sign
fpm: rpm: /usr/bin/rpmsign: No such file or directory
1,526,491,902,000
I created a very simple C project and want to build a debian package from it. Manually building the C project via the Makefile works as expected, it build the binary and can be installed in /usr/local/bin. When trying to build a debian packages however it fails with dh_usrlocal: error: debian/myhelloworld/usr/local/bin/myhelloworld is not a directory The Makefile looks like this: prefix = /usr/local/bin all: src/myhelloworld src/hello: src/myhelloworld.c @echo "CFLAGS=$(CFLAGS)" | \ fold -s -w 70 | \ sed -e 's/^/# /' $(CC) $(CPPFLAGS) $(CFLAGS) $(LDCFLAGS) -o $@ $^ install: src/myhelloworld install -D src/myhelloworld \ $(DESTDIR)$(prefix)/myhelloworld clean: -rm -f src/myhelloworld distclean: clean uninstall: -rm -f $(DESTDIR)$(prefix)/myhelloworld .PHONY: all install clean distclean uninstall The debian directory is created with debmake and i use debuild for building. The project structure looks like: . ├── debian │ ├── changelog │ ├── control │ ├── copyright │ ├── debhelper-build-stamp │ ├── files │ ├── myhelloworld │ │ ├── DEBIAN │ │ │ ├── control │ │ │ └── md5sums │ │ └── usr │ │ ├── myhelloworld │ │ └── share │ │ └── doc │ │ └── myhelloworld │ │ ├── changelog.Debian.gz │ │ ├── copyright │ │ └── README.Debian │ ├── myhelloworld.debhelper.log │ ├── myhelloworld.substvars │ ├── patches │ │ └── series │ ├── README.Debian │ ├── rules │ ├── source │ │ ├── format │ │ └── local-options │ └── watch ├── LICENSE ├── Makefile └── src ├── myhelloworld └── myhelloworld.c I have tried to change the default debian/rules file to override the dh_auto_install so it looks like: %: dh $@ override_dh_auto_install: dh_auto_install -- prefix=/usr/local/bin This fails too. I did check that the binary does exist in debian/myhelloworld/usr/local/bin. I tried to change the prefix to just /usr/bin. This makes it possible to successfully build the package, but the containing binary is now installed in /usr/bin. From the error message it seems like debuild expects the myhelloworld to be a directory, but this is the binary. So why is debuild failing on my /usr/local/bin as destination. Build log: ep@ep-xps:~/sandbox/myhelloworld-1.0$ debuild dpkg-buildpackage -us -uc -ui dpkg-buildpackage: info: source package myhelloworld dpkg-buildpackage: info: source version 1.0-1 dpkg-buildpackage: info: source distribution UNRELEASED dpkg-buildpackage: info: source changed by Erik <> dpkg-source --before-build . dpkg-buildpackage: info: host architecture amd64 fakeroot debian/rules clean dh clean dh_auto_clean make -j12 distclean make[1]: Entering directory '/home/ep/sandbox/myhelloworld-1.0' rm -f src/myhelloworld make[1]: Leaving directory '/home/ep/sandbox/myhelloworld-1.0' dh_clean dpkg-source -b . dpkg-source: warning: no source format specified in debian/source/format, see dpkg-source(1) dpkg-source: info: using source format '1.0' dpkg-source: info: building myhelloworld using existing myhelloworld_1.0.orig.tar.gz dpkg-source: info: building myhelloworld in myhelloworld_1.0-1.diff.gz dpkg-source: warning: newly created empty file 'LICENSE' will not be represented in diff dpkg-source: warning: the diff modifies the following upstream files: Makefile src/myhelloworld.c dpkg-source: info: use the '3.0 (quilt)' format to have separate and documented changes to upstream files, see dpkg-source(1) dpkg-source: info: building myhelloworld in myhelloworld_1.0-1.dsc debian/rules build dh build dh_update_autotools_config dh_autoreconf dh_auto_configure dh_auto_build make -j12 "INSTALL=install --strip-program=true" make[1]: Entering directory '/home/ep/sandbox/myhelloworld-1.0' cc -g -O2 -ffile-prefix-map=/home/ep/sandbox/myhelloworld-1.0=. -flto=auto -ffat-lto-objects -flto=auto -ffat-lto-objects -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -Wl,-Bsymbolic-functions -flto=auto -ffat-lto-objects -flto=auto -Wl,-z,relro src/myhelloworld.c -o src/myhelloworld make[1]: Leaving directory '/home/ep/sandbox/myhelloworld-1.0' dh_auto_test create-stamp debian/debhelper-build-stamp fakeroot debian/rules binary dh binary dh_testroot dh_prep debian/rules override_dh_auto_install make[1]: Entering directory '/home/ep/sandbox/myhelloworld-1.0' dh_auto_install -- prefix=/usr/local/bin make -j12 install DESTDIR=/home/ep/sandbox/myhelloworld-1.0/debian/myhelloworld AM_UPDATE_INFO_DIR=no "INSTALL=install --strip-program=true" prefix=/usr/local/bin make[2]: Entering directory '/home/ep/sandbox/myhelloworld-1.0' install -D src/myhelloworld \ /home/ep/sandbox/myhelloworld-1.0/debian/myhelloworld/usr/local/bin/myhelloworld make[2]: Leaving directory '/home/ep/sandbox/myhelloworld-1.0' make[1]: Leaving directory '/home/ep/sandbox/myhelloworld-1.0' dh_installdocs dh_installchangelogs dh_perl dh_usrlocal dh_usrlocal: error: debian/myhelloworld/usr/local/bin/myhelloworld is not a directory make: *** [debian/rules:9: binary] Error 25 dpkg-buildpackage: error: fakeroot debian/rules binary subprocess returned exit status 2 debuild: fatal error at line 1182: dpkg-buildpackage -us -uc -ui failed
Packages aren’t allowed to ship files in /usr/local, only directories, and this is enforced by dh_usrlocal. The best fix is to follow Debian conventions and install in /usr: override_dh_auto_install: dh_auto_install -- prefix=/usr/bin If you really want to install to /usr/local/bin, override dh_usrlocal instead: override_dh_usrlocal: Note that prefixes are generally understood as the “root” under which the various directories are placed, so you’d have prefix = /usr/local … install: src/myhelloworld install -D src/myhelloworld \ $(DESTDIR)$(prefix)/bin/myhelloworld This is why your initial attempt installed myhelloworld in /usr: dh_auto_install sets prefix to /usr. If you change your Makefile to the above, you can drop the dh_auto_install override entirely. (There’s a slight typo in your Makefile, it should be $(LDFLAGS), not $(LDCFLAGS).) You might find the Debian upstream guide useful.
Building debian package fails when destination is /usr/local/bin
1,526,491,902,000
I'm thinking about properly Debianizing a package, which contains two parts in one upstream tarball/git branch: Userspace binaries and libraries, version 1.5.0 (foobard binary package) Kernel module, version 0.8.5 (foobar-dkms) The problem is that versions differ. Is there any sane and correct way to build two differently-versioned binary packages from one source package in such case? If possible, I'd like something cleaner than creating two source packages, or versioning both packages as 1.5.0 (even though the module has proper MODULE_VERSION specified in source).
The version of a binary package in Debian is determined by dpkg-gencontrol, which generates the final control file which ends up in the binary package. The -v option specifies the version number; by default the version number is taken from debian/changelog, but that can be overridden. There are a few examples of this in the archive; see for example my own gcc-mingw-w64 package, which has its own (source) version number, but generates binary packages whose versions merge the underlying gcc-source (currently, gcc-7-source) version number and the source package's number. Thus in Debian 9, gcc-mingw-w64version 19.3 produces binary packages versioned 6.3.0-18+19.3. To build different binary packages with different versions from a single source, you'd combine the -v option with the -p option (which specifies the package to process), and run dpkg-gencontrol (or one of its wrappers, such as dh_gencontrol) as many times as necessary. There is at least one package in the archive which demonstrates this: android-sdk-meta builds binary packages with two different versions, android-sdk which takes the source version, and four other packages whose binary version is specified in debian/rules. The Debian Policy chapter on control fields has more detail on the differences between source and binary control files.
Two differently-versioned binary Debian packages from one source
1,526,491,902,000
I currently don't have wire internet access in the PC I'm trying to install arch to, but my other PC (win7) can access the internet just fine. I tried downloading the b43 package from the AUR and copy it with a pendrive but when I run makepkg -s --asroot it goes and tries to download the source from "http://www.lwfinger.com/b43-firmware/broadcom-wl-5.100.138.tar.bz2" which doesn't work since I still don't have internet access. I manually downloaded the source on my other pc but I guess I have to modify the PKGBUILD file to reflect this so instead of trying to fetch it online it looks in my local folder? How can I do this?
Copy the file to the same dir as PKGBUILD and then add its filename to the source array. Otherwise I'd suggest you just look at the build procedure in the PKGBUILD file and then build it manually. After you get internet access, you can simply reinstall it to get the package tracked.
How to install b43-firmware on arch without internet access?
1,526,491,902,000
I'm using a Raspberry Pi 2 Model B running the latest Raspbian Stretch Lite 2018-11-13. I built a program that communicates with a LoRa chip (SX1276) using SPI, gets some data from a temperature sensor and prints the temperature on the screen. My program consists of only one executable (apart from wiringpi library). I was searching for a tutorial to make my program a *.deb package. Using this tutorial I managed to build a lora.deb package. When I installed my lora.deb package sudo dpkg -i lora.deb the executable just deployed in a directory. How can I make that package automatically run the executable and also run it every time the system boots?
change '/usr/bin/something' to '/directory/path/to/deployed/executable' below: $ cat /etc/systemd/system/something.service [Unit] Description = Something Service After = network.target [Service] ExecStart = /usr/bin/something [Install] WantedBy = multi-user.target $ systemctl daemon-reload $ systemctl enable something $ systemctl start something
creating a .deb package and autorun it
1,526,491,902,000
I am trying to build a debian package against Debian stretch. The debian/rules file is this: #!/usr/bin/make -f %: dh $@ override_dh_auto_build: mvn clean package When I build it using pbuilder-buildpackage I get this build error: mvn -e clean package [INFO] Error stacktraces are turned on. [ERROR] Could not create local repository at /nonexistent/.m2/repository -> [Help 1] How do I resolve this error?
Debian packages can’t rely on a home directory during builds. This is enforced in pbuilder with the /nonexistent home. To fix this, you need to supply the appropriate options to Maven so that it places its repository in /tmp. But really, instead of doing that, you should build-depend on maven-debian-helper and let dh work its magic. Look at the Java packages in Debian for examples.
Getting "Could not create local repository" error when building Debian package
1,526,491,902,000
We're building our package for Debian Jessie with sbuild, and so far it's working great. There's just one detail though: we'd like to take one of the build dependencies from the Jessie backports archive. I can't figure out how to configure the chroot to pull that package (and only that package) from backports, though. I know how to configure the apt sources.list and pinning preferences on a Debian system but I couldn't find anything related to adding repositories and pinning packages from them in the sbuild(1) and sbuild.conf(5) manual pages.
I found a way, thanks to @bigon on IRC. At runtime, I now pass the following options to the sbuild command in addition to the ones I already had: $ sbuild ... --build-dep-resolver=aptitude --extra-repository="deb http://deb.debian.org/debian jessie-backports main" ... The --extra-repository will add the Jessie backports as a valid archive to use in the chroot. But unfortunately, that's not enough because the Release file for the backports archive has "NotAutomatic: yes". As a result, even though the backports contain the dependency I need (and declared properly in debian/control), it doesn't get taken from there automatically. That's where the --build-dep-resolver=aptitude comes into play: aptitude also stumbles on the missing dependency like apt, but then it finds it in the backports archive and automatically decides to take it (and only it) from there. It's a bit too « automagic » for my taste, and I would prefer a way to setup some explicit pinning, but so far it's the only way I found. Thanks @bigon!
Building with sbuild and backports
1,526,491,902,000
I was trying to build a simple Debian package, I did these steps with user root: First, I downloaded the upstream tarball, then: $ mv hithere-1.0.tar.gz hithere_1.0.orig.tar.gz Then: $ tar xf hithere_1.0.orig.tar.gz After that: $ cd hithere-1.0 $ dch --create -v 1.0-1 --package hithere $ cd debian/ $ rm *.ex *.EX Then I edited "control file" and "copyright file": $ nano control $ nano copyright $ cd .. $ debuild -S After the last command, This error was generated: root@mehrnaz-MS-A934:/home/fabdollahei/hithere-1.0# debuild -S dpkg-buildpackage -rfakeroot -d -us -uc -S dpkg-buildpackage: warning: using a gain-root-command while being root dpkg-buildpackage: source package hithere dpkg-buildpackage: source version 1.0-1 dpkg-buildpackage: source distribution unstable dpkg-buildpackage: source changed by root <[email protected]> dpkg-source --before-build hithere-1.0 dpkg-source: error: syntax error in hithere-1.0/debian/control at line 15: block lacks the 'Package' field dpkg-buildpackage: error: dpkg-source --before-build hithere-1.0 gave error exit status 255 dpkg-source: error: syntax error in hithere-1.0/debian/control at line 15: block lacks the 'Package' field dpkg-buildpackage: error: dpkg-source --before-build hithere-1.0 gave error exit status 255 debuild: fatal error at line 1364: dpkg-buildpackage -rfakeroot -d -us -uc -S failed How do I get rid of that fatal error?
The message is just saying that dpkg-buildpackage command failed. If you read the messages you will notice where's the problem right away: dpkg-source: error: syntax error in hithere-1.0/debian/control at line 15: block lacks the 'Package' field dpkg-buildpackage: error: dpkg-source --before-build hithere-1.0 gave error exit status 255 If you fix that (and maybe other problems it has, that could show up later) it should work.
what does "dpkg-buildpackage -rfakeroot -d -us -uc -S failed" mean?
1,526,491,902,000
How can I produce an installer for a set of source codes for a specific application in Linux? Also, what are the actions happening when one installs software in Linux?
As there's more than one Linux distro, there's also more than one package management solution. I think that creating an app installer depends more on the target audience than on the target system. If you plan to produce an installer for confirmed Linux users, then a source tarball will suffice. If you target desktop users or non-confirmed Linux users, then produce DEB and RPM packages since those two package management tools cover the major Linux distros. Also what is the actions happening when we install a software in Linux? For source tarballs, nothing actually. The user is left alone to compile the source archive and figure out what are the dependencies (libraries and so on) without what the application wouldn't run. For DEB and RPM (and other package management tools) the process of figuring out what dependencies are needed and the installation operation, is managed entirely by the package management tool(a connection to the Internet is needed to download the dependencies). The package management tool is responsible for registering the just installed app and all its dependencies in a local registry system so it wouldn't be necessary to install them once more for future needs. WIKI DEB: a Debian package file. apt is Debian's package management tool. RPM: RedHat Package Manager file. The same name goes for the package management tool.
How can produce an "installer" in Linux?
1,526,491,902,000
According to the Debian package maintainer script documentation, the pre-install script can be called with either the install or the upgrade first argument: The preinst script may be called in the following ways: new-preinst install new-preinst install old-version new-version new-preinst upgrade old-version new-version What is the difference between install old-version new-version and upgrade old-version new-version? The first form (just install) seems clear, but I don't understand the difference between install and upgrade where the old and new version numbers are also specified.
This is explained in the “details” section: if the package is already fully installed, preinst is called with upgrade and the old and new versions; if the package was previously installed, and still has its configuration files (it is in “Config-Files” state, i.e. it shows up as rc in dpkg -l’s output), preinst is called with install and the old and new versions; if the package is being newly installed, or was previously purged, preinst is called with install and no version information. Since preinst runs before the unpack phase, upgrade indicates that a previous version of the package’s contents is available, whereas install indicates that no version of the package’s contents is present (other than configuration files). Separately, if version information is provided, that indicates that there might be configuration files needing to be handled. There aren’t many scenarios where the difference between upgrade and install is significant, but one that does spring to mind is upgrades that involve exporting data. For example, in upgrade mode, slapd’s preinst exports its databases; it can’t do that in install mode because the appropriate tools aren’t present.
Package maintainer pre-inst script `install` vs `upgrade`
1,526,491,902,000
I want to build a tar file as regular (non-root) user with some prepared binaries and configuration files like this; etc/binaries.conf usr/bin/binary1 usr/bin/binary2 that are mean to be extracted into the file system under the / directory. Like a traditional software package .deb, .rpm etc but I need to be "package manager independent". So probably I will just have a .tar file (maybe some gzip, bzip, lzip should be added to the mix but that's outside). PROBLEM / QUESTION My problem here is that I don't want to build this tar as the root user, and I want to know if there is a way to build this tar as a regular (non-root) user and then, when the .tar file is distributed to the machines and the real root user extract those binaries, they will be installed as files owned by the root user or the user who extract the binaries ? EXAMPLE Because right now, when I just create the .tar file as a regular (non-root) user with $ tar cf dist.tar dist/ And then extract the .tar as root user with # tar xf dist.tar -C / I see the binaries and the config file with the regular user as owner, not the root user. $ ls -la /usr/bin/binary1 -rwxr-xr-x 1 user user 30232 jun 20 19:06 /usr/bin/binary1 And I wan to have $ ls -la /usr/bin/binary1 -rwxr-xr-x 1 root root 30232 jun 20 19:06 /usr/bin/binary1 Just to clarify, this hand made packaging is very specific for some task in a closed infrastructure, so right now, using .deb, .rpm or any other more sophisticated packaging system is not an option.
The extraction is what determines the ownership, not the creation of the archive. You can see that by looking at the archive's table of contents, e.,g., tar tvf dist.tar If creating the file as regular user tar --owner 0 --group 0 dist.tar dist do the magic
Create, as a regular user, a tar with files owned by root
1,526,491,902,000
I need instructions on how to do repackage a .deb package. Situation: I have a .deb package for an application with no source. I need to modify a Description field, save the file change and repackage back into a .deb package. Is there a step by step on how to do that?
You need to modify the control file. This is the process: dpkg-deb -x foo.deb tmpdir dpkg-deb --control foo.deb tmpdir/DEBIAN nano tmpdir/DEBIAN/control dpkg -b tmpdir modified.deb
Repackaging a Debian package
1,526,491,902,000
I try to build a single package from source using dpkg-buildpackage. At some point dh_auto_install is invoked and run make install DESTDIR=/somewhere/debian/package-name Then dh_install is invoked but only search in . or debian/tmp but not in debian/package-name ! And I get something like: dh_install: Cannot find (any matches for) "usr/include/*" (tried in ., debian/tmp) How to make both of them use in the same dir ? (There is no issue if I try to build multiple packages) (compat 9)
I’m guessing your source package builds a single binary package; i.e., your debian/control has a single Package: stanza. In such situations, dh_auto_install installs files to debian/package, and the assumption then is that that is sufficient, i.e. all the files you need to install end up in the right place under debian/package once dh_auto_install completes. dh_install is useful mostly for source packages building multiple binary packages: it takes files under debian/tmp or . and copies them to the appropriate target under debian/packageX. In your case, since you’re trying to install usr/include/*, I suspect you don’t need dh_install at all — you should find the files you want to install ready and waiting in debian/package/usr/include. However, if you’re installing files under usr/include, you might be packaging a library, in which case you should change your debian/control file to create multiple binary packages (one for the library, one for the development files), and then dh_auto_install will install to debian/tmp and dh_install will work as you expect. See also Dpkg dh_install: copy files from the build directory rather than the debian/tmp dir?
Why dh_auto_install and dh_install are not using same directory?
1,526,491,902,000
I have been looking (in https://db.debian.org/machines.cgi) for a service or list of Debian packages without upstream (parent project). Because I think there are a lot of deb packages which are alive in Debian but are dead outside.
The Ultimate Debian Database has an upstream version query which you can use to list all packages who either don’t have a watch file (to track upstream releases) or whose watch file results in an empty value (because upstream has gone, or an error occurred): curl https://udd.debian.org/cgi-bin/upstream-status.json.cgi | jq '.[] | select(.["upstream-version"] == null) | .package' This doesn’t quite answer your question, since it won’t find packages which do track upstream releases, but where upstream releases are unlikely to ever occur again (for example, fyre, which I know has been abandoned for a long time). It will also find packages which are themselves unmaintained (they have an obsolete watch file, regardless of upstream’s status). But I think that this is the best you’ll get in an automated fashion.
In Debian, is there a list of packages with dead parent project?
1,526,491,902,000
I have a Git repository with these branches: debian master pristine-tar upstream I do not have an upstream tar ball. Can I create an upstream tarball from the Git repository I have? If so, how?
You can use pristine-tar to reconstruct the tarball. List the available tarballs with pristine-tar list then reconstruct the tarball you want with pristine-tar checkout foo.tar.gz (replacing foo.tar.gz as appropriate).
How to create upstream tarball from Git repository of Debian package
1,526,491,902,000
How do you add a package to the official Debian APT repository? For example lets say I have a peice of software called quicktxtedit ,and I have a DEB file for it, and I want to add it to the offical repository for everyone. How would I do that?
There are a number of steps involved in submitting your project to be added to Debian's archives. There are two main things you need to do. Get your software into suitable shape for Debian. Debian is quite demanding about what software is allowed in its archives. This includes: a) making sure your license terms are compatible with the Debian Free Software Guidelines. b) making sure your Debian package conforms to Debian Policy. Lintian is a tool to help you conform with Debian policy, so you should try to fix Lintian errors and warnings generated by your package. As part of doing this, you may have to work on your software build system. This can be a fair amount of effort in itself. You can get help with packaging from the #debian-mentors IRC channel on OFTC, and the debian-mentors mailing list. Find a sponsor to upload your package. Places to ask include #debian-mentors and the debian-mentors mailing list. It is a very good idea to have made some progress with (1) before approaching a sponsor. Debian developers don't have time to babysit new packagers, so you will get a better reception if you show you have made some effort at the packaging end, even if the results are not perfect. You should aim for a buildable binary package at least. Note that uploading your package to http://mentors.debian.net/ is an option, but is not necessary. Potential sponsors need to be able to access your package; so as long as it is somewhere public, that is fine. However, http://mentors.debian.net/ does display information about your package in a convenient form, and also provides a convenient interface for for people to comment on your package. Your sponsor may be willing to take the time to help you get the package into shape. At a minimum, he/she needs to review your package. If you have never done this before, I suggest you get started with (1) immediately. The process of getting your package into shape for Debian is useful and educational even if you never actually wind up getting your package into Debian. Bear in mind that you can make your package available in an unofficial apt repository.
Adding my software to Debian
1,526,491,902,000
I wanted to know how to add packages to the Linux kernel and then package it to a ISO or CD for friends. Thanks in advance and please don't point me to LFS - Linux From Scratch!
Most of the distros can be used as a base and then customizations can be applied to this base, and written to an ISO. Fedora Fedora offers what's called a a "spin" or "respin". You can check them out here on the spins website: http://spins.fedoraproject.org/ It's pretty straight-forward to "roll your own" versions of Fedora, mixing in your own custom RPMs as well as customizing the UI. You can even use the tool revisor which is a GUI for selecting the packages you want to bundle into your own custom .ISO. There's a pretty good tutorial here, titled: Create Your Own Fedora Distribution with Revisor. The primary page for revisor is here: http://revisor.fedoraunity.org/ screenshot of revisor     Ubuntu Ubuntu offers this howto on the community wiki, titled: LiveCDCustomizationFromScratch. For Ubuntu/Debian you also have a couple of other alternatives. remastersys relink Of these 2, relink seems to be the most promising in both ease of use and being able to create a fairly customized version of Ubuntu. References Relinux – An easy way to create a Linux distro relink launchpad site
How can I create my own distro and include a custom kernel & packages? [closed]
1,526,491,902,000
I am marked as the Debian maintainer of a package. I no longer wish to be the maintainer of this project. I thought I had gone through the process of abandoning the package, but it looks like I haven't. It has been years since I did any Debian packaging, and so I need help to follow the instructions posted in the Debian manual: 5.9.4. Orphaning a package If you can no longer maintain a package, you need to inform others, and see that the package is marked as orphaned. You should set the package maintainer to Debian QA Group <[email protected]> and submit a bug report against the pseudo package wnpp. The bug report should be titled O: package -- short description indicating that the package is now orphaned. The severity of the bug should be set to normal; if the package has a priority of standard or higher, it should be set to important. If you feel it's necessary, send a copy to [email protected] by putting the address in the X-Debbugs-CC: header of the message (no, don't use CC:, because that way the message's subject won't indicate the bug number). If you just intend to give the package away, but you can keep maintainership for the moment, then you should instead submit a bug against wnpp and title it RFA: package -- short description. RFA stands for Request For Adoption. More information is on the WNPP web pages. I'm struggling to follow even the first step. How do I set the package maintainer to another email address, for instance?
Table of contents: Report a bug to Debian wnpp Update the Maintainer field on the package Part one: Reporting a bug to Debian wnpp You can report a bug against the package, saying that the package is orphaned now, and asking for adoption. Hopefully, one of the Debian maintainers will see the bug report and will do the work of changing the Maintainer field on the Debian package metadata to Debian QA Group <[email protected]> for you, if not, see the second part of this answer. To report a bug to Debian, the documentation recommends that you use the tool reportbug. However, reportbug doesn't work by default unless you have configured a Mail Transport Agent, like exim or sendmail. Instead, send a simple plain text email. Open your email client, and compose a new message: The recipient should be [email protected] The sender should be the same email address as the one that is the current maintainer of the package, I presume. The subject should be in this format: O: PACKAGENAME -- short description of the package . The O: here stands for orphaning. For example, the subject could be O: firefox -- a browser. It is important that you enable plain text mode in your email client. Make the contents of the email look like this: Package: wnpp Severity: normal Dear Debian maintainers, I no longer wish to be marked as the maintainer of this Debian package, PACKAGENAME. Could someone mark this package as orphaned? Thank you. The package wnpp is a virtual package used to track bug reports about orphaned Debian packages. You should receive an email a few minutes later acknowledging the receipt of the bug report. Part two: Updating the Maintainer field on the package (optional but recommended): Once that bug report is accepted, the package is considered orphaned. However, to unsubscribe from any bug report emails from the Debian package, the Maintainer field of the Debian package needs to be changed. A Debian developer may do it for after you submitted the bug report, but you can do it yourself, too. You will need to be using a computer on Debian or a Debian derived distribution to do this. Make sure that the source repositories are enabled. (See this) If you are not using Debian, you probably want to enable the Debian repositories by modifying /etc/apt/sources.list to include this line. It's important to undo this afterwards: deb-src [trusted=yes] http://http.us.debian.org/debian unstable main non-free contrib Run sudo apt update Run apt-get source PACKAGENAME, replacing PACKAGENAME with the package that you want to mark as orphaned. This will download some tarballs and signatures to the current directory, and some files will be extracted to a subdirectory. For example: $ apt-get source PACKAGENAME $ ls PACKAGENAME-0.2/ PACKAGENAME_0.2-5.1ubuntu1.debian.tar.xz PACKAGENAME_0.2-5.1ubuntu1.dsc PACKAGENAME_0.2.orig.tar.gz Make sure that this version is the latest one in the Debian unstable repository. Change directory to the subdirectory. Modify debian/control to change this line so that the new maintainer is Debian QA Group: Maintainer: Debian QA Group <[email protected]> Add a new entry in the changelog by running dch -i: the new version number should increase in the number after the dash (for example, from 0.2-5 to 0.2-6). The changelog should look like this at the top: PACKAGENAME (0.2-6) unstable; urgency=medium * Set Debian QA Group as maintainer. -- Firstname Lastname <[email protected]> Sun, 14 Jul 2019 22:26:08 -0300 Still in the subdirectory, run the following command (see docs): dpkg-buildpackage This will create more files in the parent directory, including PACKAGENAME_0.2-6_amd64.changes. It will also sign them using your GPG secret keys. If you have lost your secret keys, then you may get stuck at this step. Now, upload your changes to the Debian servers (see docs): dupload PACKAGENAME_0.2-6_amd64.changes If you had added this line in step 2 to /etc/apt/sources.list, now is the time to undo that addition by deleting this line: deb-src [trusted=yes] http://http.us.debian.org/debian unstable main non-free contrib
Step by step instructions to abandon a Debian package and no longer be its maintainer
1,526,491,902,000
I'm trying to add a 'postinst' script to my debian package to clean up something a previous version may have left behind. I've simply created a 'postinst' file in the debian/ directory, but the file is not present in the .deb file. The permissions: -rwxrwxr-x 1 kp kp 354 Sep 16 20:00 postinst* The content: #!/bin/sh set -e set -x ...
You need to copy the postinst file (and other similar files) to the package staging directory. If you use dh_make, this is performed by dh_installdeb, which is of course included in dh install. If you're doing everything manually. copy the file to debian/tmp/DEBIAN/ where debian/tmp is the staging directory.
How do I add a postinst file to my debian package?
1,526,491,902,000
I'm running Debian sid and want to use TeX Live from CTAN. So I didn't install the Debian texlive-packages, but created a virtual local package with equivs. You can find the control file below: Section: misc Priority: optional Standards-Version: 3.9.4 Package: texlive-local Version: 2014-1 Maintainer: Jens Kubieziel <[email protected]> Provides: chktex, biblatex, biblatex-dw, cm-super, cm-super-minimal, context, dvidvi, dvipng, feynmf, fragmaster, jadetex, lacheck, latex-beamer, latex-cjk-all, latex-cjk-chinese, latex-cjk-chinese-arphic-bkai00mp, latex-cjk-chinese-arphic-bsmi00lp, latex-cjk-chinese-arphic-gbsn00lp, latex-cjk-chinese-arphic-gkai00mp, latex-cjk-common, latex-cjk-japanese, latex-cjk-japanese-wadalab, latex-cjk-korean, latex-cjk-thai, latexdiff, latexmk, latex-sanskrit, latex-xcolor, lcdf-typetools, lmodern, luatex, musixtex, passivetex, pgf, preview-latex-style, prosper, ps2eps, psutils, purifyeps, t1utils, tex4ht, tex4ht-common, tex-gyre, texlive, texlive-base, texlive-bibtex-extra, texlive-binaries, texlive-common, texlive-extra-utils, texlive-fonts-extra, texlive-fonts-extra-doc, texlive-fonts-recommended, texlive-fonts-recommended-doc, texlive-font-utils, texlive-formats-extra, texlive-games, texlive-generic-extra, texlive-generic-recommended, texlive-humanities, texlive-humanities-doc, texlive-lang-african, texlive-lang-all, texlive-lang-arabic, texlive-lang-cjk, texlive-lang-cyrillic, texlive-lang-czechslovak, texlive-lang-english, texlive-lang-european, texlive-lang-french, texlive-lang-german, texlive-lang-greek, texlive-lang-indic, texlive-lang-italian, texlive-lang-other, texlive-lang-polish, texlive-lang-portuguese, texlive-lang-spanish, texlive-latex-base, texlive-latex-base-doc, texlive-latex-extra, texlive-latex-extra-doc, texlive-latex-recommended, texlive-latex-recommended-doc, texlive-luatex, texlive-math-extra, texlive-metapost, texlive-metapost-doc, texlive-music, texlive-omega, texlive-pictures, texlive-pictures-doc, texlive-plain-extra, texlive-pstricks, texlive-pstricks-doc, texlive-publishers, texlive-publishers-doc, texlive-science, texlive-science-doc, texlive-xetex, thailatex, tipa, tipa-doc, xindy, xindy-rules, xmltex Architecture: all Description: My local installation of TeX Live 2013. A full "vanilla" TeX Live 2013 http://tug.org/texlive/debian#vanilla I used equivs-build to create the Debian package and installed it. However when I open apt-get, aptitude or other package managers I get the following message: W: Ignoring Provides line with DepCompareOp for package texlive-latex-base It advises to call apt-get update which I did, but the message stays. Why does this message appear and what can I do to correct this warning? The package texlive-latex-base not installed: > apt-cache policy texlive-latex-base texlive-latex-base: Installed: (none) Candidate: 2013.20140215-1
The reason for the message is that, prior to Debian 8, versioned provides weren’t supported. texlive-latex-base has versioned dependencies on a number of packages provided by your texlive-local package, but because those packages are provided, they can’t (couldn’t) satisfy the versioned dependencies. Since dpkg 1.17.11, provided packages can specify versions and thus satisfy versioned dependencies. You do this by declaring Provides: chktex (= 1.6.4-4) etc. (the version is just an example, matching Wheezy). Debian control file "Provides" does not satisfy dependency has more details.
Why is the Provides field in the local Debian package ignored (DepCompareOp)?
1,526,491,902,000
I'm trying to create an rpm package with a dependency on java 11; however, it seems like the openjdk and Oracle java 11 packages don't provide any overlapping java virtual packages. OpenJDK Java 11 provides: $ repoquery --provides java-11-openjdk java-11 = 1:11.0.2.7-0.el7_6 java-11-openjdk = 1:11.0.2.7-0.el7_6 java-11-openjdk(x86-32) = 1:11.0.2.7-0.el7_6 jre-11 = 1:11.0.2.7-0.el7_6 jre-11-openjdk = 1:11.0.2.7-0.el7_6 libjawt.so java-11 = 1:11.0.2.7-0.el7_6 java-11-openjdk = 1:11.0.2.7-0.el7_6 java-11-openjdk(x86-64) = 1:11.0.2.7-0.el7_6 jre-11 = 1:11.0.2.7-0.el7_6 jre-11-openjdk = 1:11.0.2.7-0.el7_6 The Oracle Java 11 installer provides: $ rpm -qp --provides /tmp/jdk-11.0.2_linux-x64_bin.rpm jdk jaxp_parser_impl xml-commons-apis java java-11.0.2 java-fonts jre jre-11.0.2 jdk-11.0.2 = 2000:11.0.2-ga jdk-11.0.2(x86-64) = 2000:11.0.2-ga How do I set my packages' dependencies to be flexible enough to work with either java11? I thought rpm boolean dependencies might help, but I could find no information about updating rpm to version 4.13. If I set my packages dependencies to: Requires: jre-11 >= 11, rpm >= 4.13 installation fails with: Error: Package: MYPACKAGE Requires: rpm >= 4.13 Installed: rpm-4.11.3-32.el7.x86_64 (installed) rpm = 4.11.3-32.el7 Available: rpm-4.11.3-35.el7.x86_64 (base) rpm = 4.11.3-35.el7 Version 4.13 of rpm just doesn't seem to be available? I'm using CentOS7, but the same happens on RHEL 7.5 too.
So, as you pointed out, the best would be if both packages could be made to have a common "Provides". Since this is probably not within your reach, another option is to create a pseudo RPM as a proxy for the Oracle Java 11 RPM. Name: java-11-oracle (for example) Provides: java-11 or any other relevant value from the openjdk RPM Requires: java >= 11 (or jdk, or jre...) %files: empty section (you can omit it) In your own package, add a dependency to the Provides: that is now in common between that proxy RPM and the openjdk one. Your package would then be installable in one the following situations: OpenJDK 11 is installed or available in the repositories Oracle's Java 11 RPM and your java-11-oracle RPM are installed or available in active repositories.
How to depend on java 11 so it can be satisfied by openjdk or by Oracle java 11 packages?
1,526,491,902,000
All other software packages are lower case, so why NetworkManager upper case?
From Red Hat Magazine: Introducing NetworkManager : Words with the creator NetworkManager creator and developer Dan Williams took time out of his hectically busy schedule to answer some questions. What's with those StudlyCaps, anyway? Well, coming from a Classic Mac OS background, in which everything was StudlyCaps, it is quite natural for me to use the Shift key, which many Linux programmers seem to run away from in fear. Which is quite silly, if you ask me. There's nothing to be afraid of. In any case, it also had to do with aesthetics. A daemon called network_manager just doesn't look good (using '_' instead of ' ' probably comes from the traditional Unix aversion to spaces in file names, which is also silly), and networkmanager is just pathetically hard to read, so it had to be NetworkManager.
Why is NetworkManager package name upper case?
1,526,491,902,000
Is there some place which has the collection of all the latest Linux utilities (something like filehippo.com for Windows utilities)? I know I can use various download utilities similar to yum, each of which would have their own repositories. I am wondering if there is any repository for Linux maintained anywhere that lets me download these utilities right from the browser?
It would vary by distro. For example: Ubuntu has Ubuntu Packages Gentoo has Gentoo Packages Arch has Arch Package Database and AUR Fedora has Fedora Package Database
Is there a Linux utilities repository online accessible from a web browser?
1,526,491,902,000
How are binary packages (rpm, deb, etc) created for binutils, gcc and other packages that link to different libs depending on what exists on the host system? In the LFS project, to isolate the new system from the host, cross compilation is faked by using a different target-triplet for the new system (here). This prevents packages from linking to libs that exists only on the host system. But if a similar method is used to build binary packages, then surely these packages would have a different target triplet than that of the system they were built on. I read this email correspondence which discussed building a host-isolated gcc. But it came to the conclusion that faking cross-compiling like LFS is the only rational way to build gcc isolated from the host system. I tried building binutils with --prefix and --with-sysroot set to an empty directory but the resulting binaries were linking to libfl on my host system. EDIT: I think my original explanation is not clear. Allow me to give a more specific example: GNU's binutils does not depend on GNU flex, I can validate this by running ldd /usr/bin/ar on my arch system and I see that it does not link to libfl.so. Dispite this I still have flex installed on my host system. Now, I would like to compile a binutils binary which I will copy to another system with the same architecture. This new system does not have GNU flex installed, but this should not matter since binutils does not depend on GNU flex. The problem is that when I compile binutils on my host system, it links to libfl.so.2! I assume this is because when I built binuitls it "noticed" I had flex installed so decided to link to it. I would like to know how I can compile software (like binutils) without it linking to optional dependencies (like flex) that exist on my host system. Surely binary package maintainers face this same problem when they try to compile their software? Binutils is just an example in this case, I am really looking for a more general method that package maintainers use to stop their software linking to optional dependencies in the host system.
I may be mistaken but I think the answer (often) is that they are not isolated from the host system. How are binary packages (rpm, deb, etc) created for binutils, gcc and other packages that link to different libs depending on what exists on the host system? They don't. rpm, deb etc specify the dependencies, including version and have different RPMs for different architectures. In other words rpms and debs are based on the idea that the target systems will all look alike. Do the target system and build system look the same? I'm not a package maintainer so there may be some magic I'm not aware of. My understanding is that this is achieved by building on the same type of system as the target system. At least the build environment will be some chroot laid out just like the target environment. There's a subtlety of LFS that I don't think they called out when I read it (15? years ago). In LFS you start with no system, so you get some tools and start building the basic blocks of your system. But you have to do this from the outside looking in, because otherwise you have a chicken and egg problem. With no system initially, you can't build inside your system. What I don't think they really call out in LFS is that once you have a system installed, you don't need to compile packages from the outside looking in. You can use that system to build its own packages. This works both if you intend to use those to replace bits of that system itself, or if you intend to use them to distribute to other similar systems. It's a bit of a maddening concept initially. Rather like writing a C compiler in C. You start by compiling your C compiler with someone else's then re-compile your C compiler with your C compiler. You can then throw away the one you got from someone else.
How are binary packages isolated from host system?
1,526,491,902,000
As a follow up on this question, what if I am not interested in having these debug features - how do I simply prevent these build-id files (debug info packages?) from being installed ? Ultimately I do not care (at least for the near future) about supporting debugging at clients. On the other hand, I need to overcome the known "build-id folder conflicts" when installing our different client redhat products (packages) in the same machine. How can that be accomplished ? I read that using --excludepath=/usr/lib/.build-id/ when installing with rpm is a clean workaround. Sounds so. Do you see any drawbacks except losing "debug capabilities" ? --excludepath actually did not help. But using %define _build_id_links none as suggested here did. In a short, how problematic is that, if I am not interested in debug support ? enter link description here
--excludepath=/usr/lib/.build-id is a clean workaround, yes. As far as I’m aware, losing “debug capabilities” is the only drawback; files skipped by this option won’t even cause rpm --verify to fail. However, losing “debug capabilities” has consequences beyond limiting the ability to get useful output of gdb; for example, manual intervention will be required if bug reporting tools want to provide meaningful stacktraces. %define _build_id_links none is OK too, if you’re building packages and you don’t want to ship debugging information with them. Your two questions target different aspects of packages. rpm --excludepath affects what happens when a package is installed, whereas %define _build_id_links affects what happens when a package is built. If you’re interested in building packages, it’s normal that rpm --excludepath didn’t help, because it’s not relevant then. Note too that, as suggested by the bug report you linked to, build-id conflicts indicate packaging problems. If you’re building packages, you should fix the issues in your packages, instead of working around them.
If I do not care about debug support in red hat packages, what are the drawbacks of turning build-id support off in the specs file?
1,526,491,902,000
I am packaging my first debian project, and I have things 100% worked out with gnu-make (anything is possible here, for me, and so my difficulties right now are exclusively in navigating the dpkg/debuild system). I have, right now, just some dummy compilations in place with the following rules file and compatibility: // debian/compat 10 // debian/rules #!/usr/bin/make -f %: dh $@ override_dh_auto_install: cat binaries.txt | xargs -I arg install -D -m 0755 arg $$(pwd)/debian/package/opt/package/arg Assume that all compilations and source files are managed via make in the directory containing debian directory perfectly -- I have a minimal case that works just as expected. // binaries.txt foo bar is just a binaries file that lists out the dummy binaries my trivial make process produces. I am attempting to code a deb_helper symlink to symlink my binaries in /opt/package to /usr/local/bin according to the documentation here: https://manpages.debian.org/stretch/dpkg/dpkg-maintscript-helper.1.en.html But I am not having much luck. What is the procedure on this?
If you want to ship symlinks in your package, I would recommend using dh_link. The easiest way to do that is to list the symlinks you want in debian/links (or debian/package.links if your source package builds multiple binary packages): opt/package/bin/foo usr/bin/foo opt/package/bin/bar usr/bin/bar Debian packages aren’t supposed to ship any files under /usr/local so the build tools don’t support that too well. If you don’t need anything else in /opt/package, you could install your binaries directly to /usr/bin. You can also use dh_install to simplify your installation, by listing the binaries you want to install in debian/install: foo opt/package/bin bar opt/package/bin or foo usr/bin bar usr/bin You can then drop the dh_auto_install override.
Dpkg Debuild dh_helper: How to symlink binaries installed in /opt/package to /usr/local/bin?
1,526,491,902,000
tl;dr: We build an RPM package that automatically detect dependencies (no Requires in .spec file). How can I remove dependencies from this RPM package. Long story:-> I'm shipping the dynamic libraries along with the binary but RPMs automatic dependencies mechanism obviously lists that shipped libraries also as dependencies. How to avoid this?
I you don't want rpm to process these dependencies automatically; you can use: AutoReqProv: no However, I have multiple time packaged myself binaries and the libraries they depend on; rpm has never caused me any trouble in that way; maybe your way of packaging is not optimal? For further reading on the automatic dependencies: http://ftp.rpm.org/max-rpm/s1-rpm-depend-auto-depend.html
Modify RPM package to remove dependencies
1,526,491,902,000
The dh_usrlocal manpage sounds a bit cryptic to me: It finds subdirectories of usr/local in the package build directory, and removes them, replacing them with maintainer script snippets (unless -n is used) to create the directories at install time, and remove them when the package is removed, in a manner compliant with Debian policy. These snippets are inserted into the maintainer scripts by dh_installdeb. See dh_installdeb(1) for an explanation of debhelper maintainer script snippets. Mainainer scripts, snippets, -n... OK, but what is the purpose? Does it really just create (empty?) directories? Can a kind soul explain it to me in a more practical way? Which part of policy I should read? Should I care if my app installs with PREFIX=/usr?
The purpose is to aid with policy compliance by that package. According to Debian policy (and, IIRC, the Filesystem Hierarchy Standard or FHS), official Debian packages are not permitted to own files or directories under /usr/local - that directory tree belongs to the local system administrator. From https://www.debian.org/doc/debian-policy/ch-opersys.html#s9.1.2 : (bold emphasis added by me) 9.1.2. Site-specific programs As mandated by the FHS, packages must not place any files in /usr/local, either by putting them in the file system archive to be unpacked by dpkg or by manipulating them in their maintainer scripts. However, the package may create empty directories below /usr/local so that the system administrator knows where to place site-specific files. These are not directories in /usr/local, but are children of directories in /usr/local. These directories (/usr/local/*/dir/) should be removed on package removal if they are empty. Note that this applies only to directories below /usr/local, not in /usr/local. Packages must not create sub-directories in the directory /usr/local itself, except those listed in FHS, section 4.5. However, you may create directories below them as you wish. You must not remove any of the directories listed in 4.5, even if you created them. Since /usr/local can be mounted read-only from a remote server, these directories must be created and removed by the postinst and prerm maintainer scripts and not be included in the .deb archive. These scripts must not fail if either of these operations fail. For example, the emacsen-common package could contain something like if [ ! -e /usr/local/share/emacs ]; then if mkdir /usr/local/share/emacs 2>/dev/null; then if chown root:staff /usr/local/share/emacs; then chmod 2775 /usr/local/share/emacs || true fi fi fi in its postinst script, and rmdir /usr/local/share/emacs/site-lisp 2>/dev/null || true rmdir /usr/local/share/emacs 2>/dev/null || true in the prerm script. (Note that this form is used to ensure that if the script is interrupted, the directory /usr/local/share/emacs will still be removed.) If you do create a directory in /usr/local for local additions to a package, you should ensure that settings in /usr/local take precedence over the equivalents in /usr. However, because /usr/local and its contents are for exclusive use of the local administrator, a package must not rely on the presence or absence of files or directories in /usr/local for normal operation. The /usr/local directory itself and all the subdirectories created by the package should (by default) have permissions 2775 (group-writable and set-group-id) and be owned by root:staff. See also https://wiki.debian.org/FilesystemHierarchyStandard dh_usrlocal removes any such directories from the package and replaces them with code in the package scripts (the .postinst and .prerm scripts) to create/delete them at install/uninstall time, following the example given in the policy. This may seem to make little practical difference because the directories are still created on install and deleted on uninstall, but Debian considers the failure of a package to comply with policy to be as serious a bug as any other - consistent and scrupulous adherence to policy is a major factor in quality assurance for Debian packages.
What does dh_usrlocal actually do
1,526,491,902,000
Usecase The package gnome-core depends on gnome-shell-extensions >=3.14. I'd like to remove gnome-shell-extensions but to satisfy the dependency, I have to replace it with a dummy package. I'm using equivs for this to create a replacement dummy package for gnome-shell-extensions. My equivs control file is as follows: Section: misc Priority: optional Standards-Version: 3.9.2 Package: gnome-shell-extensions Version: 1.0 Maintainer: Me Myself <[email protected]> Provides: gnome-shell-extensions Architecture: all Description: gnome-shell-extensions dummy package to satisfy gnome dependencies Issue The package built obviously provides gnome-shell-extensions, but even after installing it, apt still complains that gnome-core : depends on: gnome-shell-extensions (>= 3.14) I understand that the Version field in the control file has nothing to do with it, as it only marks the version of the dummy package. Workaround I have successfully managed to fake the original package by using the original package name, i.e. Package: gnome-shell-extensions, but I'd rather keep the dummy package name. Question What do I have to do to satisfy the dependency gnome-shell-extensions >=3.14 while using another package that Provides: gnome-shell-extensions?
You should now be able to use versioned Provides:: Provides: gnome-shell-extensions (= 3.14.2-1) This is supported since dpkg 1.17.11, so since Debian 8 (Jessie). Debian Policy hasn’t been updated to take this possibility into account yet, so it still claims two things which are no longer correct: Provides: can’t have a version constraint; relationships with version constraints ignore virtual packages. Bug #761219 tracks the documentation updates.
Debian control file "Provides" does not satisfy dependency
1,526,491,902,000
What is the difference between .changes and .dsc file? Debian Policy says about required field set, but misses the essence and the meaning on the whole. Why have two (actually there are three) when you can have the only one? Can this .changes file be derived from .dsc (or vice versa)? What is the transformation process? Why? I am trying to create Python script that automates updating of pure Python packages for Debian or Ubuntu systems. It needs to be cross-platform, because it is quite common to develop Python stuff on systems without classic Debian toolchain.
The Debian source control file .dsc is one of the three files which is part of a Debian package source. The other two are the original upstream source tarball, which typically is of the form *.orig.tar.gz, and a diff file, which may be a file like *.diff.gz (old style), or debian.tar.gz (3.0 (quilt) source format). In both cases (old-style diff.gz or newer debian.tar.gz), the original tarball is unpacked, and the diff is applied, resulting in a source directory with a debian subdirectory. In the former case, patches applied by Debian to the upstream sources are applied directly to the source. In the latter case, patches applied by Debian to the upstream sources live inside the debian/patches directory. The dsc file contains information about the other two files mentioned above, including checksums, so that corruption can be detected during the unpacking process. The changes file is similar, but also contains information about the binary (deb) files. Its purpose is different - it is used by the archive software to keep track of updates in an archive, which includes both source and binary packages. From a user point of view, the changes file is not so interesting, unless you are planning to maintain your own package archive. Both the changes and dsc files is obtained when binary packages are built from the Debian sources. So, in practice, a user does not need to edit either dsc or changes files. NOTE: A typical way to run a Debian package build process is by doing debuild -uc -us, using the debuild script from the devscripts package. This creates the following files (for source format 3.0): *.changes, *.dsc, *.debian.tar.gz, *.build (the build log) and the Debian binary files. Sometimes, the *.dsc and *.debian.tar.gz will already exist if the source directory was unpacked from pre-existing Debian sources, but will be overwritten if the version number is not changed.
Difference between .changes and .dsc files when manually updating a package?
1,526,491,902,000
I was thinking about trying to package Matlab (a proprietary piece of software) for Arch Linux by creating a PKGBUILD to handle installation, dependencies, and conflicts. With the standard Matlab Linux installer it places everything in a local directory and does not require many external packages. That said, it provides a number of standard library files (e.g., libgcc_s.so and libstdc++.so) as well as a complete JRE. Can these types of files be removed (possibly replaced by links) and supplied by additional package dependencies?
I try to maintain the PHP App Engine package on AUR and I'm installing it in /opt which was where you should put a self-contained Matlab package (in something like /opt/matlab) and sym-link the executable back to /usr/bin and other stuff back to /usr/share/applications and what not. I would take a look at a few other packages that re-package binaries for arch. Like the Dropbox or Google Chrome packages. The Chrome package in particular depends on the Debian binary so they drop the Debian specifics when installing on arch. On the other hand, if you drop everything into /opt/matlab as-is rather than strip common libraries and the JRE you're much more likely to have a working Matlab that doesn't break or have to be re-tested and re-packaged every time a dependency changes. You could offer two flavours: a Matlab-complete package and a Matlab-minimal package.
Repackaging proprietary software
1,392,715,368,000
There is a lot of software which is released as shell installers, for example: Netbeans Mathematica Bazel (it also provide deb and tar.gz, but .sh is popular) Nvidia Graphics Driver and so on. This way to install software is convenient and universal. Is there a tool (like NSYS and Inno Setup in Windows to generate .exe installers) on Unix-like platform which can automatically generate a .sh installer with the archive of target software and simple configuration? I prefer an open-source solution.
I’m not sure about installers being particularly convenient (compared to distributions’ native packages). However there is a tool which does what you’re looking for, MojoSetup, which produces a single shell script containing the archive to be installed and the installer itself.
Is there .sh installer (software archive is append to .sh flat text file) generating tools for unix?
1,392,715,368,000
I'm currently building a large project that contains sources written in few languages such as C,C++ & Python. I recently managed to (painfuly) handle autotools to make a proper install. Next step is to create .deb because our project is meant to run on debian stretch. I tried several ways to do this but i can't get it working whether the way. Tree .deb generated by checkinstall : unpack/ ├── etc │   └── nina │   ├── auto_blacklist.txt │   ├── blacklist.txt │   ├── conf │   ├── keywords.txt │   ├── rubbish_links.txt │   └── whitelist.txt └── usr ├── local │   ├── bin │   │   ├── geckodriver │   │   └── nina │   ├── lib │   │   └── python2.7 │   │   └── dist-packages │   │   ├── nina.py │   │   ├── nina_py_installed_files.txt │   │   ├── Uinput_wrapping_module-2.0.egg-info │   │   └── uinput_wrapping_module.so │   └── share │   └── man │   └── man1 │   └── nina.1.gz └── share └── doc └── nina ├── COPYING ├── doc │   ├── Doxyfile │   └── nina.1 ├── README └── README.md Tree .deb generated by debhelper (v9): unpack/ ├── etc │   └── nina │   ├── auto_blacklist.txt │   ├── blacklist.txt │   ├── conf │   ├── keywords.txt │   ├── rubbish_links.txt │   └── whitelist.txt └── usr ├── bin │   └── nina ├── lib │   └── python2.7 │   └── dist-packages │   └── nina.py └── share ├── doc │   └── nina │   ├── changelog.Debian.gz │   └── copyright └── man └── man1 └── nina.1.gz As you can see it's not quite the same (sic). I'm more or less understanding what checkinstall does : it runs make install commands and just get files outputs to place it where it's installing on MY machine. debhelper seems to be a way more proper tool here. (installing in /usr/lib and not /usr/local/lib, allow us to sign packages & so on.) and i'd prefer to use it but it's not working as expected to do. And on huge plus on debhelper way is that it's actually handling dependancies specified in debian/control and stuff. But checkinstall doesn't. What debhelper is not doing : Getting some binary (geckodriver) from internet source and placing it in /usr/bin installing an homemade python module Those actions are performed in my Makefile.am by overriding install-exec-local: (& respectively uninstall-local:) methods and executing some bash commands. --- So my question is : how could i keep best parts of those two packaging ways to made it "perfect" ?
Downloading things from the internet is something a Debian package build is not supposed to be doing. If you use some 'build in clean chroot' helper, it may not even be able to do so. However, plain dpkg-buildpackage should be able to do so. If your autotools build system does the right thing, then nothing should be needed; otherwise, you'll need to add the necessary commands to an override_dh_foo command (see 'man dh' on that). For Python modules, what you need to do is install the .py files from your build system, too, respecting $DESTDIR. If you do so, debhelper in dh mode should just DTRT. If none of that worked, please produce a minimal version of your package that exhibits the problem; otherwise this is very much a crystal ball problem.
Problems packing a .deb from autotools. (checkinstall, debhelper, ...)
1,392,715,368,000
I am trying to make a debian package from a Qt application relying on OpenCV. What I did so far: I set up an Ubuntu in a Virtualbox I installed the neccessary software to compile and run the application (Qt related things, ffmpeg, codecs, OpenCV etc.) I successfully compiled and ran the application I created a GPG key With dh_make I created the debian directory in my project dir I added the packages to debian/control->Build Depends what I got by executing dpkg-depcheck -d qmake I added to the Depends also what I got by dpkg-depcheck -d SampleApp I edited the copyright and changelog files I tried to run dpkg-buildpackage -b At this point I got the error message: dpkg-shlibdeps: error: no dependency information found for /usr/local/lib/libopencv_imgcodecs.so.3.1 (used by debian/sampleapp/opt/SampleApp/bin/SampleApp) dh_shlibdeps: dpkg-shlibdeps -Tdebian/sampleapp.substvars debian/sampleapp/opt/SampleApp/bin/SampleApp returned exit code 2 make: *** [binary] Error 2 dpkg-buildpackage: error: debian/rules binary gave error exit status 2 All these files can be found under /usr/local/lib/. I have read this: https://www.debian.org/doc/debian-policy/ch-sharedlibs.html but I could not find the solution. How could I add these dependencies to the package? Edit: Build-Depends field: Build-Depends: debhelper (>= 8.0.0), libpopt0:i386, libqt5core5a:i386, qtdeclarative5-dev, libglib2.0-0:i386, qtchooser, pkg-config, qt5-qmake:i386, locales Depends field: Depends: ${shlibs:Depends}, ${misc:Depends}, udev, libxext6:i386, libxcomposite1:i386, libopencore-amrwb0:i386, libglib2.0-0:i386, libpangocairo-1.0-0:i386, libva-drm1:i386, libxinerama1:i386, libmp3lame0:i386, libnih1:i386, libx11-6:i386, libxcb-render0:i386, libffi6:i386, libgdk-pixbuf2.0-0:i386, libdrm2:i386, libvorbis0a:i386, libfontconfig1:i386, libxrender1:i386, libpango-1.0-0:i386, libdbus-1-3:i386, libpixman-1-0:i386, libopenexr6:i386, libxvidcore4:i386, libjpeg-turbo8:i386, libcgmanager0:i386, libcairo2:i386, libjasper1:i386, libxfixes3:i386, libilmbase6:i386, libtiff5:i386, libusb-1.0-0:i386, libdc1394-22:i386, libxi6:i386, libfreetype6:i386, libxrandr2:i386, libqt5network5:i386, libpng12-0:i386, libthai0:i386, libxcb-shm0:i386, libva1:i386, libvorbisenc2:i386, libtheora0:i386, libharfbuzz0b:i386, libicu52:i386, libjbig0:i386, libopencore-amrnb0:i386, libogg0:i386, libxcursor1:i386, libxcb1:i386, libraw1394-11:i386, libudev1:i386, libnih-dbus1:i386, libqt5core5a:i386, libgraphite2-3:i386, libva-x11-1:i386, libatk1.0-0:i386, libexpat1:i386, libgtk2.0-0:i386, libpangoft2-1.0-0:i386, libdatrie1:i386, libxdmcp6:i386, libvdpau1:i386, libxdamage1:i386, libxau6:i386
If the shared library you depend upon is installed in /usr/local/lib rather than /usr/lib (or similar) then I suspect it's not part of any package managed by the dpkg package manager. dh_shlibdeps wants to build a complete list of all of the things that your new package will have to depend on, but in this case one of those things seems to exist outside of any package so it can't be listed. You should install OpenCV from a Debian package (plus its corresponding -dev package, so you can build against it), not from a local installation.
How to add shared library dependencies to debian/control?
1,392,715,368,000
Problem: I'm trying to create a DEB package from my own sources. Everything is fine except handling the dependencies. As I understand, the most genuine way to mark the dependencies is to list them in the Depends section of the control file. My application requires two packages (aapt and zipalign) which are present only in the recent Debian (≥ jessie) and Ubuntu (≥ willy) repositories, so there would definitely be a problem installing my .deb on the older ones. Ideas: Several thoughts on this question: Install the needed standalone binaries (as a part of my .deb) to /usr/bin. PRO: The needed dependencies are present in my package as stand-alone binaries, so the Depends section won't be used, and the missing repository packages won't be a problem. CON: If the destination binaries already exist on the target machine as a part of another package, dpkg will encounter an error, and forcing the user to pass --force-overwrite option is not a greatest idea. Install the needed standalone binaries (as a part of my .deb) to /usr/share/myapp. PRO: The application uses its own isolated directory for the third-party binaries, so it does not alter the potentially existing packages (and, again, the Depends section is no longer needed). CON: The share directory is intended for an architecture-independent data, which the binaries are not. Install the whole application to the /opt/myapp directory. PRO: This method does not violate the FHS structure and keeps the files in a totally isolated directory. CON: However, this is not an authentic UNIX way, especially for the opensource software. Use the Recommends section instead of Depends for a weaker relation and provide some instructions to users on how to get the lacking packages. CON: The .deb package itself loses the point. None of these methods seems right to me. Are there any standard ways to handle this problem, did I miss some obvious solution? For example, some kind of conditional installation would be very helpful (install the third-party binaries only if the which command outputs nothing, etc.). Any thoughts and advises would be appreciated.
Provide (in addition to your main package) separate packages aapt and zipalign. Make sure they have ~ in their version (like this: zipalign-21-4~kefir1.deb). Then put them in your repository togheter with your main package which has Depends: aapt, zipalign (I use easy reprepro for hosting my repository, it's not hard). This is the Debian way (the same way backports.debian.org works) - if system is Jessie and provides aapt, that will be used (as you package has tilde in version, it is only used as last resort). If the system is older Debian, only then your extra packages will be pulled. And the users get the benefit of easy-to-get upgrades/security fixes to your packages. Additinal advantage is that on upgrade on Jessie, official packages will be pulled and overwrite your older extra pacakges (unless you specifically depend on specific version or extra packages, of course). And so you do not have old/duplicate versions hanging around, and users get additional benefits of debian security team patches etc.
Packaging deb: how to handle potentially missing dependencies
1,392,715,368,000
I have created a .deb package that copies files to the /opt/MyAppName directory. However, it does not appear in the Applications list, and I am unsure how to make that happen. How do I make my app appear in this list? I would like to have this appear here for all users who use install the .deb when I publish it.
You have to create a your_application.desktop file and then copy to /usr/share/applications/. Following is a sample .desktop file, I recently used to create sublime_text.desktop [Desktop Entry] Version=1.0 Type=Application Name=Sublime Text GenericName=Text Editor Comment=Sophisticated text editor for code, markup and prose Exec=/opt/sublime_text/sublime_text %F Terminal=false MimeType=text/plain; Icon=/opt/sublime_text/Icon/128x128/sublime-text.png Categories=TextEditor;Development; StartupNotify=true Actions=Window;Document; [Desktop Action Window] Name=New Window Exec=/opt/sublime_text/sublime_text -n OnlyShowIn=Unity; [Desktop Action Document] Name=New File Exec=/opt/sublime_text/sublime_text --command new_file OnlyShowIn=Unity; Give attention to Exec= and Icon=
How do I get my app to appear in the Applications list?
1,392,715,368,000
Edit: Updated full debian/rules and debian/control file I am working on a web project which need to build two debian packages for different deployment server. The main differences is the limitation of depends in debian/control file. So I wrote below: Source: web-app Section: non-free/web Priority: optional Maintainer: Me Build-Depends: debhelper (>= 4.0.0), build-essential Standards-Version: 3.8.0 Homepage: http://abc.com Package: web-app Architecture: all Depends: apache2, libapache2-mod-rpaf, openssl, rsync, imagemagick, mysql-client, ${other-depends}, libjs-cropper, libjs-jquery (>= 1.3.3-1), libjs-prototype, libjs-scriptaculous, libphp-phpmailer (>= 1.73-4), libphp-snoopy, tinymce (>= 3.2.6-0.1) Description: Short description Long description here. And the debian/rules file: #!/usr/bin/make -f DEB_DH_INSTALL_ARGS=-X .svn include /usr/share/cdbs/1/rules/debhelper.mk # Add here any variable or target overrides you need. # platform related package dependencies XENIAL_LIBS = php7.0, php7.0-opcache, php-apcu, php7.0-mysql, php7.0-gd PRE_XENIAL_LIBS = apache2-mpm-prefork, apache2-prefork-dev, php5.5, php-apc, php-gettext, php5-mysql, php5-gd ifeq ($(shell lsb_release -cd | awk '/^Codename:/ { print $2}'), xenial) PLATFORM_LIBS := $(XENIAL_LIBS) else PLATFORM_LIBS := $(PRE_XENIAL_LIBS) endif override_dh_gencontrol: dh_gencontrol -- -Vother-depends="$(PLATFORM_LIBS)" configure: configure-stamp configure-stamp: touch configure-stamp build: build-stamp build-stamp: configure-stamp dh_testdir dpkg-parsechangelog | awk '$$0 ~ /^Version:/ {print $$2}' > version.txt touch build-stamp One of the deployment target is Ubuntu 14.04 (Trusty), it should replace the other-depends with PRE_XENIAL_LIBS. But I got the final control file for the server like this: Depends: apache2, openssl, rsync, imagemagick, php, php-opcache, php-apcu, mysql-client, php-gettext, php-mysql, php-gd ... What's wrong, and how to fix it? =================Updates================= I have modified my debian/rules file based on Wouter's answer, but still doesn't get the correct substitution. Then I ran the command dpkg-buildpackage Then found a warning from the output: dpkg-gencontrol: warning: Depends field of package web-app: unknown substitution variable ${other-depends} Any clue?
First of all, your syntax is wrong, and will result in a command line like... dh_gencontrol -- -Vdist:Depends=""php7.0, php7.0-opcache, ..."" rather than (what you would want): dh_gencontrol -- -Vdist:depends="php7.0, php7.0-opcache, ..." this is because make doesn't do quoting, and you quote the data in the variable twice (once in the assignment, once when you use it). Drop one of them. Second, the reason it's not working is because your debian/rules file (as written) will not invoke dh_gencontrol with the extra arguments you want. A debian/rules file is a Makefile; therefore, it should have make rules etc in it, otherwise they get ignored. Something like this does what's expeted on my machine: #!/usr/bin/make -f %: dh $@ PKGS := abcd, efgh override_dh_gencontrol: dh_gencontrol -- -Vdist:Depends="$(LIBS)" If that still doesn't do what you're expecting, then a full example (i.e., something you can run dpkg-buildpackage on) is absolutely necessary. EDIT: You still have the double quoting. The XENIAL_LIBS and PRE_XENIAL_LIBS lines have quotes around them. Remove them. Also, you still haven't provided an example that dpkg-buildpackage will not complain about (for one thing, the control file is incomplete). It doesn't have to be what you're working on is that contains company secrets, but a minimal example that demonstrates the problem is essential. With what you've provided so far, I can't reproduce your problem. EDIT2: Your full rules file shows you're using CDBS, not debhelper's dh. As such, the override_dh_gencontrol target isn't being called (that's a dh-specific thing). I don't know how CDBS deals with overriding individual debhelper commands (which is why I hadn't replied to this before my holiday, hoping that maybe someone else might tell you what to do), but it's probably something along the lines of another CDBS_FOO_BAR variable that you must set. Luckily, your debian/rules file is simple enough that the port from cdbs is rather straightforward. Apply the following patch: --- rules.old 2016-07-12 16:57:05.350385288 +0200 +++ rules 2016-07-12 16:58:54.456536432 +0200 @@ -1,8 +1,7 @@ #!/usr/bin/make -f -DEB_DH_INSTALL_ARGS=-X .svn - -include /usr/share/cdbs/1/rules/debhelper.mk +%: + dh $@ # Add here any variable or target overrides you need. @@ -16,15 +15,10 @@ PLATFORM_LIBS := $(PRE_XENIAL_LIBS) endif +override_dh_install: + dh_install -X .svn override_dh_gencontrol: dh_gencontrol -- -Vother-depends="$(PLATFORM_LIBS)" - -configure: configure-stamp -configure-stamp: - touch configure-stamp - -build: build-stamp -build-stamp: configure-stamp - dh_testdir +override_dh_auto_build: dpkg-parsechangelog | awk '$$0 ~ /^Version:/ {print $$2}' > version.txt - touch build-stamp + dh_auto_build First, this drops the CDBS include and the CDBS-specific DEB_DH_INSTALL_ARGS variable, which dh does not support, and adds the wildcard Makefile target that dh requires in its place. It also adds the override_dh_install target, which replaces the DEB_DH_INSTALL_ARGS variable. Second, this drops the configure and build targets, as well as the configure-stamp and build-stamp ones. dh does not use those (and it is, indeed, harmful to retain them). Finally, we add another override target which does the dpkg-parsechangelog thing to create your version.txt file. Your actual build process is probably something else, but this shows you how to replace it.
Substvars Doesn't Work Correctly
1,392,715,368,000
I am building my first PKGBUILD. The package I want to build is from a git repo. I've read the wiki guidelines but the CVS page is not very complete... When I makepkg, the procces seem to go straight, but in some point, it gets stuck. I don't know how to proceed. # Maintainer: Tomas Sironi <sironitomas at gmail dot com> pkgname=mutter-meego-git pkgver=20101015 pkgrel=1 pkgdesc="" arch=('i686' 'x86_64') url="http://http://git.gitorious.org/meego-netbook-ux/mutter-meego/" license=('GPL') groups=() depends=() makedepends=('git') optdepends=() provides=('mutter-meego') conflicts=('mutter-meego') _gitroot="git://gitorious.org/meego-netbook-ux/mutter-meego.git" _gitname="mutter-meego-git" replaces=() backup=() options=() install= #~ source=($pkgname-$pkgver.tar.gz) noextract=() md5sums=() #generate with 'makepkg -g' build() { export INCLUDE="/usr/include" msg "Connecting to the GIT server..." if [ -d ${_gitname}/.git ]; then cd ${_gitname} git pull else git clone ${_gitroot} ${_gitname} cd ${_gitname} fi ./configure.ac -prefix /usr \ -libdir /usr/lib make || return 1 make INSTALL_ROOT=$pkgdir install || return 1 } package() { cd $srcdir/$pkgname-$pkgver make DESTDIR=$pkgdir install }
Firstly pkgdesc which is short for package description should be filled out. Next, you don't need to have empty array's. pkgname=mutter-meego-git pkgver=20101015 pkgrel=1 pkgdesc="what mutter meego does" arch=('i686' 'x86_64') url="http://git.gitorious.org/meego-netbook-ux/mutter-meego/" # was not a correct uri license=('GPL') depends=() #seems to depend on some gnome stuff makedepends=('git') provides=('mutter-meego') conflicts=('mutter-meego') _gitroot="git://gitorious.org/meego-netbook-ux/mutter-meego.git" _gitname="mutter-meego-git" #~ source=($pkgname-$pkgver.tar.gz) md5sums=() #generate with 'makepkg -g' build() { export INCLUDE="/usr/include" msg "Connecting to the GIT server..." if [ -d ${_gitname}/.git ]; then cd ${_gitname} git pull else git clone ${_gitroot} ${_gitname} cd ${_gitname} fi ./configure.ac -prefix /usr \ -libdir /usr/lib make || return 1 make INSTALL_ROOT=$pkgdir install || return 1 } package() { cd $srcdir/$pkgname-$pkgver make DESTDIR=$pkgdir install } remember the stuff in build is the same as if you were typing it out to build it. You have to run autogen.sh... and I couldn't do that due to some missing gnome dependency (I run KDE). You'll also notice that ./configure.ac isn't executable... so how would you execute it? Figure out how to build it by hand and then put that in the build section of the PKGBUILD.
Building PKGBUILD
1,392,715,368,000
I am developing a Rust application and I want to provide packages for Debian. I have something similar to this configuration under debian/controls Source: com.github.yourname.yourrepo Section: x11 Priority: extra Maintainer: Someone Build-Depends: cargo, debhelper (>= 9), libgtk-3-dev, libglib2.0-dev Standards-Version: 3.9.3 Package: com.github.yourname.yourrepo Architecture: any Depends: ${misc:Depends}, ${shlibs:Depends} Description: SomeApp Some app developed in Rust But when I try to build it with debuild it complains that I don't have cargo. However, if I type cargo in my terminal it is present in the system. I guess the reason is that I didn't install the cargo package. And I don't want to force people to install it either, if they already have cargo. Is there a way to enforce having a dependency that is not a Debian package?
No, there is no way to enforce a build- (or other) dependency which isn’t a Debian binary package. All the dependency, conflict etc. fields declare relationships between packages. You can cheat by using equivs to create fake packages, if you want to use your own cargo instead of the packaged one, but then you won’t be able to check that your package builds correctly for other Debian users.
Debian Build-Depends on non-package binary
1,392,715,368,000
Suppose I have a debian package housing as follows: project_pkg/ .git project_0.0-1/ debian/ install ... project (git submodule with tagged commit) With the following install file: // .../debian/install #!/usr/bin/env bash find $(pwd)/project/path/to/binaries -type f -executable -printf "$(pwd)/project/path/to/binaries/%f usr/bin\n" And where the project has a make entrypoint such that make -C project build for example produces all the necessary files I would need to package. The make/build component of the entire packaging process works right now. However, ideally, I find all the necessary files I need to install from the install folder. I have a solution for now, which would involve copying the binaries in the project to the debian/tmp/ from either outside /debian or from /debian/rules. But I could just as easily set the dh_install to fetch the files from the project, if there was some way to do so.. A) Is there a way to get dh_install to fetch files from the project, B) Is simply running two find commands and copying the binaries to the debian/tmp dir the way to go? C) Should I just hack it and prefix the printf in the install find command with ../..
dh_install takes paths relative to the current directory, which is generally the top-level directory of the package. In your case that’s project_0.0-1, so your find invocations should output project/path/to/.... Yes, that would work too. I know I recommended dh_install, but the first rule of debhelper remains that it’s a tool at your service, and if you find it’s easier to skip it, you might as well do so: override_dh_install: install -d debian/package/usr/bin find project/path/to/binaries -type f -executable -exec install -t debian/package/usr/bin {} + \; I don’t think that would work. (In most cases I’d expect your main build to be capable of installing binaries to a given target, but that’s another discussion.)
Dpkg dh_install: copy files from the build directory rather than the debian/tmp dir?
1,392,715,368,000
I'm trying to build OpenSSH 7.9p1 from source, but I can't find a way to delete (or not include), for instance, ssh-agent, ssh-keygen, scp, sftp, sshd, etc. – of course, assuming none of those are required for the ssh command to work. Ideally I would only need the client: the ssh command, but again, I'm not sure what other pieces are required. I think most of what's build/installed is used by the server, not by the client.
Yes, you can do this with the default build system provided. If you look at the Makefile that is generated by running the provided ./configure script, you should see that the default (first) target is TARGETS=ssh$(EXEEXT) sshd$(EXEEXT) ssh-add$(EXEEXT) ssh-keygen$(EXEEXT) ssh-keyscan${EXEEXT} ssh-keysign${EXEEXT} ssh-pkcs11-helper$(EXEEXT) ssh-agent$(EXEEXT) scp$(EXEEXT) sftp-server$(EXEEXT) sftp$(EXEEXT) (for Unix-like systems, $(EXEEXT) should be empty). Each has its own separate build target / rule so for example you can do: make ssh to make only the client. Ex. $ make ssh <snip> $ find . -type f -executable -newermt yesterday ./config.status ./ssh $ ./ssh -V OpenSSH_7.9p1, OpenSSL 1.1.0g 2 Nov 2017
Build OpenSSH client only
1,392,715,368,000
I have two Python scripts, and I need to package them into a Debian package. I have tried quite a few things with some success. For example, I made a setup.py and then used python-stdeb to create a package (which - if I recall properly - did not work very well), and I also made my own package from scratch with a structure like so: project DEBIAN/ changelog copyright compat rules control install usr/ bin/ script1 script2 It was something like that, anyway. I got a package that then acted like a Debian package and I could use dpkg -b project to first build it and then dpkg -i package.deb to install the Debian packaging, however it didn't install anything (well it did install some things, but it didn't install the scripts that I wrote, which is what I would really like to install). So, how can I just make a package that will install my Python scripts. I don't care if they go to X11 or I have to say "Install to ~/package". All I want is for my scripts to go into a package so that someone else can install that package and have my scripts. My guess is that I have to put metadata or something in the install file, but I don't know what to put in there.
One fast and easy way could be to use alien, it convert .tar to .deb: tar czf pkg-name.tgz usr/ fakeroot alien -d pkg-name.tgz Else use the old way, I use a Makefile like that: all: deb deb: mkdir -p tmp/usr/bin tmp/DEBIAN tmp/etc tmp/usr/share/man/man5 find tmp -type d | xargs chmod 755 cp some.conf tmp/etc/ cp man/some.5 tmp/usr/share/man/man5/ cp somecmd tmp/usr/bin/ tar c --owner root --group root -v -z -f tmp/data.tar.gz -C tmp ./etc ./usr cd tmp && find usr/ etc/ -type f | xargs md5sum >DEBIAN/md5sums awk '/^#Package:/{i++}i {print substr($$0,2); }' Makefile >tmp/DEBIAN/control tar c --owner root --group root -v -z -f tmp/control.tar.gz -C tmp/DEBIAN ./control ./md5sums echo 2.0 >tmp/debian-binary ar rcv pkg-name_1.0-1.deb tmp/debian-binary tmp/control.tar.gz tmp/data.tar.gz .phony: clean clean: -rm -fr tmp #Package: pkg-name #Version: 1.0 #Section: net #Priority: optional #Architecture: all #Essential: no #Installed-size: 100 #Maintainer: Name <mail@here> #Depends: optional dependencies #Description: short descr # long descr
Make debian package to install python
1,392,715,368,000
I'm creating a deb-file and enumerating the files and paths I need to have in the package using the install file. It looks like dir1/* path1 dir2/* path2 ... But in a result deb-file there are no hidden files from dir1 and dir2. It looks like * doesn't match hidden files. How could I match them apart from specifying each one explicitly?
The globs used by dh_install are perl globs, which are modeled after csh globs. These do not match hidden files by default. In order to get all files, including hidden files, you will need to use two globs. Here is an example: dir1/.* path1 dir1/* path1 Update: It has been pointed out in comments to this answer that .* matches . and ... Since perl's globbing doesn't offer anything to avoid this situation, the dotfiles will need to be added explicitly. dir1/.htaccess path1
Creating deb file: hidden files specification by `install` file
1,392,715,368,000
I try and build my package for Ubuntu but I can't understand the error. I get this debuild -S -sa dpkg-buildpackage -rfakeroot -d -us -uc -S -sa dpkg-buildpackage: source package opsh dpkg-buildpackage: source version 0.1-1 dpkg-buildpackage: source distribution unstable dpkg-buildpackage: source changed by Niklas Rosencrantz <[email protected]> dpkg-source --before-build opsh fakeroot debian/rules clean dh clean --with autotools_dev dh_testdir dh_auto_clean dh_autotools-dev_restoreconfig dh_clean dpkg-source -b opsh dpkg-source: info: using source format '3.0 (quilt)' dpkg-source: info: building opsh using existing ./opsh_0.1.orig.tar.gz dpkg-source: info: local changes detected, the modified files are: opsh/src/check.t dpkg-source: error: aborting due to unexpected upstream changes, see /tmp/opsh_0.1-1.diff.TooA5f dpkg-source: info: you can integrate the local changes with dpkg-source --commit dpkg-buildpackage: error: dpkg-source -b opsh gave error exit status 2 debuild: fatal error at line 1376: dpkg-buildpackage -rfakeroot -d -us -uc -S -sa failed
The error is dpkg-source: info: local changes detected, the modified files are: opsh/src/check.t That means that opsh/src/check.t doesn’t match the contents of opsh_0.1.orig.tar.gz. In Debian packages, any changes to a file outside the debian directory must be reversible. Since you’re using “3.0 (quilt)” packaging, the best way to handle this is to add a patch. The Debian wiki has the details, but the error message gives you a quick solution to turn your changes into a patch: dpkg-source --commit You’ll need to rename and edit the patch appropriately (as generated, it should contain enough comments for you to figure things out). You should only do this if the file really is changed in a way significant for the build. If it’s a file left over from a previous build, not shipped in the original tarball, you should instead add it to debian/clean so that it gets removed at the start of the build. This can also apply to files which are shipped in the tarball but get fully regenerated during the build.
Fail to build for Ubuntu
1,392,715,368,000
I am using Fedora's Copr service to build a package with Non Numeric Release according to specifications at Packaging: Naming Guidelines. Right now there are two successfully built packages: paper-icon-theme 1.0-1.20151202git954bb77 paper-icon-theme 1.0-1.20151202gited30409 Of these two the 1st one is more recent. However when I do a dnf update, the package paper-icon-theme-1.0-1.20151202gited30409 is installed which is the older version. I also tried after cleaning expire-cache but it gives the same result. What am I doing wrong here? Is it because of the way I am naming my packages? Link to my Copr builds
In short, yes it is because of your package names. More specifically, the problem relates to the N-V-R string, which is the name, version, and release. The sort algorithm is rather complicated, but it looks for the package with the highest value of version-release, and that is deemed to be the most recent package. Because the last part of the package release string is higher on the second package than the first ("ed30409" > "954bb77"), it considers the second package to be more recent.
RPM Package naming
1,392,715,368,000
I have some really old systems (like prehistoric in gentoo timescale) and I would like make binary packages there, but I do not have all the sources for normal compilation, as it was deleted from web many years ago. Is there way to make binary packages from what I have already installed (even at the risk of changed configs, missing/modified files and so)? I would like to create "snapshot" of the system at current state, then try update something here and there and if it went wrong, reinstall it from that packages. I understand, that such packages have nearly no meaning on other computers, or after some larger changes in make.conf/USE etc. etc., but anyway ... is there way to somehow extract actual files from living system, make binary package from it and reinstall it later other, than manually copy everything to other tree, zip that tree and in case of emergency just unzip the tree and copy it back?
The quickpkg command that comes with portage can take a package atom that corresponds to an installed package and generate a binary package for it. For example: $ sudo quickpkg sys-devel/gcc * Building package for sys-devel/gcc-5.4.0-r3 ... [ ok ] * Packages now in '/usr/portage/packages': * sys-devel/gcc-5.4.0-r3: 53.9M That command produced /usr/portage/packages/sys-devel/gcc-5.4.0-r3.tbz2.
Gentoo - how make binary packages from allready installed packages
1,392,715,368,000
I have already seen Easily unpack DEB, edit postinst, and repack DEB - however, that one doesn't explain how to properly change the .deb version number if I want to do some changes the original .deb file. I'm on Ubuntu 14.04, and let's take hostapd for an example: $ mkdir /tmp/debtest $ cd /tmp/debtest/ $ apt-get download hostapd Get:1 http://dk.archive.ubuntu.com/ubuntu/ trusty-updates/universe hostapd amd64 1:2.1-0ubuntu1.4 [423 kB] Fetched 423 kB in 1s (361 kB/s) $ ls -la hostapd_1%3a2.1-0ubuntu1.4_amd64.deb -rw-rw-r-- 1 myuser myuser 422846 Nov 10 2015 hostapd_1%3a2.1-0ubuntu1.4_amd64.deb Now we can unpack as in the cited link above: $ mkdir unpack-hostapd $ dpkg-deb -R hostapd_1%3a2.1-0ubuntu1.4_amd64.deb unpack-hostapd $ ls -la unpack-hostapd/ total 20 drwxr-xr-x 5 myuser myuser 4096 Jan 26 11:31 . drwxrwxr-x 3 myuser myuser 4096 Jan 26 11:31 .. drwxr-xr-x 2 myuser myuser 4096 Nov 9 2015 DEBIAN drwxr-xr-x 6 myuser myuser 4096 Nov 9 2015 etc drwxr-xr-x 4 myuser myuser 4096 Nov 9 2015 usr Let's say I want to make a trival change, say appending a line of text to README.Debian: echo "Just a test line" >> unpack-hostapd/usr/share/doc/hostapd/README.Debian ... and now I want to repack this as a new .deb. First question - is there a way to retrieve the current (old) version of the package from the unpacked state? Because I don't trust filenames, I'd usually do: $ apt-cache policy hostapd hostapd: Installed: (none) Candidate: 1:2.1-0ubuntu1.4 ... ... and this tells me I've downloaded version 1:2.1-0ubuntu1.4 of the package when I used apt-get download... - but not necessarily what is the version inside the unpack-hostapd directory. Is there a command that will tell me the package version of the originating .deb that was unpacked into the unpack-hostapd directory? Now, I've used debchange as dch -i before to auto-increment a version number (although in other source projects), but when I try it here: $ cd unpack-hostapd $ pwd /tmp/debtest/unpack-hostapd $ dch -e dch: fatal error at line 580: Cannot find debian/changelog anywhere! Are you in the source code tree? (You could use --create if you wish to create this file.) $ find . -name 'changelog*' ./usr/share/doc/hostapd/changelog.Debian.gz $ dpkg -c ../hostapd_1%3a2.1-0ubuntu1.4_amd64.deb | grep changelog -rw-r--r-- root/root 2126 2015-11-09 14:56 ./usr/share/doc/hostapd/changelog.Debian.gz ... but, I cannot change any of that here. So, my second question is: is there an easy way (like dch -i is for source packages) to change the .deb package version number, and possibly add a changelog, to an unpacked .deb package like this? Of course, ultimately I'd like to re-pack this new version as a .deb package, for which the link above suggests something like dpkg-deb -b unpack-hostapd hostapd_1%3a2.1-0ubuntu1.4_amd64.deb; although, say here I'd rather use version 1:2.2, so I'd finally use a filename like dpkg-deb -b unpack-hostapd hostapd_1%3a2.2_amd64.deb - however, that version should also match what is recorded inside the .deb, and I don't know how to do that...
The version is defined in the binary control file, which is extracted in DEBIAN/control when using dpkg-deb -R. Look for a Version: field: Version: 1:2.5.2+v2.4-3+b1 This is where you'd edit the version number for your new package. (You can optionally add a changelog entry to the changelog in usr/share/doc/hostapd/changelog.Debian.gz.) Then you can rebuild your package like this, so that dpkg-deb determines the correct file name for you: mkdir newpkg dpkg-deb -b hostapd newpkg This will produce a new package in the newpkg directory, named appropriately. Ideally you should check your new binaries' library requirements and update the dependency information in control too!
Easily unpack deb, repack deb with new version
1,392,715,368,000
I'm thinking about organization of open source packages across different distributions, and one of the issues that might arise is that different distributions decide to assign a different package name to the same thing, or to have a package with the same name that refers to one thing in one distro and something completely different in another. Are there any practical examples of the latter, or is it just a theoretical possibility? I've searched for a while and did not find an actual example that I could point at and say "here, this scenario has actually happened".
docker Ubuntu 15.04: $ lsb_release -rd Description: Ubuntu 15.04 Release: 15.04 $ apt-cache show docker Package: docker ... Description-en: System tray for KDE3/GNOME2 docklet applications Docker is a docking application (WindowMaker dock app) which acts as a system tray for any desktop environment, allowing you to have a system tray without running the KDE/GNOME panel Docker was designed to work with Openbox 2, but it should work fine in any window manager. Description-md5: 032a37ba6228c22cbca1c0b960030eaa Bugs: https://bugs.launchpad.net/ubuntu/+filebug Origin: Ubuntu Fedora 22: $ cat /etc/os-release NAME=Fedora VERSION="22 (Twenty Two)" $ dnf info docker ... Available Packages Name : docker ... Description : Docker is an open-source engine that automates the deployment of any : application as a lightweight, portable, self-sufficient container that will : run virtually anywhere. : : Docker containers can encapsulate any payload, and will run consistently on : and between virtually any server. The same container that a developer builds : and tests on a laptop will run at scale, in production*, on VMs, bare-metal : servers, OpenStack clusters, public instances, or combinations of the above.
Example of a package that has the same name in two different distros but refers to unrelated upstream projects for each?
1,392,715,368,000
Install fine. Works fine. Next day the logo and apps menu entry is gone. Doesn't seem to matter what I do. On installation, GDebi refused to install the package, and crashed instead, so I used dpkg -i. As for the logo and apps menu entry, I suppose I'll just have to glue it in place. Sorry Firefox. I install the latest version with dpkg, I use it for a while, it goes into the Internet tab fine. Then I shut down, and the next time I start up it's missing. The program runs fine from a terminal as google-chrome So, my question is, where are the details of this stuff stored? Is it a single text file in /usr? Is it a bunch of stuff that's hard to edit by hand? And where is the logo likely to reside? I know there's probably a GUI way to do this, but it will be more satisfying, and possibly less error-prone, if I simply override whatever's causing Ubuntu/GNOME to lose the icon and applications menu entry.
I've heard the same complaints from several people who tried to use recent development builds of Google Chrome. You probably should use a more stable version of it (or use the Chromium browser provided in the Ubuntu repositories, which is the open source version of Google Chrome). Or otherwise you can wait until Google fixes this bug...
dpkg and google-chrome don't get along with gnome
1,392,715,368,000
I've been learning about Linux package management recently (https://superuser.com/questions/393681/how-to-find-out-which-versions-of-a-package-can-i-install-on-apt, https://askubuntu.com/questions/340530/how-can-i-check-the-available-version-of-a-package-in-the-repositories, Why do different Linux distros have different package formats (and package managers)?, https://itsfoss.com/ubuntu-repository-mechanism/, https://itsfoss.com/sources-list-ubuntu/) If I understand correctly, /etc/apt/sources.list (and .list/.sources files in /etc/apt/sources.list.d/) controls where apt-get (and related utilities) get packages/source code from. Since my current release is jammy, I have entries in my sources.list such as the following: deb http://archive.ubuntu.com/ubuntu/ jammy main restricted deb-src http://archive.ubuntu.com/ubuntu/ jammy main restricted ...which I think means that (after running apt-file update) apt-cache policy libuv1 will look for all available versions of libuv1 at http://archive.ubuntu.com/ubuntu/dists/jammy/main/ $ apt-cache policy libuv1 libuv1: Installed: 1.43.0-1 Candidate: 1.43.0-1 Version table: *** 1.43.0-1 500 500 http://archive.ubuntu.com/ubuntu jammy/main amd64 Packages 100 /var/lib/dpkg/status $ $ apt-cache madison libuv1 libuv1 | 1.43.0-1 | http://archive.ubuntu.com/ubuntu jammy/main amd64 Packages libuv1 | 1.43.0-1 | http://archive.ubuntu.com/ubuntu jammy/main Sources $ My question is: is there a way to query available versions of the libuv1 package for releases other than jammy without editing sources.list? From the above apt-cache output, it appears that 1.43.0-1 is the only version available - both as a package and as source. But I know the libuv authors have newer versions. I'd like to learn whether I can query non-jammy package repositories for availability of newer libuv1 packages or source. Out of an excess of caution, I am nervous about adding entries like deb-src http://archive.ubuntu.com/ubuntu/ mantic main restricted to sources.list because I'm afraid I might forget, then later carelessly run apt-get upgrade -- wouldn't that then run the risk of creating a FrankenDebian? I only want to find out -- if only for curiosity's sake -- whether newer versions of libuv1 source/packages exist in releases other than my current, without the risks incurred by editing sources.list -- is there a way? Put another way: is it necessary to edit sources.list both to query availability and install packages, or is it possible to query package availability without editing the file?
Constantine A.B.’s answer alludes to it without going into detail; rmadison is the tool you’re looking for. Install the devscripts package: $ sudo apt install --no-install-recommends devscripts wget (devscripts has a lot of optional dependencies, hence the explicit --no-install-recommends; rmadison needs wget, which is one of those optional dependencies), then run rmadison to query the online database: $ rmadison libuv1 libuv1 | 1.8.0-1 | xenial/universe | source, amd64, arm64, armhf, i386, powerpc, ppc64el, s390x libuv1 | 1.18.0-3 | bionic | source, amd64, arm64, armhf, i386, ppc64el, s390x libuv1 | 1.34.2-1ubuntu1 | focal | source, amd64, arm64, armhf, i386, ppc64el, riscv64, s390x libuv1 | 1.34.2-1ubuntu1.3 | focal-security | source, amd64, arm64, armhf, i386, ppc64el, riscv64, s390x libuv1 | 1.34.2-1ubuntu1.3 | focal-updates | source, amd64, arm64, armhf, i386, ppc64el, riscv64, s390x libuv1 | 1.43.0-1 | jammy | source, amd64, arm64, armhf, i386, ppc64el, riscv64, s390x libuv1 | 1.44.2-1 | lunar | source, amd64, arm64, armhf, i386, ppc64el, riscv64, s390x libuv1 | 1.44.2-1 | mantic | source, amd64, arm64, armhf, i386, ppc64el, riscv64, s390x libuv1 | 1.46.0-2ubuntu1 | noble | source, amd64, arm64, armhf, i386, ppc64el, riscv64, s390x libuv1 | 1.46.0-3 | noble-proposed | source, amd64, arm64, i386, ppc64el, riscv64, s390x The syntax is simple enough, rmadison followed by the name(s) of the binary and/or source packages you’re interested in. Since libuv1 is imported directly from Debian, without changes most of the time, you might want to check there too: $ rmadison -u debian libuv1 libuv1 | 1.24.1-1+deb10u1 | oldoldstable | source, amd64, arm64, armel, armhf, i386, mips, mips64el, mipsel, ppc64el, s390x libuv1 | 1.24.1-1+deb10u1 | oldoldstable-debug | source libuv1 | 1.40.0-2 | oldstable | source, amd64, arm64, armel, armhf, i386, mips64el, mipsel, ppc64el, s390x libuv1 | 1.44.2-1 | stable | source, amd64, arm64, armel, armhf, i386, mips64el, mipsel, ppc64el, s390x libuv1 | 1.46.0-2 | testing | source, amd64, arm64, armel, armhf, i386, mips64el, ppc64el, s390x libuv1 | 1.46.0-3 | unstable | source, amd64, arm64, armel, armhf, i386, mips64el, ppc64el, riscv64, s390x libuv1 | 1.46.0-3 | unstable-debug | source So libuv 1.47.0 hasn’t been packaged yet, whether for Debian or Ubuntu. (For readers using Debian, the defaults are the opposite: rmadison with no -u option queries Debian, rmadison -u ubuntu queries Ubuntu.)
Is it possible to query versions of APT packages from not-my-current release without editing sources.list?
1,392,715,368,000
I'm trying to get a binary compiled on Ubuntu to run on CentOS 7 (both 64bit, one host, the other vm). So far I've copied the binary with all the shared libs. I no longer get the missing library error but a nice ld SIGSEGV Program received signal SIGSEGV, Segmentation fault. 0x00007ffff5d67681 in ?? () Missing separate debuginfos, use: debuginfo-install glibc-2.12-1.149.el6.x86_64 (gdb) where #0 0x00007ffff5d67681 in ?? () #1 0x00007fffffffe3f0 in ?? () #2 0x00007ffff7decdd4 in _dl_check_map_versions () from /lib64/ld-linux-x86-64.so.2 #3 0x00007ffff7de08a3 in dl_main () from /lib64/ld-linux-x86-64.so.2 #4 0x00007ffff7df2aee in _dl_sysdep_start () from /lib64/ld-linux-x86-64.so.2 #5 0x00007ffff7dde4a4 in _dl_start () from /lib64/ld-linux-x86-64.so.2 #6 0x00007ffff7dddb08 in _start () from /lib64/ld-linux-x86-64.so.2 #7 0x0000000000000001 in ?? () #8 0x00007fffffffe8bb in ?? () #9 0x0000000000000000 in ?? () I have the source but I barely managed to compile and test on ubuntu, as it relies on some libs that are built from source, tryed on the centOS but the g++ version is older and didn't support c++11. After installing the devtools version now I get other errors, but that's a different question I guess. So is there anything that I can do to get past this error? Will it eventually run this way? What is the easiest way to port something from Ubuntu to CentOS ?
I would suggest not doing this. It's generally easier to build binaries for the different distros within that distro's package building process. On CentOS, that would be making use of rpmbuild. Since you're dealing with VMs it would be much more trivial to setup a CentOS 7 VM + build tools and then do the package construction there. Observations from a User of a Source Based Distribution I don't normally jump on the bandwagon and edit other peoples answer's, but I find myself earning my reputation here slowly but surely, by helping people realize the difference between a source based distribution, of which there are 3 major ones: Linux from Scratch Gentoo Slackware and a binary based distribution, of which there are 2 major ones: Debian Redhat/Fedora As of now, there is only 1 major hybrid distribution (cross between source, and binary): Arch Linux Whether Linux users like it or not, all the other Linux distributions are children to one of these 6 parents. With that being said, we move on to the next point that: It is Impossible to Mix Software From a Source Based Distribution with Software in a Binary Distribution Knowing this also means, unless you know what you're doing, you should not compile a single package from source on a binary distro. There are exceptions to this rule: The package you need doesn't exist in your distributions repository/tree/etc (This was the OP's reason for his question). You cannot find a Newer version of a needed package in your repository/tree/etc - See Bullet 9. Why the OP is Having an Issue Technically speaking, there is no difference in using a package and building from source when it comes to the final package, i.e., if you can build the package successfully, and it works, no one will fault you for doing it. You must remember that when you do it though, that the tools you used to build your application on one binary based distribution are greater than the versions of the tools available in another binary distribution. What the OP is seeing is the delta, or change, between the old and new packages. The delta or change is caused by the Package and OS Maintainers of Each OS, be it one of the 6 above, or the children, choosing what package they will mark stable for their OS. Once a package is chosen in a Binary Distribution, most times it's frozen until the next release, unless a Critical Bug is Discovered. A Source Based Distribution, on the other hand can choose to update items as soon as new sources are available, thus bugfixing on the fly. This is Why the OP is Having Issues The release schedule, and the update cycle for Ubuntu chose to adopt new versions of the Build Toolchain, before CentOS adopted them. Since CentOS is built on stability, the Build Toolchain may not be updated until their next major release. As such the OP was experiencing an issue similar to this, because Ubuntu's Build Toolchain supports C++11, and CentOS's does not until all the version mismatches are repaired, and will later run into issues with using multiple Package Managers. What the OP Should Have Done Determined the Build Tools Available for the system on which the Package will reside. In this case that would be CentOS. Here is a page on how to install them Properly. According to the list in the previous link, that compiler supports C++11. As a very experienced hunch the OP's version mismatch is occurring in either binutils or libtool Binutils depends on glibc, and libtool depends on binutils, therefore libtool indirectly depends on glibc I won't explain why nearly every package on any system indirectly depends on glibc just know that it does. If the Build Toolchain, after proper installation, had not supported C++11, the OP would be forced to use C++98 to alleviate the issue he is facing now. Having updated the Build Toolchain in Step 1 above, the OP should now compile his source code in the CentOS VM, and repair/fix as needed. If the OP requires a package, he should use rpmbuild, as this post suggests, as that is the native package manager to the VM where the package resides. Yum is NOT a package manager. Yum IS A Dependency Resolver References List of Linux Distributions C++0x/C++11 Support in GCC News, Status & Discussion about Standard C++
Running ubuntu binary on CentOS with all shared libs installed results in ld SIGSEGV
1,392,715,368,000
I've found an outdated PKGBUILD on AUR. The source URL that it references doesn't exist anymore. It can easily be fixed by incrementing a version number. What is the proper way of solving this? I've already left a comment, but should I also flag the package as out-of-date? Should I send the fixed PKGBUILD somewhere?
You're on the right track... from the ArchWiki: For starters, you can flag packages out-of-date. If it stays out-of-date for an extended period of time, the best thing to do is email the maintainer. If there is no response from the maintainer after two weeks, you could send mail to the aur-general mailing list to have a TU orphan the PKGBUILD if you're willing to maintain it yourself. Another option in the meantime, although this might not be a preferred practice... but, I have seen some users edit the PKGBUILD and then upload their version to a pastebin and then link to it in the comments. Other users will still need to make manual edits but at least the update will be known.
What to do about an outdated, but easily fixed, PKGBUILD in AUR?
1,392,715,368,000
Scripts to create debian package exist and work. I have to modify them. In new specific case there may be some optional files which I want to include to package. If I add them to package.install, then I fail as only those file don't exist. If I don't add them to package.install, then they will never be included to package even if they exist. To determine specific case I have special environment variable: SPECIFIC_CASE=CASE How should I set up debian package creation scripts to search for those files just in case of specific case? In file rules (which is designed as Makefile) I have targets: copy_files: override_dh_install: override_dh_auto_install: (empty) ...list of other overrides... install: postbuild: clean:
With most packaging tools in Debian, the contents of the a package package end up being whatever is in debian/package when dpkg-deb is run. You can place files there in whichever way you want, you don’t have to rely on dh_install (which is the tool which processes .install files). Thus: override_dh_install: dh_install install blah debian/package/wherever and so on. This is where you’d add your conditional file handling. However it’s important to realise that a packaging specification (and this isn’t specific to Debian) should be consistent: i.e. on a given architecture, building a package should always result in the same package contents. Packaging optional content usually involves building the project so that all the files are generated, and then dispatching them into different packages, not all of which need to be installed. (This can involve going to great lengths, e.g. the GCC build which has a few tricks so that the compiler driver knows about all the available languages but they don’t all have to be installed.)
Debian package with optional files
1,392,715,368,000
I am trying to build a bleeding-edge package (with new upstream versions packaged within hours) for Vim on Debian 7/8 and Ubuntu 12.04/14.04./16.04, the problem I keep running into is that Ubuntu 12.04 is having issues related to Python 3, so I would like to remove the python3 dependency for Ubuntu 12.04 and remove the configure options related to python3 in the rules for Ubuntu 12.04 only also. So the packages for Debian 7, 8 and Ubuntu 14.04/16.04 build with Python 3 support (and the corresponding python3 build dependencies), but the package for Ubuntu 12.04 builds without python3 support and without python3 build dependencies. Is this possible? If you are wondering whether this is necessary, here is my Open Build Service package providing Vim on Debian-based platforms (so you can see my packaging files there) and here is my build log (showing the errors related to Python 3) for building on 64-bit Ubuntu 12.04 http://paste2.org/wf59EzfM.
There is no way of changing build-dependencies during a build, for the very simple reason than package builds first download the build-dependencies, then run the build. If the build decides to change the build-dependencies, it's too late. The only modifiers you can use for build-dependencies are architecture specifiers, and build profiles, neither of which apply here. What you can perhaps do, is build-depend on python3 and python, then decide during the build (in debian/rules) how to configure the package, and adapt the various files that are used to calculate the binary packages' dependencies.
How to add dependencies to a Debian control and dsc file and configure options to a rules file that depends on the distro in question?
1,392,715,368,000
I am currently making a deb package with a collection of plain programs (e.g. shell scripts, python code, etc) and binaries (C code compiled with gcc). In order to meet the guidelines for package creation, I need to have a source package with the source code for the binaries. Because there is only one binary in my package, and the rest are all plain text programs, in what way should I make my source package? To elaborate: Should my source package Have the DEBIAN directory and then just the path to the binary (replaced with the binaries' source code? Have the just the binaries' source code in one directory without the DEBIAN directory, and then gunzip that one directory? Have the exact same directory layout as the real package, just replacing the binaries with their own source code (e.g. bin/somebinary becomes bin/somebinary.c)? Any help would be greatly appreciated!
First of all it's a very wide topic.You can use dpkg-buildpackge to build the source package from the sources.Because you explicitly mentioned that how your debian packaging should be, I am just going to write about it. You should have a debian directory inside your source folder. rules file inside the debian directory, you should overwrite some of the deb helper rules like auto configure or strip using deb helper keywords(For example using, override_dh_auto_configure: or override_dh_strip etc etc...) You should have an package.install file specifying what should go where, For example if you generated an binary then you should mention the path of the binary where should it get installed or if you have any shared objects(.so) files.If you are using automake then it will be very easy.You can just mention it in Makefile.am saying where your binary or library should get installed. You should have a control file used to mention the build dependencies and package dependencies.(The things which are required during your debian pakcage installation.) A post installation script used to perform any operations/changes after installing your debian pakcage.(For example if you want to change the permission of a file after the installation or something else). A changelog file having the description of changes on the package and the version number. If everything goes fine then dpkg-buildpackage should give you a package_arch_version.deb file. As I said it's a very huge topic. It will just give you an idea how a debian package looks and what it will contain? You should cutomize those files according to your requirements.
How to create source deb for package with binaries and non-binaries?
1,392,715,368,000
I would like to package my software (in C) into a .deb file, but I encounter some difficulties. It would be nice if someone could give me a hand. Let the source code be the following toy example: #include <stdio.h> #include <stdlib.h> #include <lbfgs.h> int main(void) { printf("liblbfgs will be used here!\n"); return 0; } In the above C program, liblbfgs library will be used. liblbfgs is available in repos. I have written the following simple Makefile: CXX=gcc CFLAGS=-Wall -g LIBS=-lm -llbfgs OUTPUT=toypackage $(OUTPUT): $(OUTPUT).o $(CXX) -o $(OUTPUT) $(LIBS) $(OUTPUT).o .PHONY: clean clean: rm -f *~ *.o If I install the library via synaptic/apt-get or by manually compiling the available source code, and by building the above code, everything is alright. But it would be very desired to avoid installing liblbfgs first. For this reason, I want to package my software into a .deb file where I should define liblbfgs as a dependency. I create a folder, say toypackage_1.0/, where I store the source code and the Makefile. Then I compress this directory as tar czvf toypackage_1.0.orig.tar.gz toypackage-1.0/ Then, I run dh_make as follows $ cd toypackage-1.0/ $ dh_make Type of package: single binary, indep binary, multiple binary, library, kernel module, kernel patch? [s/i/m/l/k/n] s Maintainer name : geppetto Email-Address : geppetto@phi Date : Fri, 06 Jun 2014 16:25:22 +0300 Package Name : toypackage Version : 1.0 License : blank Type of Package : Single Hit <enter> to confirm: Skipping creating ../toypackage_1.0.orig.tar.gz because it already exists Done. Please edit the files in the debian/ subdirectory now. You should also check that the toypackage Makefiles install into $DESTDIR and not in / . $ debuild dpkg-buildpackage -rfakeroot -D -us -uc dpkg-buildpackage: source package toypackage dpkg-buildpackage: source version 1.0-1 dpkg-buildpackage: source distribution unstable dpkg-buildpackage: source changed by geppetto <geppetto@phi> dpkg-source --before-build toypackage-1.0 dpkg-buildpackage: host architecture amd64 fakeroot debian/rules clean dh clean dh_testdir dh_auto_clean make[1]: Entering directory '/home/geppetto/LAB/Debian_Packaging/ToyPackage/toypackage-1.0' rm -f *~ *.o make[1]: Leaving directory '/home/geppetto/LAB/Debian_Packaging/ToyPackage/toypackage-1.0' dh_clean dpkg-source -b toypackage-1.0 dpkg-source: info: using source format `3.0 (quilt)' dpkg-source: info: building toypackage using existing ./toypackage_1.0.orig.tar.gz dpkg-source: info: building toypackage in toypackage_1.0-1.debian.tar.xz dpkg-source: info: building toypackage in toypackage_1.0-1.dsc debian/rules build dh build dh_testdir dh_auto_configure dh_auto_build make[1]: Entering directory '/home/geppetto/LAB/Debian_Packaging/ToyPackage/toypackage-1.0' cc -Wall -g -D_FORTIFY_SOURCE=2 -c -o toypackage.o toypackage.c gcc -o toypackage -lm -llbfgs toypackage.o make[1]: Leaving directory '/home/geppetto/LAB/Debian_Packaging/ToyPackage/toypackage-1.0' dh_auto_test fakeroot debian/rules binary dh binary dh_testroot dh_prep dh_auto_install dh_installdocs dh_installchangelogs dh_perl dh_link dh_compress dh_fixperms dh_strip dh_makeshlibs dh_shlibdeps dh_installdeb dh_gencontrol dpkg-gencontrol: warning: Depends field of package toypackage: unknown substitution variable ${shlibs:Depends} dh_md5sums dh_builddeb dpkg-deb: building package `toypackage' in `../toypackage_1.0-1_amd64.deb'. dpkg-genchanges >../toypackage_1.0-1_amd64.changes dpkg-genchanges: including full source code in upload dpkg-source --after-build toypackage-1.0 dpkg-buildpackage: full upload (original source is included) Now running lintian... E: toypackage changes: changed-by-address-malformed geppetto <geppetto@phi> W: toypackage source: dh-make-template-in-source debian/init.d.ex W: toypackage source: dh-make-template-in-source debian/manpage.1.ex W: toypackage source: dh-make-template-in-source debian/manpage.sgml.ex W: toypackage source: dh-make-template-in-source debian/manpage.xml.ex W: toypackage source: dh-make-template-in-source debian/menu.ex W: toypackage source: dh-make-template-in-source debian/postinst.ex W: toypackage source: dh-make-template-in-source debian/postrm.ex W: toypackage source: dh-make-template-in-source debian/preinst.ex W: toypackage source: dh-make-template-in-source debian/prerm.ex W: toypackage source: dh-make-template-in-source debian/toypackage.cron.d.ex W: toypackage source: dh-make-template-in-source debian/toypackage.default.ex W: toypackage source: dh-make-template-in-source debian/toypackage.doc-base.EX W: toypackage source: dh-make-template-in-source debian/watch.ex W: toypackage source: package-needs-versioned-debhelper-build-depends 9 E: toypackage source: maintainer-address-malformed geppetto <geppetto@phi> W: toypackage source: superfluous-clutter-in-homepage <insert the upstream URL, if relevant> W: toypackage source: bad-homepage <insert the upstream URL, if relevant> W: toypackage source: out-of-date-standards-version 3.9.4 (current is 3.9.5) W: toypackage: wrong-bug-number-in-closes l3:#nnnn E: toypackage: debian-changelog-file-contains-invalid-email-address geppetto@phi W: toypackage: new-package-should-close-itp-bug E: toypackage: changelog-is-dh_make-template E: toypackage: helper-templates-in-copyright W: toypackage: copyright-has-url-from-dh_make-boilerplate E: toypackage: copyright-contains-dh_make-todo-boilerplate W: toypackage: readme-debian-contains-debmake-template E: toypackage: description-is-dh_make-template E: toypackage: maintainer-address-malformed geppetto <geppetto@phi> E: toypackage: section-is-dh_make-template W: toypackage: superfluous-clutter-in-homepage <insert the upstream URL, if relevant> W: toypackage: bad-homepage <insert the upstream URL, if relevant> Finished running lintian. Now signing changes and any dsc files... signfile toypackage_1.0-1.dsc geppetto <geppetto@phi> gpg: skipped "geppetto <geppetto@phi>": secret key not available gpg: /tmp/debsign.wQjBHrJP/toypackage_1.0-1.dsc: clearsign failed: secret key not available debsign: gpg error occurred! Aborting.... debuild: fatal error at line 1283: running debsign failed It seems a bit erroneous, but if I $ cd .. $ sudo dpkg -i toypackage_1.0-1_amd64.deb [sudo] password for geppetto: Selecting previously unselected package toypackage. (Reading database ... 426247 files and directories currently installed.) Preparing to unpack toypackage_1.0-1_amd64.deb ... Unpacking toypackage (1.0-1) ... Setting up toypackage (1.0-1) ... $ cd ./toypackage-1.0/ $ cd ./toypackage liblbfgs will be used here! then I see that the code has been built correctly, as I have already installed liblbfgs via apt-get. Here are my questions: What if I have not installed liblbfgs before? What should I do to be able to build my code correctly? What would be a meaningful Makefile for my purposes? Could you suggest me how to change it using $DESTDIR$ in order the binaries are stored to /usr/bin/?
What if I have not installed liblbfgs before? What should I do to be able to build my code correctly? In order for build tools to notice that kind of dependencies, you need to specify it in the Build-Depends field of the debian/control file. What would be a meaningful Makefile for my purposes? Could you suggest me how to change it using $DESTDIR$ in order the binaries are stored to /usr/bin/? Your Makefile needs to have a install target, and that target needs to respect $DESTDIR (and also $PREFIX if you want to support things like FreeBSD). A good install target would look like: PREFIX?=/usr DESTDIR?=/ install: install -m 755 $(OUTPUT) $(DESTDIR)/$(PREFIX)/bin/$(OUTPUT) See the destdir section of the very useful new maintainer guide.
Debian packaging with dependency (from the scratch)
1,392,715,368,000
I have been trying to build .deb packages for Debian from Python modules. After going through Debian's LibraryStyleGuide for Python, Pybuild and An Overview of Packaging for Python, I decided I am better off with something that streamlines the process for me. I found stdeb to be a popular choice. I tried building stdeb with itself according to this. Its giving me the following error: python3 setup.py --command-packages=stdeb.command bdist_deb running bdist_deb running sdist_dsc running sdist running check reading manifest template 'MANIFEST.in' writing manifest file 'MANIFEST' creating stdeb-0.10.0 creating stdeb-0.10.0/scripts creating stdeb-0.10.0/stdeb creating stdeb-0.10.0/stdeb/command creating stdeb-0.10.0/test_data creating stdeb-0.10.0/test_data/py2_only_pkg creating stdeb-0.10.0/test_data/py2_only_pkg/py2_only_pkg creating stdeb-0.10.0/test_data/py3_only_pkg creating stdeb-0.10.0/test_data/py3_only_pkg/py3_only_pkg creating stdeb-0.10.0/test_data/simple_pkg creating stdeb-0.10.0/test_data/simple_pkg/simple_pkg making hard links in stdeb-0.10.0... hard linking .gitignore -> stdeb-0.10.0 hard linking .travis.yml -> stdeb-0.10.0 hard linking CHANGELOG.txt -> stdeb-0.10.0 hard linking LICENSE.txt -> stdeb-0.10.0 hard linking MANIFEST.in -> stdeb-0.10.0 hard linking README.rst -> stdeb-0.10.0 hard linking RELEASE_NOTES.txt -> stdeb-0.10.0 hard linking Vagrantfile.debian-7-wheezy.rb -> stdeb-0.10.0 hard linking Vagrantfile.debian-8-jessie.rb -> stdeb-0.10.0 hard linking Vagrantfile.ubuntu-12.04-precise.rb -> stdeb-0.10.0 hard linking Vagrantfile.ubuntu-14.04-trusty.rb -> stdeb-0.10.0 hard linking error.txt -> stdeb-0.10.0 hard linking setup.py -> stdeb-0.10.0 hard linking stdeb.cfg -> stdeb-0.10.0 hard linking test-pypi-install.sh -> stdeb-0.10.0 hard linking test.sh -> stdeb-0.10.0 hard linking test2and3.sh -> stdeb-0.10.0 hard linking scripts/py2dsc -> stdeb-0.10.0/scripts hard linking scripts/py2dsc-deb -> stdeb-0.10.0/scripts hard linking scripts/pypi-download -> stdeb-0.10.0/scripts hard linking scripts/pypi-install -> stdeb-0.10.0/scripts hard linking stdeb/__init__.py -> stdeb-0.10.0/stdeb hard linking stdeb/cli_runner.py -> stdeb-0.10.0/stdeb hard linking stdeb/downloader.py -> stdeb-0.10.0/stdeb hard linking stdeb/transport.py -> stdeb-0.10.0/stdeb hard linking stdeb/util.py -> stdeb-0.10.0/stdeb hard linking stdeb/command/__init__.py -> stdeb-0.10.0/stdeb/command hard linking stdeb/command/bdist_deb.py -> stdeb-0.10.0/stdeb/command hard linking stdeb/command/common.py -> stdeb-0.10.0/stdeb/command hard linking stdeb/command/debianize.py -> stdeb-0.10.0/stdeb/command hard linking stdeb/command/install_deb.py -> stdeb-0.10.0/stdeb/command hard linking stdeb/command/sdist_dsc.py -> stdeb-0.10.0/stdeb/command hard linking test_data/py2_only_pkg/setup.py -> stdeb-0.10.0/test_data/py2_only_pkg hard linking test_data/py2_only_pkg/py2_only_pkg/__init__.py -> stdeb-0.10.0/test_data/py2_only_pkg/py2_only_pkg hard linking test_data/py2_only_pkg/py2_only_pkg/py2_module.py -> stdeb-0.10.0/test_data/py2_only_pkg/py2_only_pkg hard linking test_data/py3_only_pkg/setup.py -> stdeb-0.10.0/test_data/py3_only_pkg hard linking test_data/py3_only_pkg/py3_only_pkg/py3_module.py -> stdeb-0.10.0/test_data/py3_only_pkg/py3_only_pkg hard linking test_data/simple_pkg/setup.py -> stdeb-0.10.0/test_data/simple_pkg hard linking test_data/simple_pkg/simple_pkg/__init__.py -> stdeb-0.10.0/test_data/simple_pkg/simple_pkg Creating tar archive removing 'stdeb-0.10.0' (and everything under it) dpkg-buildpackage: info: source package stdeb dpkg-buildpackage: info: source version 0.10.0-1 dpkg-buildpackage: info: source distribution unstable dpkg-buildpackage: info: source changed by Andrew Straw <[email protected]> dpkg-source --before-build . dpkg-source: info: using options from stdeb-0.10.0/debian/source/options: --extend-diff-ignore=\.egg-info$ fakeroot debian/rules clean dh clean --with python3 --buildsystem=python_distutils dh: warning: Compatibility levels before 10 are deprecated (level 9 in use) dh: error: unable to load addon python3: Cant locate Debian/Debhelper/Sequence/python3.pm in @INC (you may need to install the Debian::Debhelper::Sequence::python3 module) (@INC contains: /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.32.1 /usr/local/share/perl/5.32.1 /usr/lib/x86_64-linux-gnu/perl5/5.32 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl-base /usr/lib/x86_64-linux-gnu/perl/5.32 /usr/share/perl/5.32 /usr/local/lib/site_perl) at (eval 16) line 1. BEGIN failed--compilation aborted at (eval 16) line 1. make: *** [debian/rules:7: clean] Error 25 dpkg-buildpackage: error: fakeroot debian/rules clean subprocess returned exit status 2 Traceback (most recent call last): File "/home/user0/Documents/temp/pac/stdeb-release-0.10.0/setup.py", line 8, in <module> setup( File "/usr/lib/python3.9/distutils/core.py", line 148, in setup dist.run_commands() File "/usr/lib/python3.9/distutils/dist.py", line 966, in run_commands self.run_command(cmd) File "/usr/lib/python3.9/distutils/dist.py", line 985, in run_command cmd_obj.run() File "/home/user0/Documents/temp/pac/stdeb-release-0.10.0/stdeb/command/bdist_deb.py", line 34, in run self.run_command('sdist_dsc') File "/usr/lib/python3.9/distutils/cmd.py", line 313, in run_command self.distribution.run_command(command) File "/usr/lib/python3.9/distutils/dist.py", line 985, in run_command cmd_obj.run() File "/home/user0/Documents/temp/pac/stdeb-release-0.10.0/stdeb/command/sdist_dsc.py", line 137, in run build_dsc(debinfo, File "/home/user0/Documents/temp/pac/stdeb-release-0.10.0/stdeb/util.py", line 1569, in build_dsc dpkg_buildpackage(*args, cwd=fullpath_repackaged_dirname) File "/home/user0/Documents/temp/pac/stdeb-release-0.10.0/stdeb/util.py", line 585, in dpkg_buildpackage process_command(args, cwd=cwd) File "/home/user0/Documents/temp/pac/stdeb-release-0.10.0/stdeb/util.py", line 226, in process_command check_call(args, cwd=cwd) File "/home/user0/Documents/temp/pac/stdeb-release-0.10.0/stdeb/util.py", line 59, in check_call raise CalledProcessError(retcode) stdeb.util.CalledProcessError: 2 I found similar bugreports here and here but they seem to have been fixed and my system is up to date. Here's my /proc/version it that helps: Linux version 5.8.0-1parrot1-amd64 ([email protected]) (gcc-10 (Debian 10.2.0-5) 10.2.0, GNU ld (GNU Binutils for Debian) 2.35) #1 SMP Debian 5.8.7-1parrot1 (2020-09-14) Can someone tell me what the issue actually is and help me build it?
The error is Cant locate Debian/Debhelper/Sequence/python3.pm in @INC To fix this, you need to install dh-python: sudo apt install dh-python
Build debian package using stdeb
1,392,715,368,000
According to a RPM documentation/guide (http://ftp.rpm.org/max-rpm/ch-rpm-subpack.html) one can use subpackages to build multiple RPM packages with a single SPEC file. In the mentioned link the packages foo, foo-server, foo-client and bazlib are built and packaged. In the example, the SPEC file has a base/parent package called foo (server, client and bazlib are subpackages): Name: foo Version: 2.7 Release: 1 Source: foo-2.7.tgz License: probably not Summary: The foo app, and the baz library needed to build it Group: bogus/junque %description This is the long description of the foo app, and the baz library needed to build it... %package server Summary: The foo server Group: bogus/junque %description server This is the long description for the foo server... %package client Summary: The foo client Group: bogus/junque %description client This is the long description for the foo client... %package -n bazlib Version: 5.6 Summary: The baz library Group: bogus/junque %description -n bazlib This is the long description for the bazlib... ...snipped Building these packages results in these packages: # rpmbuild -ba foo-2.7.spec * Package: foo * Package: foo-server * Package: foo-client * Package: bazlib ...snipped Several questions: 1.) Has the base/parent package foo some special purpose, e.g. some additional flags/attributes in the RPIO? Or is the package foo from an RPM-"point of view" equal to all it's subpackages? If so, why are these packages then called subpackages (The word subpackages implies a special relationship)? 2.) Let's say I package a product with several binaries (toola, toolb, toolc) via subpackages, is there a way to disable the base/parent package? In my case, there is no need for a special base/parent package because all tool-packages are treated equally (This question is related to question 1). I guess there is the possibility to just build tool (base/parent package) and toola, toolb, toolc, but not add tool to the repository. But this somehow feels wrong (Maybe one can use toola as base package and toolb and toolc as subpackages?).
As far as the binary RPMs are concerned, the main package and its subpackages are equal. I can think of a couple of reasons subpackages are called that: they are described as “variants” of the main package, inheriting many fields from it (although they can be overridden), and even taking their name from it by default; and from a source package perspective, they are subpackages of the overall source package, which has the same name as the main package. If the main package isn’t needed, ensure that its %files list is empty, and it won’t be generated. See the “Controlling Packages With the %files List” section.
Build RPM subpackages without a base package
1,392,715,368,000
I manage an apt repository, for package PACKAGE, which has dependency (DEPENDENCY<<1.2). Both PACKAGE and DEPENDENCY are available in my repository. We just released a version of DEPENDENCY (version 4.0.0), and now installing the same PACKAGE on a completely clean machine fails with the error: The following packages have unmet dependencies: PACKAGE : Depends: DEPENDENCY (< 1.2.0) but it is not going to be installed E: Unable to correct problems, you have held broken packages. If I check the versions of DEPENDENCY available, I can see that there are known packages which meet the << 1.2 requirement: sudo apt list -a DEPENDENCY Listing... Done DEPENDENCY/stable 4.0.0 all DEPENDENCY/stable 1.1.12 all DEPENDENCY/stable 1.1.11 all DEPENDENCY/stable 1.1.10 all ... Since I actually manage the package AND the dependency I can fix this on the repository side, but how? Why doesn't apt recognise the correct dependencies? (Doing apt --fix-broken won't work because the packages are somehow broken on the server side).
APT doesn’t resolve versions of packages based on requirements, but rather based on availability (and priorities). Put another way, it is really designed to work with coherent repositories, i.e. repositories with single versions of packages, where all related packages can be installed with the versions in the repository. (That’s how the Debian repositories work most of the time, and is a requirement for the release repositories.) Even though DEPENDENCY is available in multiple versions in the same suite, APT will consider the highest version only, 4.0.0, unless told otherwise. You’ll probably need to help APT resolve the situation manually: apt install PACKAGE DEPENDENCY=1.1.12 and even then I’m not 100% sure that will work. As a general solution, you’d have to use different suites in your repository, and make sure PACKAGE and DEPENDENCY are present in mutually-acceptable versions in the same suite; version 4.0.0 of DEPENDENCY would therefore go in a different suite, without PACKAGE, until PACKAGE is available in a compatible version.
APT complains of broken/unmet dependencies for my package, but they are available in my repository. How to fix?
1,392,715,368,000
I maintain a native Debian package which installs an application and an initial SQLite database. I expect the application to edit the database. How do I prevent upgrades from replacing the database? I thought conffiles would be the solution, but the Debian's maintainer guide says: If your program uses configuration files but also rewrites them on its own, it's best not to make them conffiles because dpkg will then prompt users to verify the changes all the time. What is the best alternative?
If you’re really talking about shipping a database, and not the configuration files to access a database, the answer is somewhat in the problem statement: a database isn’t a configuration file. The best alternative (in my opinion) is to install the database in maintainer scripts, not directly as an installed file in the package. That way your maintainer scripts can deal with the various situations that can arise, including initial installation with no database; upgrade with an existing database which should be preserved as-is; upgrade with an existing database which needs to be migrated. You’d ship the database in a temporary location in your package, somewhere under /usr/share/yourpackage, and only move it to its real location if necessary. Don’t ship it in /tmp, and don’t attempt to “de-register” the file. See also Where do temporary files go while installing a .deb package? For extra bonus points, you could look at dbconfig-common.
Debian conffiles alternative
1,502,866,885,000
I'm testing a new locale-all package for my system, which comes with the drawback that the source is the gigantic glibc package. I'm estimating at least 1 hour for it to build, when the package I need is not even architecture dependent. Is there a way to build only that package or at very least only the arch-indep packages?
Use dpkg-buildpackage -A (thanks, @WouterVerhelst) -A Specifies a binary-only build, limited to architecture independent packages. Passed to dpkg-genchanges. Also try dpkg-buildpackage -T binary-indep -T target - Calls debian/rules target after having setup the build environment and stops the package build process here. Debian Policy Manual says: binary (required), binary-arch (required), binary-indep (required) The binary target must be all that is necessary for the user to build the binary package(s) produced from this source package. It is split into two parts: binary-arch builds the binary packages which are specific to a particular architecture, and binary-indep builds those which are not. Some source packages (for example apt) have rules for building a specific package. So, you can run dpkg-buildpackage -T apt-doc --as-root to build only apt-doc package.
How to build a specific package from a Debian source package?
1,502,866,885,000
I'm using debian to do most of my coding work, and I was doing a homework project that required a certain version of gcc to compile the program I was working on. I downloaded the gcc source and compiled/installed it, but forgot to change any options, so I think it installed it to the default location, which in my case was /usr/local/bin/gcc. I wasn't really planning ahead when I did this, and when I realized I was done with the version of gcc for my homework, I didn't know how to remove it. Upon googling, I realized that this wasn't really possible, unless I used checkinstall which I didnt. Now however, because /usr/local/bin is ahead in my path, it uses my newer version of gcc to compile by default which causes problems when I try to use gdb to debug those versions of applications. I'm also worried that this will cause unwanted behavior in other applications that can screw things up. Note: I can't just reorganize my path, because there are applications in /usr/local/bin that I want that override ones in /usr/bin So my question is this: How do you manage self-compiled applications with packaged ones from repositories? What I mean is, what is the correct way of going about this, so that they don't conflict and one can safely be removed without screwing anything up? In terms of mixing them, how would I do something like using a self-compiled version of an application as a dependency for a packaged version? I don't think debian will automatically recognize that if I install gdb or something, that my local version of gcc will meet the criteria. Also as a side-note: Where the heck do you install compiled applications? /usr/local/bin? /opt? /home/user/bin? /own_directory? My apologizes if I wrote this badly or anything, I can clarify more if needed.
You could possibly get a list of the files that were installed when you compiled gcc by using make's -n or --dry-run option - e.g. running make -n install in the gcc source directory, and redirecting output to a file. With a bit of post-processing (e.g. with sed), that should give you a list of files that you can delete - but be careful, sanity-check the list before committing to deleting them.
Self complied version of GCC overwriting package installed version [duplicate]
1,502,866,885,000
I'm trying to create a Debian package that doesn't delete an empty directory after it's purged. Specifically, I'm creating my own package containing some CA certificates I trust. I'm following Debian's suggested method of installing the certificates to /usr/local/share/ca-certificates. The problem I'm running in to is that the ca-certificates package creates /usr/local/share/ca-certificates when it's installed and I'd like that directory to stick around when my package is purged. My goal is to install my trust chain into /usr/local/share/ca-certificates/mychain but when my Debian package is removed I want dpkg to not remove /usr/local/share/ca-certificates if it's empty since the ca-certificates package explicitly created that directory. I searched around for a definitive answer but all I managed to find were long forum posts and e-mail threads.
Add postrm script: #!/bin/sh set -e case "$1" in purge|remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear) # Recreate the /usr/local/share/ca-certificates directory, since we are # ignoring Debian Policy by intentionally installing here. Removal of # ca-certificates-local removes this directory if empty. if [ ! -e /usr/local/share/ca-certificates ]; then if mkdir /usr/local/share/ca-certificates 2>/dev/null; then chown root:staff /usr/local/share/ca-certificates chmod 2775 /usr/local/share/ca-certificates fi fi ;; *) echo "postrm called with unknown argument \`$1'" >&2 exit 1 ;; esac #DEBHELPER# exit 0 This code is from ca-certificates-local: This is an example stub source package that includes a dummy CA certificate in the local/ directory. Remove the dummy certificate, copy your trusted local root CA (in PEM format with the filename ending in ".crt") to the local/ directory, edit files in the debian/ directory as desired, and build your custom package. See README, Steps to build your custom local root CA package from this example So, the quick way to create and install such packages: git clone git://anonscm.debian.org/collab-maint/ca-certificates.git ~/ca-certificates cd ~/ca-certificates/examples/ca-certificates-local/ rm local/Local_Root_CA.crt cp <path-to-your-cert> local/ # edit debian/control: change package-name, description, etc # install build dependencies: http://unix.stackexchange.com/questions/177505/how-to-install-parse-build-dependencies-from-debian-control/211319#211319 dpkg-buildpackage dpkg -i ../<package-name-version>.deb
Creating a Debian package that does not remove directories after it's purged
1,502,866,885,000
I have been recently trying to package a small Python utility to put on my PPA and I've almost got it to work, but I'm having problems in making the package install the binary (a chmod +x Python script) under /usr/bin. Instead it installs under /. I have this directory structure -> http://db.tt/0KhIYQL. My package Makefile is like so: TARGET=usr/bin/txtrevise make: chmod +x $(TARGET) install: cp -r $(TARGET) $(DESTDIR) I've used $(DESTDIR), as I understand it to place the file under the debian subdir when debuild is run. I have the txtrevise script, my executable, under usr/bin folder under the root of my package. I also have the Makefile and usr/bin/textrevise in my tarball: txtrevise_1.1.original.tar.gz. However when I build this and look inside of the Debian package, txtrevise is always at the root of the package instead of under usr/bin and will be installed to / instead of /usr/bin. How can I get debuild to put the script in the right place?
The problem is in the cp $(TARGET) $(DESTDIR) invocation: this will copy the file textrevise under directory $(DESTDIR), i.e. skips the /usr/bin prefix. You need to preserve the directory structure, so for instance: install: # ensure the destination directory exists mkdir -p $(DESTDIR)/usr/bin # copy the program to its final destination cp $(TARGET) $(DESTDIR)/$(TARGET) # ensure the program and directories have the correct permissions chmod a+rx $(DESTDIR)/$(TARGET) Note that you must also ensure, when building a software package for others to use, that the permissions an all directories and binaries are set according to the Debian policy; in this case you want $(DESTDIR)/usr/bin/textrevise to be owned by root:root and mode 0755 (and so the directories $(DESTDIR)/usr and $(DESTDIR)/usr/bin). You might want to have a look at the install command, that gives you more control over the owner, group and mode of the installed files to write more concise Makefile stanzas.
Debian package issue: files are installing into '/'
1,502,866,885,000
For a little something I made (that used to be a word-of-mouth thing only and that's interesting to just a very narrow, and usually non-technical, user base), I'd like to be able to provide a .deb file for easier installation. The something doesn't have any actual files that it needs to install in the system. Instead it needs to add some lines to already existing files (which belong to the xkb-data package on Debian-derived distributions). To the best of my knowledge, after searching and asking around, there's no way to put these lines into new, separate files and still have them be picked up by the system, so I wrote a Rakefile to do the installation. That works well but requires the user to interact with a command-line, which doesn't always work so well. Also, whenever xkb-data gets updated through the package manager, the rake task needs to be ran again manually, which is cumbersome. I know about DpkgPostpone and DpkgTriggers, but none of these seem to be intended or fit for dealing with the above described problem (please do correct me if I'm wrong about that, though!) Is there any way to have a Debian package automatically cause its own reinstall based on the condition that one or all of its dependencies have just been updated? I'm explicitly also interested in a hackish way to do so, DontBreakDebian be damned.
One reasonable way of going about this is as follows: divert all the files you modify, so that dpkg no longer replaces them, but instead installs them with a different name; make your Rakefile do its work using the newly-named files instead of the originals, reading the newly-named files and writing the originals; install a post-invoke dpkg hook in /etc/dpkg/dpkg.cfg.d which runs the Rakefile after dpkg runs. You could add additional checks, for example only run the Rakefile if the checksums of the original files have changed since the last time the modified files were generated, but that might not save much time compared to running the Rakefile every time dpkg runs, and adds a fair amount of maintenance complexity. (I wrote this assuming that your Rakefile behaved like a Makefile, i.e. didn’t do anything if its targets were newer that their prerequisites, but I get the impression that that isn’t the case here, so it’s probably more relevant to add additional checks or alter your Rakefile to not do anything if there’s nothing to do. Or you could rewrite your processing in a Makefile instead.) I imagine you’ve already thought of this, but I think the ideal solution would be to add a new keyboard type instead of changing existing keyboard definitions; but there could well be some issue with this that I haven’t thought of.
Way to have a Debian package reinstall when dependency updates?
1,502,866,885,000
If I am applying yum install -y --security and a package is updated; how is the package "marked" as a security update? For example, lets say I have a package blah that I maintain, its current version is 1.18.3. If I build a new package as 1.18.4 is it automatically a "security" package? If not, how/where is the documentation to mark the package as "security" update?
yum does this via yum-security(8) plugin which is part of yum (no need install it separately) for CentOS 7 (official RHEL docs). When you produce yum update ... --security yum download repository meta info updates in /var/lib/<arch>/<repo>. Each package in meta info file (organised as xml file) contains type field in <update> tag. If type=security then update is security update. When you produce yum update --cve <CVE> or yum update --bugzilla <bugzilla_id> then yum analyses tag <references> for tags <reference> of each package in meta info for field type contains bugzilla. If you typed --cve then CVE comparison to title field of <reference> tag. If you typed --bugzilla, then bugzilla_id comparison to id field of <reference> tag. The update_md.py file from yum package contains described upper functionality: $ rpm -ql yum|grep update_md /usr/lib/python2.7/site-packages/yum/update_md.py P.S. Debian packages (DEB) contains urgency field in packages changelogs is might be useful for security updates.
How are RPM packages marked as "security" updates?
1,502,866,885,000
I'm working on a piece of software that needs to compile against a very modern version of glib, but also needs to run on Ubuntu 11.10 (which doesn't come with that version). My first thought was to just backport and replace glib, since the versions are theoretically compatible, but it causes some problems (most noticably with Unity not working right). I know that the obvious solution is to use Ubuntu 12.04, but I don't have that option right now (working on it though). Is there any sane way to handle this? Right now I'm looking at just compiling glib, taring it, and then manually setting C_INCLUDE_PATH and LD_LIBRARY_PATH. Unfortunately, I don't think I can't even package the compiled library because glib isn't very specific about its version (it's just glib-2.0.so). Is the tar method the best I can do in this situation?
I would suggest installing the new version of glib under /usr/local/lib or /usr/local/lib64 and then utilizing the LD_LIBRARY_PATH environment variable, like you mentioned above. In fact that appears to be the default location. From the output of ./configure --help in glib-2.33.8: By default, `make install' will install all the files in `/usr/local/bin', `/usr/local/lib' etc. You can specify an installation prefix other than `/usr/local' using `--prefix', for instance `--prefix=$HOME'. See this Ubuntu Forum thread for more details.
Compiling against a newer version of glib?
1,502,866,885,000
I'm new to RPM packaging and I got stuck for quite a long time and cannot find root cause of the problem. I'm not quite sure I fully understand the concept of BuildRoot in the spec file. My RPM packaging happens in my home dir: /home/virtual/rpmbuild. I'm trying to package a java application located in /home/virtual/rpmbuild/tmp/BDHistProcessor with the structure: BDHistProcessor lib bin conf deploy Here is my spec file I created: %define _tmppath /home/virtual/rpmbuild/tmp Name: BDHistProcessor Version: 1.0.0 Release: 1%{?dist} Summary: component which feed data into DB Group: Applications/System License: GPL URL: https://www.tem.com/ BuildRoot: %{tmppath}/%{name} %description Component which feed data into DB %prep %build %install rm -rf $RPM_BUILD_ROOT cp -r /home/virtual/rpmbuild/tmp/BDHistProcessor $RPM_BUILD_ROOT %files %defattr(-,root,root) %{buildroot}/BDHistProcessor/lib %{buildroot}/BDHistProcessor/bin %{buildroot}/BDHistProcessor/conf %{buildroot}/BDHistProcessor/deploy %{buildroot}/BDHistProcessor/README.txt %doc %changelog Running rpmbuild -v -bb -clean SPECS/myRPM.spec returns output: [virtual@virtual rpmbuild]$ rpmbuild -v -bb --clean SPECS/myRPM.spec Executing(%prep): /bin/sh -e /home/virtual/rpmbuild/tmp/rpm-tmp.t2AMGe + umask 022 + cd /home/virtual/rpmbuild/BUILD + exit 0 Executing(%build): /bin/sh -e /home/virtual/rpmbuild/tmp/rpm-tmp.1unXP8 + umask 022 + cd /home/virtual/rpmbuild/BUILD + exit 0 Executing(%install): /bin/sh -e /home/virtual/rpmbuild/tmp/rpm-tmp.SoaH02 + umask 022 + cd /home/virtual/rpmbuild/BUILD + rm -rf /home/virtual/rpmbuild/BUILDROOT/BDHistProcessor-1.0.0-1.el6.x86_64 + cp -r /home/virtual/rpmbuild/tmp/BDHistProcessor /home/virtual/rpmbuild/BUILDROOT/BDHistProcessor-1.0.0-1.el6.x86_64 + /usr/lib/rpm/check-rpaths /usr/lib/rpm/check-buildroot + /usr/lib/rpm/brp-compress + /usr/lib/rpm/brp-strip + /usr/lib/rpm/brp-strip-static-archive + /usr/lib/rpm/brp-strip-comment-note Processing files: BDHistProcessor-1.0.0-1.el6.x86_64 error: File not found: /home/virtual/rpmbuild/BUILDROOT/BDHistProcessor-1.0.0-1.el6.x86_64/home/virtual/rpmbuild/BUILDROOT/BDHistProcessor-1.0.0-1.el6.x86_64/BDHistProcessor/lib error: File not found: /home/virtual/rpmbuild/BUILDROOT/BDHistProcessor-1.0.0-1.el6.x86_64/home/virtual/rpmbuild/BUILDROOT/BDHistProcessor-1.0.0-1.el6.x86_64/BDHistProcessor/bin error: File not found: /home/virtual/rpmbuild/BUILDROOT/BDHistProcessor-1.0.0-1.el6.x86_64/home/virtual/rpmbuild/BUILDROOT/BDHistProcessor-1.0.0-1.el6.x86_64/BDHistProcessor/conf error: File not found: /home/virtual/rpmbuild/BUILDROOT/BDHistProcessor-1.0.0-1.el6.x86_64/home/virtual/rpmbuild/BUILDROOT/BDHistProcessor-1.0.0-1.el6.x86_64/BDHistProcessor/deploy error: File not found: /home/virtual/rpmbuild/BUILDROOT/BDHistProcessor-1.0.0-1.el6.x86_64/home/virtual/rpmbuild/BUILDROOT/BDHistProcessor-1.0.0-1.el6.x86_64/BDHistProcessor/README.txt RPM build errors: File not found: /home/virtual/rpmbuild/BUILDROOT/BDHistProcessor-1.0.0-1.el6.x86_64/home/virtual/rpmbuild/BUILDROOT/BDHistProcessor-1.0.0-1.el6.x86_64/BDHistProcessor/lib File not found: /home/virtual/rpmbuild/BUILDROOT/BDHistProcessor-1.0.0-1.el6.x86_64/home/virtual/rpmbuild/BUILDROOT/BDHistProcessor-1.0.0-1.el6.x86_64/BDHistProcessor/bin File not found: /home/virtual/rpmbuild/BUILDROOT/BDHistProcessor-1.0.0-1.el6.x86_64/home/virtual/rpmbuild/BUILDROOT/BDHistProcessor-1.0.0-1.el6.x86_64/BDHistProcessor/conf File not found: /home/virtual/rpmbuild/BUILDROOT/BDHistProcessor-1.0.0-1.el6.x86_64/home/virtual/rpmbuild/BUILDROOT/BDHistProcessor-1.0.0-1.el6.x86_64/BDHistProcessor/deploy File not found: /home/virtual/rpmbuild/BUILDROOT/BDHistProcessor-1.0.0-1.el6.x86_64/home/virtual/rpmbuild/BUILDROOT/BDHistProcessor-1.0.0-1.el6.x86_64/BDHistProcessor/README.txt I'm not quite sure how the paths get cycled in the error report. Can someone please clarify what I'm doing wrong here?
Background - rpmbuild setup How did you create your rpmbuild directory? Did you use a tool such as rpmdev-setuptree? I always recommend newcomers start out by using this package, rpmdevtools. Example To start I have no bulid area, as user saml. $ ls -la | grep -E "rpmbuild|\.rpm" $ Then install the package rpmdevtools. $ sudo yum install rpmdevtools After it's been installed, you'll now have another application which you can use to create your rpmbuild directory. $ rpmdev-setuptree It won't say anything, it silently just did the following things for you: $ ls -la | grep -E "rpmbuild|\.rpm" drwxrwxr-x. 7 saml saml 4096 Dec 16 12:22 rpmbuild -rw-rw-r--. 1 saml saml 620 Dec 16 12:22 .rpmmacros Afterwards you'll now have the following directory structure in your rpmbuild developers directory: $ ls -l ~/rpmbuild total 20 drwxrwxr-x. 2 saml saml 4096 Dec 16 12:22 BUILD drwxrwxr-x. 2 saml saml 4096 Dec 16 12:22 RPMS drwxrwxr-x. 2 saml saml 4096 Dec 16 12:22 SOURCES drwxrwxr-x. 2 saml saml 4096 Dec 16 12:22 SPECS drwxrwxr-x. 2 saml saml 4096 Dec 16 12:22 SRPMS Your issue Your issue looks to be in the %files macro section of the .spec file. Looking at the output of the error messages: error: File not found: /home/virtual/rpmbuild/BUILDROOT/BDHistProcessor-1.0.0-1.el6.x86_64/home/virtual/rpmbuild/BUILDROOT/BDHistProcessor-1.0.0-1.el6.x86_64/BDHistProcessor/lib Notice that the BUILDROOT path repeats 2 times. You don't need to include variable $buildroot in your %files macro section, it's already targeting this directory automatically for you. Try this instead: %files %defattr(-,root,root) /usr/bin/BDHistProcessor/lib /usr/bin/BDHistProcessor/bin /usr/bin/BDHistProcessor/conf /usr/bin/BDHistProcessor/deploy /usr/bin/BDHistProcessor/README.txt Put whatever is the eventual destination for the packages in place of /usr/bin.
Error while trying to create RPM for java app
1,502,866,885,000
I would like to know what's the difference between package-name-1.0-0~201~ubuntu14.04.1 package-name-1.0+r201~daily~ubuntu14.04.1 I am guessing that one of them is a pre-release version but I am not sure. Any help is appreciated.
The ~ character sorts to "less than nothing". I.e. package-name-1.0-0~201~ubuntu14.04.1 will be upgraded to package-name-1.0-0~201; so the '~ubuntu14.04.1` part indicates a prerelease. When comparing the two versions you show, both are actually prerelease versions. To find out what version dpkg actually considers to be newer: $ dpkg --compare-versions '1.0-0~201~ubuntu14.04.1' lt '1.0+r201~daily~ubuntu14.04.1' && echo less than less than So 1.0-0~201~ubuntu14.04.1 is considered to be less than 1.0+r201~daily~ubuntu14.04.1. The rules concerning version numbers is described at https://www.debian.org/doc/manuals/maint-guide/first.en.html#namever . This text is for new Debian maintainers, but explains it well for end users as well.
decoding a debian package name (Version,Release)
1,502,866,885,000
I am new in Funtoo/Gentoo. Where do I start learning how to create my own "packages"? For example, I have done the following to get the source code of Bespin, a Style for Qt4, derived from the Style for the Oxygen project and compile it: svn checkout svn://svn.code.sf.net/p/cloudcity/code/ cloudcity-code cd cloudcity-code/ and less INSTALL, q when done with reading mkdir build && cd build Configure Bespin using ccmake: ccmake ../ Press c for a general configuration -- assuming all requirements are satisfied Optionally, adjust some paths to your wishes Press c for the final config run Press g to generate makefiles Run the compiler: make At this point, I am hesitant to execute (as root) sudo make install. In other distributions I'd use checkinstall to create a .deb package, for example, which I could easily remove anytime. What is the right way to do this in Gentoo? ebuilds?
Ebuilds are the right way to package an application in Gentoo. There are also eclasses which are collection of code used in ebuilds that automate procedures and makes your life easier. If you want to learn more about packaging and development in Gentoo, there is a full development manual where you can find everything you want about ebuilds. Also In order to create and test your own personal ebuilds, the easiest way is to set up a local overlay. You can either write an ebuild for personal use or you can contribute to Gentoo community providing your ebuild if the application doesn't exist in Gentoo's main tree. If you choose the second way, then you should create an account to Gentoo's bugzilla, open a bug with title 'new-application-1.0: ebuild request' and attach your ebuild. Then a Gentoo developer will give you feedback. If the ebuild is 100% ready and correct, it will be added to Gentoo's main tree. To learn more and to ask questions about ebuilds you can join in Freenode where Gentoo community has a huge list of IRC channels.
How to package software in Funtoo/Gentoo?
1,502,866,885,000
I'm trying to find what is the syntax of conffiles. I'm creating several packages using a single rules file and if I put the configuration files into conffiles I get an error when building the packages (since the files are only present in two of the 9 packages).
Using debhelper, you can name the conffile file after the package name, just like with the install files. An example file name would be "mypackage.conffiles". With debhelper, any file that does not follow the "maypackage.myfile" format applies to all binary packages from the source. The conffiles file is described in the dh_installdeb manpage.
conffiles syntax
1,502,866,885,000
I have a Flatpak manifest I'm submitting to Flathub, but I'd also like to build a .flatpak package file that I can redistribute myself. How can I go about doing this? I don't find anything in flatpak-builder's command reference, and searching hasn't been fruitful either. To be clear, I don't expect the Flatpak to contain all of the necessary runtime, but I would like users who have installed the Freedesktop runtime from somewhere else to be able to install it.
This is referred to as "single-file bundles" in Flatpak's documentation, and the way you go about creating them is somewhat involved. First, you need to build the Flatpak with flatpak-builder: $ flatpak-builder build/ <path/to/manifest> You may have to add --force-clean if build/ already exists. After that, you need to export the result with flatpak build-export: $ flatpak build-export export build Finally, you can export the Flatpak single-file bundle itself: $ flatpak build-bundle export example.flatpak <Flatpak app ID> If you want Flatpak to automatically fetch missing dependencies from a remote repository, you can add the --runtime-repo option. Here's an example where I'm using Flathub as the runtime repo: $ flatpak build-bundle export example.flatpak <Flatpak app ID> --runtime-repo=https://flathub.org/repo/flathub.flatpakrepo You can read the official documentation here, which has some information not covered here about e.g. installation: https://docs.flatpak.org/en/latest/single-file-bundles.html
How do I build a .flatpak package file from a Flatpak manifest?
1,502,866,885,000
I am able to build Debian package make using following procedure: apt-get source make cd make-* dpkg-buildpackage --build=binary --no-sign But as soon as I make any change to the code, even changing one character in a string, then the build fails during the tests: 1 Test in 1 Category Failed (See .diff* files in work dir for details) :-( make[4]: *** [Makefile:1373: check-regression] Error 1 make[4]: Leaving directory '/mnt/src/deb/MAKE/make-dfsg-4.2.1/debian/build-make-guile' make[3]: *** [Makefile:1114: check-am] Error 2 make[3]: Leaving directory '/mnt/src/deb/MAKE/make-dfsg-4.2.1/debian/build-make-guile' make[2]: *** [Makefile:820: check-recursive] Error 1 make[2]: Leaving directory '/mnt/src/deb/MAKE/make-dfsg-4.2.1/debian/build-make-guile' dh_auto_test: error: cd debian/build-make-guile && make -j8 check VERBOSE=1 returned exit code 2 make[1]: *** [debian/rules:50: override_dh_auto_test] Error 255 make[1]: Leaving directory '/mnt/src/deb/MAKE/make-dfsg-4.2.1' make: *** [debian/rules:24: build] Error 2 dpkg-buildpackage: error: debian/rules build subprocess returned exit status 2 I have pasted the full output here How can I build the package with custom changes ?
Ideally, you’d update the test suite to take your changes into account. It is however possible to avoid the test suite altogether, using a standardized build option: DEB_BUILD_OPTIONS=nocheck dpkg-buildpackage -us -uc
building Debian package fails after even a minor change to code
1,502,866,885,000
I'm learning how to create RPMs for my own packages. Normally I can do everything while logged into my own account but instructions on making RPMs always seem to want you to use some other account. One tutorial I followed utilized rpm-build and rpmdevtools. The rpmdev-setuptree, for example, creates a directory rpmbuild/ in my home directory and (not the current directory as I would have expected). The instructions also suggested that I create a separate build account. This seems excessive and it makes managing files between this special account and the account I'm developing on difficult. The official fedora documentation uses the fedora-packager and fedora-review packages and then proceeds to have you add yourself to the mock group. Again, it suggests: You can also create a separate user and use it for doing RPM development. Ensure that the user is part of the mock group and enters the fedora-packager-setup command. Both of these instructions encourage building an RPM on a separate account. Why is this? My knee-jerk reaction is to try an work around this somehow for convenience. What problems might I face by creating RPMs from my normal account?
The general principle when packaging is that you should not make any assumptions about the system that aren't declared in the packaging configuration. This includes a lot of things: the packages needed for building, the packages needed for execution, the accounts (user or group) needed, the permissions needed, etc. Otherwise, you might find that the spec file you wrote might build on your snowflake system, but not in a clean environment. And even if it did build, it might not install. And even if it did install, it might not work as expected. This way, distros can use automated build systems, where a maintainer just has to upload the packaging configuration, and the build system does all the rest. Packages built this way are, of course, much more reliable. Because everything they require are specified in the packaging, it's a lot more unlikely that installing them will break a user's system.
Why is the procedure for building RPMs so isolated?
1,502,866,885,000
I want to notify user about important details when package is installed. I've looked at https://www.debian.org/doc/debian-policy/ch-controlfields.html#list-of-fields but don't see anything fit for that purpose. Is there any way to do this?
It seems to me that this is covered earlier in that document, in Prompting in maintainer scripts, with: Package maintainer scripts may prompt the user if necessary. Prompting must be done by communicating through a program, such as debconf, which conforms to the Debian Configuration Management Specification, version 2 or higher. […] If a package has a vitally important piece of information to pass to the user (such as “don’t run me as I am, you must edit the following configuration files first or you risk your system emitting badly-formatted messages”), it should display this in the config or postinst script and prompt the user to hit return to acknowledge the message. Copyright messages do not count as vitally important (they belong in /usr/share/doc/package/copyright); neither do instructions on how to use a program (these should be in on-line documentation, where all the users can see them). Any necessary prompting should almost always be confined to the config or postinst script. If it is done in the postinst, it should be protected with a conditional so that unnecessary prompting doesn’t happen if a package’s installation fails and the postinst is called with abort-upgrade, abort-remove or abort-deconfigure.
How to print message to the user on package installation?
1,502,866,885,000
After a security warning about FreeRadius, I am trying to build the FreeRadius 3.0.15 installation .deb files for Debian 9/Stretch for placing in my local repository. I actually also need that version for a RadSec project and a couple of other bug fixes. I build them using the following instructions: git clone https://github.com/FreeRADIUS/freeradius-server.git cd freeradius-server git fetch origin v3.0.x:v3.0.x git checkout v3.0.x fakeroot dpkg-buildpackage -b -uc However, when compiling it, I got back the following error: dpkg-buildpackage: info: source package freeradius dpkg-buildpackage: info: source version 3.0.15+git dpkg-buildpackage: info: source distribution unstable dpkg-buildpackage: info: source changed by Alan DeKok <[email protected]> dpkg-buildpackage: info: host architecture amd64 dpkg-source --before-build freeradius-server dpkg-checkbuilddeps: error: Unmet build dependencies: libjson0 | libjson-c2 dpkg-buildpackage: warning: build dependencies/conflicts unsatisfied; aborting dpkg-buildpackage: warning: (Use -d flag to override.) What to do?
libjson-c2 does not exist in Debian 9; doing an: $apt-cache search libjson-c libjson-c3 - JSON manipulation library - shared library It is fairly evident it is now called libjson-c3; so I replaced in the debian control file of the project at freeradius-server/debian/control at line 10, libjson-c2 for libjson-c3 10 libjson0 | libjson-c3, Doing again : fakeroot dpkg-buildpackage -b -uc It compiles with success, and produces at the directory at freeradius-server/.. the following files: freeradius_3.0.15+git_amd64.deb freeradius-common_3.0.15+git_all.deb freeradius-config_3.0.15+git_amd64.deb freeradius-dbg_3.0.15+git_amd64.deb freeradius-dhcp_3.0.15+git_amd64.deb freeradius-iodbc_3.0.15+git_amd64.deb freeradius-krb5_3.0.15+git_amd64.deb freeradius-ldap_3.0.15+git_amd64.deb freeradius-memcached_3.0.15+git_amd64.deb freeradius-mysql_3.0.15+git_amd64.deb freeradius-postgresql_3.0.15+git_amd64.deb freeradius-redis_3.0.15+git_amd64.deb freeradius-rest_3.0.15+git_amd64.deb freeradius-utils_3.0.15+git_amd64.deb freeradius-yubikey_3.0.15+git_amd64.deb libfreeradius3_3.0.15+git_amd64.deb libfreeradius-dev_3.0.15+git_amd64.deb
Building debs for FreeRadius 3.0.15
1,502,866,885,000
I recently learned that Debian based distros essentially have a fixed collection of communal dependencies and libraries which any application installed through a package manager is required to use. Contrast this against say, Windows, where I believe each application typically provides its own dependencies - and therefore a Windows OS installation will have instances of the same dependencies/libraries installed many times and each application will need to manage the updating of these dependencies on its own. I know some developers develop their software to be compatible with the APT package manager, but I imagine there must be many applications where the developers have created the software in the "Windows" way. So my question is, if the upstream developers created their software with the intention to distribute a large monolithic install complete with bundled dependencies, do the APT package maintainers need to rewrite the source so that the software uses the communal collection of dependencies rather than the local dependencies? If so, does this occur often and is this a major task for package maintainers?
So my question is, if the upstream developers created their software with the intention to distribute a large monolithic install complete with bundled dependencies, do the APT package maintainers need to rewrite the source so that the software uses the communal collection of dependencies rather than the local dependencies? Not necessarily, as long as the monolithic install doesn't conflict with an existing library or filename. That is, if the system already has a /lib/foobar (version 12), and the monolithic package requires and bundles foobar v. 9, that monolithic package can't store its foobar v. 9 using the filename /lib/foobar, because that pathname is taken -- but it could use /lib/foobar_v9, or perhaps .../monolithic_app_dir/lib/foobar. If so, does this occur often and is this a major task for package maintainers? Yes, preventing and if need be sorting out various levels of dependency hell is much of what package maintainers do.
Does packaging an application for APT involve pointing the application to use the APT communal dependencies?
1,502,866,885,000
I got 2 repos locally. One is a copy of Squeeze and another is a custom one, and is managed by reprepro. Are there ready-made tools that would generate a list of duplicate packages between the two?
Silly me, I've been seating on a script that makes this far faster and easier: #!/usr/bin/python3 import os import gzip import apt_pkg repo1 = "~/.repo_local/dists/cache/main/binary-i386/Packages.gz" repo1 = os.path.expanduser(repo1) repo1 = apt_pkg.TagFile(gzip.open(repo1, "rb")) repo1 = dict([(pkg["Package"], pkg["Version"]) for pkg in repo1]) repo2 = "~/.repo_bin/dists/squeeze/main/binary-i386/Packages.gz" repo2 = os.path.expanduser(repo2) repo2 = apt_pkg.TagFile(gzip.open(repo2, "rb")) repo2 = dict([(pkg["Package"], pkg["Version"]) for pkg in repo2]) apt_pkg.init_system() found = False for pkg in repo1: if pkg in repo2: vc = apt_pkg.version_compare(repo1[pkg], repo2[pkg]) if vc == 0: print("{:<30}{:<30}({})".format(repo1[pkg], repo2[pkg], pkg)) found = True if found: print("=" * 90) print("{:<30}{:<30}({})".format("custom", "official", "package name")) else: print("nothing matching search criteria found")
How to display duplicates between 2 repositories
1,502,866,885,000
I'm finishing off a small command-line BASIC interpreter for Unix. It currently consists of a dozen sources and headers, a makefile, test files and an Xcode project for working on the Mac. This is my first pure-CLI project. Releasing an app on iOS is well documented, there are checklists of items you need to submit - the app itself, various materials that go in the App Store page like images and text, and so forth. There are also guides on the workflow of the process itself and how to get the word out. What is the equivalent for Unix? There are dozens of package managers/app stores as well as any number of simpler download sites and I'm finding it difficult to get my head around it all. I tried Googling the topic, but the results are polluted by installer guides for individual products. The only cogent page I found was for Unix System V. I am wondering if someone might point me in the direction of a guide that takes you through this process and also indicates what the user expectations are? I don't want to make a package but forget some "everyone knowns you need this" sort of thing.
Debian has a “How to be a good upstream guide”, which contains lots of useful tips even if you’re not actually working on a package for Debian or any other distribution. The main considerations are: ship pristine source code, ideally with no build artifacts don’t include third-party dependencies choose a license, and ensure that choice is clear do actual releases include documentation (for extra bonus points, a man page) avoid hard-coded paths if you need to store user-specific configuration etc., follow the XDG base directory specification choose your dependencies carefully include a test suite (for extra bonus points, allow it to run using your program after it’s installed, not just in the build tree) pay attention to security There are more detailed considerations when it comes to your build system itself; one pain point I often run into is the use of specific flags, or ignoring well-known flags (CFLAGS, LDFLAGS etc.).
From program to complete project, what does a "real" Unix app require?
1,502,866,885,000
What is the max width in characters of a debian changelog file? I thought it is 80 columns, but I can't find where I had read that. I didn't find the answer in these references (unless I missed it)... Debian Manuals Debian Policy Please include a reference if you have one?
This is checked by lintian: The given line of the latest changelog entry is over 80 columns. Such changelog entries may look poor in terminal windows and mail messages and be annoying to read. Please wrap changelog entries at 80 columns or less where possible. I don’t know whether it’s documented anywhere else.
Debian changelog file width?
1,502,866,885,000
Fedora packages libtool as 64-bits: # rpm -qi libtool |grep ^Arch Architecture: x86_64 However, a superficial look at the package contents doesn’t show any obvious arch specific binaries: # rpm -ql libtool |xargs file /usr/bin/libtool: a /usr/bin/sh script, ASCII text executable, with very long lines, with escape sequences /usr/bin/libtoolize: a /usr/bin/sh script, ASCII text executable, with very long lines, with escape sequences /usr/share/aclocal/libtool.m4: M4 macro processor script, ASCII text, with very long lines /usr/share/aclocal/ltargz.m4: M4 macro processor script, ASCII text /usr/share/aclocal/ltdl.m4: M4 macro processor script, ASCII text /usr/share/aclocal/ltoptions.m4: M4 macro processor script, ASCII text /usr/share/aclocal/ltsugar.m4: M4 macro processor script, ASCII text /usr/share/aclocal/ltversion.m4: M4 macro processor script, ASCII text /usr/share/aclocal/lt~obsolete.m4: M4 macro processor script, ASCII text /usr/share/doc/libtool: directory /usr/share/doc/libtool/AUTHORS: ASCII text /usr/share/doc/libtool/ChangeLog: Non-ISO extended-ASCII text, with LF, NEL line terminators /usr/share/doc/libtool/NEWS: ASCII text /usr/share/doc/libtool/README: ASCII text /usr/share/doc/libtool/THANKS: UTF-8 Unicode text /usr/share/doc/libtool/TODO: ReStructuredText file, UTF-8 Unicode text /usr/share/info/libtool.info-1.gz: gzip compressed data, max compression, from Unix, original size modulo 2^32 312124 /usr/share/info/libtool.info-2.gz: gzip compressed data, max compression, from Unix, original size modulo 2^32 51735 /usr/share/info/libtool.info.gz: gzip compressed data, max compression, from Unix, original size modulo 2^32 4355 /usr/share/libtool: directory /usr/share/libtool/build-aux: directory /usr/share/libtool/build-aux/compile: a /usr/bin/sh script, ASCII text executable /usr/share/libtool/build-aux/config.guess: a /usr/bin/sh script, ASCII text executable /usr/share/libtool/build-aux/config.sub: a /usr/bin/sh script, ASCII text executable /usr/share/libtool/build-aux/depcomp: a /usr/bin/sh script, ASCII text executable /usr/share/libtool/build-aux/install-sh: a /usr/bin/sh script, ASCII text executable /usr/share/libtool/build-aux/ltmain.sh: POSIX shell script, ASCII text executable, with escape sequences /usr/share/libtool/build-aux/missing: a /usr/bin/sh script, ASCII text executable /usr/share/licenses/libtool: directory /usr/share/licenses/libtool/COPYING: ASCII text /usr/share/man/man1/libtool.1.gz: gzip compressed data, max compression, from Unix, original size modulo 2^32 3469 /usr/share/man/man1/libtoolize.1.gz: gzip compressed data, max compression, from Unix, original size modulo 2^32 3027 Which raises some questions: Where is the architecture specific part? Some compile time constants baked into those macro files? Would a 32-bit libtool accidentally packaged as noarch break 64-bit builds?
The libtool script itself embeds its default host and build architectures, so it is different on each architecture it’s built for. At least two other variables in libtool are architecture-dependent: the library search path; the linker command (it specifies the target format). The rest of libtool is architecture-independent, and some other distributions split the package up so that they can provide an architecture-dependent package containing only the libtool script, and an architecture-independent package containing everything else. Using the wrong libtool will indeed break your builds (it won’t find the right libraries, and linking will fail), unless they provide the correct values for the affected variables.
What is architecture specific about libtool?
1,502,866,885,000
I want to bundle Java application into a .deb package. Inside it is a jar launched with a java -jar $path/app.jar script. I need to specify in the package dependencies that it will require JRE >= 11. I've tried 2 options: Depends: java11-runtime - here the package will be uninstallable because it depends on a virtual package. Depends: default-jre | java11-runtime - now it will try to install default-jre which won't guarantee that it will be at least JRE 11.
I suggest using a versioned dependency on default-jre: Depends: default-jre (>= 2:1.11) | java11-runtime If your package doesn’t need the Java GUI packages, it should depend on the -headless variants instead.
Set minimal JRE version to deb package dependency
1,502,866,885,000
I want to create a .deb package of PHP 7.1 for Debian with the PHP modules I want. Here the steps I have followed. Downloading PHP sources wget http://fr2.php.net/get/php-7.1.7.tar.bz2/from/this/mirror tar xvf mirror mv mirror php_7.1.7.orig.tar.bz2 cd php-7.1.7/ Here I can compile PHP 7.1, no problem. If I want to build the package, I follow those steps: Preparing the packaging: export DEBFULLNAME="Shanx Shanxou" dh_make -e [email protected] apt-get install debhelper cdbs lintian build-essential fakeroot devscripts pbuilder dh-make debootstrap vim debian/control In that file I modify the Build-Depends: line with: Build-Depends: debhelper (>= 9), autotools-dev, mawk, file, libxml2-dev:amd64, libxml2:amd64, bison, perl-modules, libfakeroot:amd64, perl, mime-support, libmagic1:amd64 , autoconf, build-essential, git-core, libbz2-dev, libcurl4-openssl-dev, libfreetype6-dev, libicu-dev, libjpeg-dev, libmcrypt-dev, libpng-dev, libpspell-dev, libreadline -dev, libssl-dev, libxml2-dev, pkg-config, libc-client-dev, libkrb5-dev, libpq-dev, libxslt-dev The packaging: debuild -S -sa --lintian-opts -i cd .. pbuilder create pbuilder update --extrapackages "libc-client-dev pkg-config libssl-dev libreadline-dev libpspell-dev libpng-dev libmcrypt-dev libjpeg-dev libfreetype6-dev libcurl4-openssl-dev libbz2-dev git-core mime-support libfakeroot bison libkrb5-dev libxml2-dev debhelper" pbuilder build *.dsc The result: mkdir: cannot create directory '/usr/lib/x86_64-linux-gnu/extensions': Permission denied mkdir: cannot create directory '/usr/lib/x86_64-linux-gnu/extensions/no-debug-non-zts-20160303': No such file or directory Makefile:160: recipe for target 'install-modules' failed make[1]: *** [install-modules] Error 1 make[1]: Leaving directory '/tmp/buildd/php-7.1.7' dh_auto_install: make -j1 install DESTDIR=/tmp/buildd/php-7.1.7/debian/php AM_UPDATE_INFO_DIR=no returned exit code 2 debian/rules:22: recipe for target 'binary' failed make: *** [binary] Error 2 dpkg-buildpackage: error: fakeroot debian/rules binary gave error exit status 2 E: Failed autobuilding of package I: unmounting dev/pts filesystem I: unmounting run/shm filesystem I: unmounting proc filesystem I: cleaning the build env I: removing directory /var/cache/pbuilder/build//14827 and its subdirectories But the directory and the file have been created by the packaging process: # ls /usr/lib/x86_64-linux-gnu/extensions no-debug-non-zts-20160303 The questions Is my packaging process valid? If so, what could be the causes of the error? EDIT: @Stephen Kitt answer did the trick. Just to not, you have to use actual tabulations (not space) and not forget to reexecute debuild -S -sa --lintian-opts -i after the modification. EDITbis : New question here Installing a created .deb package
I would have used the existing Debian PHP 7.1 package instead... Anyway, to answer your question, your packaging process as described is valid. To answer properly we’d need to see your debian/control and debian/rules files in detail, but the error you’re seeing is easy to fix: the PHP source doesn’t use DESTDIR, it needs an INSTALL_ROOT variable instead. In debian/rules: override_dh_auto_install: dh_auto_install -- INSTALL_ROOT=$(CURDIR)/debian/php since you appear to be building a single php binary package.
Creating a .deb package for PHP 7.1
1,502,866,885,000
I have a package I like to build locally. Some of the files in the package are to be installed on a system where a given user is created first. Those files should be owned by that user. For example, say I have a user "foo" on my server and I create a package with a file such as /usr/share/foo/protected.file which has permissions u=r (i.e. only that user can read that file). What I'd like to do in my debian/rules file is to setup that file like so: override_dh_fixperms: dh_fixperms ... chmod 400 debian/foo/usr/share/foo/protected.file chown foo:foo debian/foo/usr/share/foo/protected.file ... My problem is that the computer I use to build the package does not have a user named "foo" so that chown fails. I would like to not create a "foo" user on that computer. Is there a way to do that in the build process (i.e. I know I could hack the resulting .tar file, but I don't want to do that). I use the following command to run my local build: dpkg-buildpackage -us -uc
Technically, you can construct your package in any way you want. As far as .deb files are concerned, all that’s expected in the final stage of package construction is that debian/rules binary leaves a valid .deb file with the right name in the parent directory. So you could override dh_builddeb to create the tarball with files owned by a non-existent user. However Debian packages involving non-standard users don’t do this: they handle file ownership in their postinst. They usually also handle user creation there: if the user doesn’t exist, they create it before running chown. This ensures that the package is installable regardless of pre-existing users. The race condition you mention in a comment shouldn’t matter in practice: if dpkg -i succeeds, the file will have the right ownership before dpkg -i completes; if it fails, the package should be considered unusuable anyway.
Is it possible to setup a user while building a Debian package even when that user does not exist on the build system?
1,687,753,520,000
While running pacman -Syu After "(8/8) checking package integrity" I'm facing the following issue with these packages: error: 7-zip: signature from "TNE <[email protected]>" is unknown trust :: File /var/cache/pacman/pkg/7-zip-23.01-1-x86_64.pkg.tar.zst is corrupted (invalid or corrupted package (PGP signature)). Do you want to delete it? [Y/n] y error: brave-bin: signature from "TNE <[email protected]>" is unknown trust :: File /var/cache/pacman/pkg/brave-bin-1:1.52.126-1-x86_64.pkg.tar.zst is corrupted (invalid or corrupted package (PGP signature)). Do you want to delete it? [Y/n] y error: pamac-aur: signature from "TNE <[email protected]>" is unknown trust :: File /var/cache/pacman/pkg/pamac-aur-11.0.1-1-x86_64.pkg.tar.zst is corrupted (invalid or corrupted package (PGP signature)). Do you want to delete it? [Y/n] y error: spotify: signature from "TNE <[email protected]>" is unknown trust :: File /var/cache/pacman/pkg/spotify-1:1.2.13.661-1-x86_64.pkg.tar.zst is corrupted (invalid or corrupted package (PGP signature)). Do you want to delete it? [Y/n] y error: visual-studio-code-bin: signature from "TNE <[email protected]>" is unknown trust :: File /var/cache/pacman/pkg/visual-studio-code-bin-1.79.2-1-x86_64.pkg.tar.zst is corrupted (invalid or corrupted package (PGP signature)). Do you want to delete it? [Y/n] y error: yay: signature from "TNE <[email protected]>" is unknown trust :: File /var/cache/pacman/pkg/yay-12.1.0-1-x86_64.pkg.tar.zst is corrupted (invalid or corrupted package (PGP signature)). Do you want to delete it? [Y/n] y error: zoom: signature from "TNE <[email protected]>" is unknown trust :: File /var/cache/pacman/pkg/zoom-5.15.0-1-x86_64.pkg.tar.zst is corrupted (invalid or corrupted package (PGP signature)). Do you want to delete it? [Y/n] y error: failed to commit transaction (invalid or corrupted package (PGP signature)) Errors occurred, no packages were upgraded. So far, I've tried running this (without success): sudo pacman -S archlinux-keyring | pacman -Su pacman -Sy archlinux-keyring | pacman-key --refresh-keys pacman-key --delete 91BD8815FE0040FA7FF5D68754C28F4FF5A1A949 | pacman-key --populate archlinux pacman-key --delete D6C9442437365605 | pacman-key --populate archlinux sudo pacman -Sc sudo pacman -Fy
I've got some help on Linux.Chat Discord server, and Theros (the user that help me) found a way to solve this issue: "looks like your after 0xd6c9442437365605 thats from ubuntus keyserver https://keyserver.ubuntu.com/pks/lookup?search=tne%40garudalinux.org&fingerprint=on&op=index though considering that garuda uses chaotic you should only really need the chaotic-keychain and yeh, that seems about right, considering it looks like archcraft are using chaotic for stuff https://github.com/archcraft-os/archcraft/issues/251 " So I've manage to fix it by following this steps: sudo pacman-key --recv-key D6C9442437365605 --keyserver keyserver.ubuntu.com sudo pacman-key --lsign-key D6C9442437365605 sudo pacman -U 'https://cdn-mirror.chaotic.cx/chaotic-aur/chaotic-keyring.pkg.tar.zst' 'https://cdn-mirror.chaotic.cx/chaotic-aur/chaotic-mirrorlist.pkg.tar.zst'
Signature from "TNE <[email protected]>" is unknown trust - Invalid or Corrupted package
1,687,753,520,000
I have a debian package which contains configuration for systemd-networkd e.g. I configure my interface IP. That only makes sense if systemd-networkd is running. Because of that I want to ensure that the service is enabled and running. But putting this in postinst feels wrong: systemctl enable systemd-networkd systemctl start systemd-networkd What is the proper way to solve this?
There is normally nothing wrong with using systemctl enable in postinst on services deployed by your package. Many Debian packages use deb-systemd-helper instead which takes care of a few details (like respecting vendor preset and explicitly disabled or masked service). systemd-networkd.service is deployed by systemd itself. If we inspect systemd.postinst, we already see that systemd uses systemctl to manage this unit. $ dpkg -S /lib/systemd/system/systemd-networkd.service systemd: /lib/systemd/system/systemd-networkd.service $ grep systemd-networkd.service -C3 /var/lib/dpkg/info/systemd.postinst if [ -n "$2" ]; then _systemctl daemon-reexec || true ... _systemctl try-restart systemd-networkd.service || true _systemctl try-restart systemd-journald.service || true fi However, it is unusual to enable a service owned by another package. Instead, consider using unit relationships instead. If your package deploys its own systemd unit which depends on this network configuration, then it's a simple matter of adding the following to your [Unit] section: [Unit] Requires=systemd-networkd.service After=systemd-networkd.service This will ensure that systemd-networkd.service is started when your unit starts, and your unit will not start if systemd-networkd.service fails to start. If you don't have any units in your package, then consider simply creating a target to do this for you: # /lib/systemd/system/mypackage.target [Unit] Description=MyPackage unit dependency management Requires=systemd-networkd.service After=systemd-networkd.service [Install] WantedBy=multi-user.target Then manage it in your maintainer scripts: # postinst if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ] || [ "$1" = "abort-deconfigure" ] || [ "$1" = "abort-remove" ] ; then deb-systemd-helper unmask 'mypackage.target' >/dev/null || true if deb-systemd-helper --quiet was-enabled 'mypackage.target'; then deb-systemd-helper enable 'mypackage.target' >/dev/null || true else deb-systemd-helper update-state 'mypackage.target' >/dev/null || true fi fi # prerm if [ "$1" = remove ] ; then deb-systemd-invoke stop 'mypackage.target' >/dev/null || true fi # postrm if [ "$1" = remove ] ; then systemctl --system daemon-reload >/dev/null || true fi if [ "$1" = "purge" ]; then deb-systemd-helper purge 'mypackage.target' >/dev/null || true fi If you are using debian/rules and debhelper to create your packages, then consider using dh_installsystemd which will add this to your maintainer scripts automatically in the @DEBHELPER@ placeholder.
How to start a 3rdparty systemd service from a debian package
1,687,753,520,000
I want to download all (recursive) build dependencies to be able to build apt (debian) package from source. However, when I apt-get install path/*.debs with debs that I got by apt build-dep --download-only --assume-yes <package> apt finds additional packages to be installed and fails, even with --no-install-recommends --ignore-missing. My specific issue got no answer on SO. Then I've investigated further and I have not seen those additional packages in output of successfully run apt build-dep <package>, therefore I've realized (obviously) build dependencies should be tracked differently. How? I mean there are Depends/Suggests/Recommends fields in a deb file, but I have not seen additional fields related to sourcing. build-dep resulted in ~150 deb files found, but during installation of them as packages, apt found additional dependencies. I've tried to read Packaging/SourcePackage - Debian Wiki Source packages provide you with all of the necessary files to compile or otherwise, build the desired piece of software. It consists, in its simplest form, of three files: The upstream tarball with .tar.gz ending A description file with .dsc ending. apt source cinnamon-settings-daemon Got cinnamon-settings-daemon_5.0.4+uma.tar.xz., search have not found .dsc file inside, maybe Linux Mint (OS I use) implemented modified Debian implementation? BuildingTutorial - Debian Wiki apt provides a way of easily installing all the needed dependencies: Example 1: node-pretty-ms sudo apt build-dep node-pretty-ms However I have not found description how system keep track of those. Inside one of downloaded deb files I got with apt build-dep I do not see additional section with dependencies for building/source: $ apt show /media/ramdrive/debs/cinnamon-settings-daemon/autoconf_2.69-11.1_all.deb Package: autoconf Version: 2.69-11.1 Priority: optional Section: devel Origin: Ubuntu Maintainer: Ubuntu Developers <[email protected]> Original-Maintainer: Ben Pfaff <[email protected]> Bugs: https://bugs.launchpad.net/ubuntu/+filebug Installed-Size: 1905 kB Depends: perl (>> 5.005), m4 (>= 1.4.13), debianutils (>= 1.8) Recommends: automake | automaken Suggests: autoconf-archive, gnu-standards, autoconf-doc, libtool, gettext Breaks: gettext (<< 0.10.39), pkg-config (<< 0.25-1.1) Homepage: http://www.gnu.org/software/autoconf/ Task: ubuntustudio-video Download-Size: 321 kB APT-Sources: http://archive.ubuntu.com/ubuntu focal/main amd64 Packages Description: automatic configure script builder The standard for FSF source packages. This is only useful if you write your own programs or if you extensively modify other people's programs. . For an extensive library of additional Autoconf macros, install the `autoconf-archive' package. . This version of autoconf is not compatible with scripts meant for Autoconf 2.13 or earlier. Added 1: One of two packages still listed as "additional" during apt-get install --no-install-recommends is libpulse0:i386. Doing ~$ apt-cache rdepends --recurse --no-recommends --no-suggests --no-conflicts --no-breaks --no-replaces --no-enhances libpulse0:i386 # got ~ 1000 lines find /path_to_debs/cinnamon-settings-daemon -name *.deb | xargs apt-cache show | grep Package | awk '{print $2}' # ~ 160 debs and using vlookup in LibreOffice Calc found out it reverse depends on to be installed pulseaudio and pulseaudio-module-bluetooth via e.g. on about ~300th line of rdepends: libcanberra-pulse:i386 ReverseDepends: pulseaudio Added 2022/01/06: I understood the cause of initial issue, if interested, see https://stackoverflow.com/a/70601238/14557599 and https://unix.stackexchange.com/a/684975/446998. I was not able to reproduce my claim in this question (I have not seen those additional packages in output of successfully run apt build-dep <package>), maybe I run the command on another system blinded by my incorrect assumption from realizing differences between them mattered.
Build dependencies are set by the package maintainer with a Build-Depends: (and sometimes Build-Depends-Indep:) settings in the debian/control file of the source package. Depends, Recommends, and Suggestions are needed when a package is installed (or about to be installed), so that data is in the Packages file. Build-Depends* are only needed when the package is being built, so is not. BTW, as you can see from either downloading the source package or using the package tracker (e.g. https://tracker.debian.org/media/packages/a/autoconf/control-2.71-2) the Build-Depends* settings for autoconf are: Build-Depends-Indep: texinfo (>= 4.6), m4 (>= 1.4.13), texlive-base, texlive-plain-generic, texlive-latex-base, texlive-latex-recommended, texlive-fonts-recommended, help2man, cm-super Build-Depends: debhelper-compat (= 13) Also BTW, this is a simplification. It's enough for most packages, but some packages also have Build-Conflicts*: settings for packages that can not be installed for the build to be successful. If you haven't already, I suggest that you read the Debian New Maintainers' Guide - some of this is specific to Debian package maintainers, but most of it is generic "how do I build a .deb package" info.
How does apt keep track of BUILD (source) dependencies?
1,687,753,520,000
I'm packaging the software, which depends on a particular version of a library shipped in the official Debian distribution. The software also has a bundled sources of the library. Is there any way to describe this in the debian/control file that for Debian versions older than 10, I don't need to specify anything, but for >= 10, I can use the shipped version as a build requirement? Also, for the older versions (how to detect it in the debian/rules file?) I have to pass an additional option to cmake at configure step.
There’s no provision for this: the expectation is that source packages (including debian/control) are uploaded to a specific distribution and release, with build instructions, including build dependencies, which work in that distribution. In some circumstances it is possible to modify debian/control on the fly, from debian/rules, but that doesn’t work for build dependencies since they are resolved before the build starts. In practice, there are two approaches which could work for you: use some sort of templating tool to take a common source and generate debian/control and debian/rules for each target you care about; use branches in a version control system to separate the various targets but still allow reasonably simple maintenance. The latter is how most packages are maintained in Debian, when they need to allow uploads to multiple targets (e.g. experimental or stable or backports in addition to unstable). Also, for the older versions (how to detect it in the debian/rules file?) I have to pass an additional option to cmake at configure step. You shouldn’t ever need to do this; instead of detecting the older version and hard-coding the behaviour, detect the behaviour you’re trying to implement. For example, check to see whether the dependency library is present on the system, and adjust the cmake invocation in consequence; or if it’s a cmake problem, detect the installed version of cmake.
Conditional dependencies in `debian/control` file
1,687,753,520,000
Currently Alpine packages Perl, however that version of Perl is built with the wrong options for my needs. So I want to package a new version Perl built with different configuration/build options. Is there a mechanism to say that my Perl should conflict with the upstream Perl? I'm reading the Wiki, "Creating an Alpine package" but I don't see anything in there about "Conflicts".
The way to specify that a package is conflicting in an APKBUILD is by adding the package name prefixed with a '!' to depends (see the APKBUILD reference). depends=".. !perl" What you also might want to do is add a provides option: provides="perl=$pkgver-r$pkgrel" This makes sure that any packages that depend on perl can use this package instead.
How can I make an Alpine package conflict with another Alpine package?
1,687,753,520,000
rpmlint output: E: use-tmp-in-%postun Spec file: %postun rm -r /var/aci /tmp/aci_tmp 2> /dev/null Also, I cant remove package How I can remove directory in /tmp after or before uninstalling this package?
always try to avoid %post and %postun scripts if possible. You could make those aci files or folders belong to your package. let's suppose for the sake of the example that /var/aci is a folder and /tmp/aci_tmp is a file. Then you could just: %install mkdir -p $PPM_BUILD_ROOT/var/aci %files /var/aci %ghost /var/aci/* # not sure this is necessary... %ghost /tmp/aci_tmp the %ghost directives mean: if this file/folder appears, it belongs to me. That also means that they will be removed when you remove the package.
Rpmlint "use-tmp-in-%postun" error
1,687,753,520,000
I have a single upstream source package using cmake and I'd like to package it as two binary debian packages. $ tree proj proj/ ├── app1.c ├── app2.c └── CMakeLists.txt Upstream's CMakeLists.txt was already written with this in mind. They use the COMPONENTS argument of install $ cat proj/CMakeLists.txt include(GnuInstallDirs) add_executable(app1 app1.c) install( TARGETS app1 RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT app1) add_executable(app2 app2.c) install( TARGETS app2 RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT app2) To compile/install locally, it's pretty easy: $ mkdir build && cd build $ cmake ../proj -DCMAKE_INSTALL_PREFIX=/usr/local # Configure $ cmake --build . # Build $ cmake -DCOMPONENT=app1 -P cmake_install.cmake # Install app1 component $ cmake -DCOMPONENT=app2 -P cmake_install.cmake # Install app2 component But how would you build a debian/rules file for this?
A standard debhelper debain/rules file might look like this (buildsystem automatically detects cmake in newer compat levels). %: dh $@ # --buildsystem=cmake <-- older compat levels may need this This will effectively run make install DESTDIR=debian/tmp. But that puts everything into one destination, requiring you to write debian/*.install files to manually to split it up (see dh_install(1)). This is the normal way to turn a monolithic cmake source into multiple binaries and there's a good guide for that in Debian's manual here. However, upstream has done that work for you by defining COMPONENT installs. To take advantage of that, override your own install recipe to specify package/component association: include /usr/share/dpkg/architecture.mk %: dh $@ override_dh_auto_install: sed -i -e 's/\-P/\-DCOMPONENT\=app1\ \-P/g' obj-$(DEB_HOST_MULTIARCH)/Makefile dh_auto_install --destdir=debian/app1 sed -i -e 's/\-DCOMPONENT\=app1/\-DCOMPONENT\=app2/g' obj-$(DEB_HOST_MULTIARCH)/Makefile dh_auto_install --destdir=debian/app2 The root of debian/<binary_package_name> represents / in that binary package. I'm a little disappointed in the sed commands. I was hoping to do it by passing -- -DCOMPONENT=app1 to dh_auto_install directory. Instead these commands edit the Makefile auto-generated by cmake. This solution presumes you are using make, and that the only -P string is going to be in your install commands (which seem to be the case for the projects I've checked so far). I'm happy to accept edits to this answer with a better solution. Note: Kitware (cmake developer) is working on a new debhelper extension dh-cmake which looks like it'll make this even easier. However, as of Debian 10 (buster) it's not yet available.
Packaging CMake components for Debian
1,687,753,520,000
I know that in Debian you have a watch file which diffs the pristine version of a package with a release upstream (using regexp) and telling if there is a new package release. How are changelogs done. Are they imported manually or is there some dh (debhelper) magic which automates most of the work, something like diffing between changelog numbers and adding the recent changes. The source could either be in some git repository which has a file called changelog or a tarball which has a file called changelog.
Upstream changelogs aren’t imported specifically, they are handled as a file in the upstream source code. There is a debhelper helper, dh_installchangelogs, which handles Debian-specific changelogs and upstream changelogs. Package maintainers don’t have to use this of course, theyways handle changelogs in other ways. Packages are always built in isolation, they can’t compare files to the previous version.
How are upstream changelogs pulled and shared in Debian?
1,687,753,520,000
I like the way Debian gives various changelogs. For instance for most packages it has changelog.gz, the upstream changelog giving details of the differences between any two versions or at times even point versions. Nowadays usually distilled from $ git shortlog or whatever equivalent command in whatever VCS is being used. changelog.Debian.gz, listing changes/improvements done to a package. Some of the common changes include changes of the packaging team, changes to the standards versions, updating build-depends, any patches which fix some issue in Debian which has not been accepted upstream, any changes to either debian/rules or debian/control which might be notable and need mentioning. While I'm pretty happy with the way Debian organizes this, I'm wondering whether this idea of having separate changelogs, tracking upstream changes separately from distribution changes to lessen confusion, came from Debian or some other distribution. Was Debian the first distribution to do this? If not, where did the idea come from?
Debian wasn’t the first distribution to separate the changelogs, but it might have been the first to maintain per-package changelogs. Changelogs for software have existed for a long time (they’re a fairly obvious variant of lab notebooks or engineering logs). Early Linux distributions kept their own changelogs in a similar fashion; since they logged changes made to the distribution, they were naturally kept separate from the changelogs of the software being distributed. For example, SLS had a changelog with entries like 920901: Initial release (.96p4). Didn't use jump tables though. 921007: Release .98p0. Jump tables used. 921011: menus.taz: new sysinstall and sysbuild. a1: New .98p1 image with new sysinstall a2: New rootdisk image.taz: 0.98p1 kernel, Fixed top. devs.taz: modified /dev directory image.taz: Linux .98p1 image, ps, etc. lx96p1.taz: Linux source for .98p1 (replaces lx98.taz). tcpip.taz: Telnet and fpt 2.2.2 binaries. c4/: Added new disk, clisp to compiler series. x*: Reorganized and fixed double compressed fonts. The earlier MCC also had changelogs, for example this one for 0.99p8. Users familiar with Slackware will find the format familiar; Slackware still maintains distribution-wide changelogs. For both SLS and Slackware, a single distribution changelog made sense because they were both initially the work of one person (Peter MacDonald for SLS, Patrick Volkerding for Slackware) and changes were thought of in terms of the whole distribution, not individual packages (at least, not to the same extent as nowadays). As you found out in the mailing list discussion on debian-devel, the current changelog practices in Debian weren’t present right from the start. In early 1994, Debian 0.91 had a distribution-wide changelog and its packages don’t contain a changelog (at least, not its binary packages). By late 1994 and Debian 0.93, source packages had individual changelogs, kept in debian.README (which also contains licensing information); see LILO’s packaging patch for an example: Changes 9-July-1995 Bruce Perens <[email protected]> Upgraded to version 16. 23-December-1994 Bruce Perens <[email protected]> Added Debian GNU/Linux package maintenance system files, and configured for Debian. (Note that looking at packages such as dpkg or the Debian documentation, as suggested in the mailing list, isn’t all that useful since they are native packages, with a single changelog covering software and packaging changes.) So it seems Debian was the first Linux distribution to store per-package, distribution-specific changelogs, separate from the upstream changelogs. Other distributions followed suit, at least partially, with e.g. RPMs storing changelogs in their spec file (albeit typically with less detail than Debian changelogs, and only in the source package). There might be similar practices in the BSD world, I haven’t checked; and I can’t remember what packaging initiatives, if any, were around for other Unix systems in the early nineties.
Was Debian the first distribution to distinguish upstream and packaging changelogs?