Score:0

Install a .deb package with dpkg-deb without creating the usr folder

tn flag

I am installing a debian package using dpkg-deb on Ubuntu 20.04.3 LTS (64-bit). I want to install it in a specific directory, called software. Inside this directory I have already the bin, the share, the include, the lib directories.

Here's how I tried to install the package:

wget http://ftp.br.debian.org/debian/pool/main/c/curl/libcurl4_7.74.0-1.3+b1_amd64.deb
dpkg-deb -x libcurl4_7.74.0-1.3+b1_amd64.deb /gpfs/software

The /gpfs/software directory is the one where I want to install it. The result of this operation is an error-less installation. However, it creates a directory named usr contained inside the software directory. Inside usr, you'll find lib and share which I already have inside `software. Like this:

.
└── software
    ├── bin
    ├── include
    ├── lib
    ├── share
    │   └── man
    └── usr
        ├── lib
        └── share

My question is: how can I tell dpkg-deb to put the contents of software/usr/lib and of software/usr/share inside software/lib and software/share?

guiverc avatar
cn flag
You haven't provided any OS & release, however downloading and install packages built for Debian on a Ubuntu system, can be like asking for problems. You also highlight many version of python that aren't standard versions used by on-topic releases.
guiverc avatar
cn flag
Please refer https://askubuntu.com/help/on-topic, Ubuntu and official *flavors* of Ubuntu (https://ubuntu.com/download/flavours) are on-topic on this site. The on-topic link provides alternate SE sites for non-Ubuntu OSes.
tn flag
I edited the post.
user535733 avatar
cn flag
You must edit the package's file structure. The file paths are hard-coded in the package's data.tar.xz archive. This is not a trivial task for beginner. Note that this means dpkg will promptly start complaining that the package has been (correctly) tampered with, that you likely cannot upgrade the package (the upgrade will change all the file paths back to normal), and that if you lose that altered package, you won't be able to use dpkg to uninstall the altered package software.
Score:2
cn flag

You cannot tell that. dpkg-deb installs the .deb package according to how it is packaged. It is the packager of the .deb package that decides how files are arranged. You only can decide on the parent directory where it is installed (/gpfs/software in your example).

You would need to repackage the software yourself in a different .deb package in order to change this.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.