How to set a custom install directory for a deb package with fpm

0 votes

while using fpm to create a deb package, if I try to install that deb package, it is being installed inside the wrong directory:

Command:

fpm -f -s "dir" -t "deb" -a "all" -n "my_project" -v 1 -C "/tmp/tmpoklyPn" /tmp/tmpoklyPn/myproject

The folder I want to package exists at /tmp/tmpoklyPn/myproject, but when I run:

dpkg -i my_package.deb

it installs it into /tmp/tmpoklyPn/myproject, ideally i'd like it to install into /var/lib/myproject. I  have tried --installdir and --root with my dpkg command, but it complains with cannot access archive: No such file or directory

Other information:

  • I'm using a ubuntu vm
  • I'm not bound to fpm and happy to hear other viable suggestions
  • inside myproject is a python virtualenv and my django project
Mar 26, 2018 in Big Data Hadoop by ajs3033
• 7,280 points
74 views

1 answer to this question.

0 votes

Here's something that you can try...

the last argument in an fpm command can contain an equals operator which defines the direcotry to come from and to install to.

Try using this command instead

fpm -f -s "dir" -t "deb" -a "all" -n "myproject" -v 1 -C "/tmp/tmpoklyPn" myproject=/var/lib/myproject

Notice the myproject=/var/lib/myproject, the left side is the directory name of my project (relative, because I used -C to change directory to /tmp/tmpoklyPn before looking for packages) and on the right side is where I want to install to on the remote machine...

the myproject=/var/lib/myproject, the left side is the directory name of the project and on the right side is where I want to install to on the remote machine. This is because  you used -C to change directory to /tmp/tmpoklyPn before looking for packages

answered Mar 26, 2018 by Amrinder
• 140 points

Related Questions In Big Data Hadoop

0 votes
1 answer
0 votes
1 answer

How to install and configure a multi-node Hadoop cluster?

I would recommend you to install Cent ...READ MORE

answered Mar 21, 2018 in Big Data Hadoop by Shubham
• 13,290 points
638 views
0 votes
1 answer

How to create a FileSystem object that can be used for reading from and writing to HDFS?

Read operation on HDFS In order to read ...READ MORE

answered Mar 21, 2018 in Big Data Hadoop by nitinrawat895
• 10,670 points

edited Mar 21, 2018 by nitinrawat895 294 views
0 votes
1 answer
0 votes
1 answer

How to avoid a “split-brain” scenario with NameNodes?

Okay, so let me tell you that ...READ MORE

answered Jul 11, 2018 in Big Data Hadoop by nitinrawat895
• 10,670 points
774 views
0 votes
1 answer

How to create a project for the first time in Hadoop.?

If you want to learn Hadoop framework ...READ MORE

answered Jul 26, 2018 in Big Data Hadoop by Neha
• 6,280 points
70 views
+5 votes
7 answers

Docker swarm vs kubernetes

Swarm is easy handling while kn8 is ...READ MORE

answered Aug 27, 2018 in Docker by Mahesh Ajmeria
1,003 views
+13 votes
2 answers

Git management technique when there are multiple customers and need multiple customization?

Consider this - In 'extended' Git-Flow, (Git-Multi-Flow, ...READ MORE

answered Mar 26, 2018 in DevOps & Agile by DragonLord999
• 8,380 points
152 views