Problems creating a .deb file with dependencies - linux

I have created a directory structure with an executable file. Following is the output of tree:
program-5
├── debian
│   ├── DEBIAN
│   │   ├── changelog
│   │   ├── compat
│   │   ├── control
│   │   ├── copyright
│   │   ├── docs
│   │   ├── emacsen-install.ex
│   │   ├── emacsen-remove.ex
│   │   ├── emacsen-startup.ex
│   │   ├── init.d.ex
│   │   ├── manpage.1.ex
│   │   ├── manpage.sgml.ex
│   │   ├── manpage.xml.ex
│   │   ├── menu.ex
│   │   ├── postinst.ex
│   │   ├── postrm.ex
│   │   ├── preinst.ex
│   │   ├── prerm.ex
│   │   ├── program.cron.d.ex
│   │   ├── program.debhelper.log
│   │   ├── program.default.ex
│   │   ├── program.doc-base.EX
│   │   ├── README.Debian
│   │   ├── README.source
│   │   ├── rules
│   │   └── watch.ex
│   └── usr
│   └── local
│   └── include
│   └── myprog
│   ├── file.txt
└── program *(executable)*
This however, is not working with "file.txt". I want this file to go into /usr/local/include/myprog/ but that is not happening. it's giving me the error:
(Reading database ...
(Reading database ... 5%
...
(Reading database ... 100%
(Reading database ... 204105 files and directories currently installed.)
Unpacking program-v5 (from .../program-5_1.4.2_i386.deb) ...
dpkg: error processing /tmp/program-5/debian/program-5_1.4.2_i386.deb (--install):
trying to overwrite '/usr/local/include/myprog/file.txt', which is also in package program2 20120329-1
dpkg-deb (subprocess): data: internal gzip write error: Broken pipe
dpkg-deb: error: subprocess <decompress> returned error exit status 2
dpkg-deb (subprocess): failed in write on buffer copy for failed to write to pipe in copy: Broken pipe
Errors were encountered while processing:
/tmp/program-5/debian/program-5_1.4.2_i386.deb
Can anyone offer any advice?

The error is pretty clear: You try to install program-v5 and it attempts to overwrite a file already present and owned by package program2.
So you need to either
manually uninstall program2 before installing program-v5, or
add the required Conflicts:, Provides:, Replaces: flags in debian/control -- see the docs.
Lastly, for packages, /usr is a more natural choice then /usr/local.

From the error message:
trying to overwrite '/usr/local/include/myprog/file.txt', which is
also in package program2
It looks like you have a package program2 already installed on your system that have already installed this file usr/local/include/myprog/file.txt.
You should first uninstall this package dpkg -r program2

Related

How to make mtd-utils 2.0 for specified deployment path

I downloaded mtd-utils 2.0 and I want to built it for specified deployment path. If I launch:
./configure --bindir .../mtd-utils-81049e5/deploy/usr/sbin
and then I do:
make
I will get output into folder, where I launched make. I want to have executable files somewhere like: bla/mtd-utils-2.0.../deploy/usr/sbin...
IIUC, you can do this like that:
./configure --prefix=/tmp/mtd-utils
make
make install
Finally, you get this:
$ tree /tmp/mtd-utils
/tmp/mtd-utils
├── sbin
│   ├── doc_loadbios
│   ├── docfdisk
│   ├── flash_erase
│   ├── flash_eraseall
│   ├── flash_lock
│   ├── flash_otp_dump
│   ├── flash_otp_info
│   ├── flash_otp_lock
│   ├── flash_otp_write
│   ├── flash_unlock
│   ├── flashcp
│   ├── ftl_check
│   ├── ftl_format
│   ├── jffs2dump
│   ├── jffs2reader
│   ├── mkfs.jffs2
│   ├── mkfs.ubifs
│   ├── mtd_debug
│   ├── mtdinfo
│   ├── mtdpart
│   ├── nanddump
│   ├── nandtest
│   ├── nandwrite
│   ├── nftl_format
│   ├── nftldump
│   ├── recv_image
│   ├── rfddump
│   ├── rfdformat
│   ├── serve_image
│   ├── sumtool
│   ├── ubiattach
│   ├── ubiblock
│   ├── ubicrc32
│   ├── ubidetach
│   ├── ubiformat
│   ├── ubimkvol
│   ├── ubinfo
│   ├── ubinize
│   ├── ubirename
│   ├── ubirmvol
│   ├── ubirsvol
│   └── ubiupdatevol
└── share
└── man
├── man1
│   └── mkfs.jffs2.1
└── man8
└── ubinize.8
5 directories, 44 files

How use Puppetfile to configure server in standalone mode

I'm create puppet configuration structure
puppet
│   ├── data
│   │   └── common.yaml
│   ├── hiera.yaml
│   ├── manifests
│   │   └── site.pp
│   ├── modules
│   │   ├── accessories
│   │   │   └── manifests
│   │   │   └── init.pp
│   │   ├── nginx
│   │   │   ├── manifests
│   │   │   │   ├── config.pp
│   │   │   │   ├── init.pp
│   │   │   │   └── install.pp
│   │   │   └── templates
│   │   │   └── vhost_site.erb
│   │   ├── php
│   │   │   ├── manifests
│   │   │   │   ├── config.pp
│   │   │   │   ├── init.pp
│   │   │   │   └── install.pp
│   │   │   └── templates
│   │   │   ├── php.ini.erb
│   │   │   └── www.conf.erb
│   │   └── site
│   │   └── manifests
│   │   ├── database.pp
│   │   ├── init.pp
│   │   └── webserver.pp
│   └── Puppetfile
Now I have just one server so I sometimes update it manual by runing:
sudo puppet apply --hiera_config=hiera.yaml --modulepath=./modules manifests/site.pp
At this moment I need to use some external modules and for example I added Puppetfile with next lines.
forge "http://forge.puppetlabs.com"
mod 'puppetlabs-mysql', '3.10.0'
...and of course it didn't work.
I tried to find something for configure it in command settings for 'apply' (Configuration Reference) but unsuccessful.
Is it real to auto-configure puppet in standalone mode by using Puppetfile or it possible only with 'puppet module install'???
Puppetfiles are not interpreted or read by the puppet server or client code. They're there to help other tools effectively deploy the proper puppet modules.
In your case in order to take advantage of the Puppetfile you've written you would need to install and configure r10k. HERE are the basics from the Puppet Enterprise documentation. HERE is another great resource, the r10k GitHub page.
Once installed and configured, r10k will read your Puppetfile and download+install the defined entries. In your case, it would install version 3.10.0 of puppetlabs-mysql. This would be installed into your modules directory and then you can execute the puppet agent run and take advantage of the newly installed modules.
In summary, Puppetfiles are not used by the client, they're used by code deployment software (r10k) to download and build the proper modules for the puppet server or agent to consume. Your options are to configure r10k to provision the modules as defined in the Puppetfile, or download the modules manually and eliminate the need for the Puppetfile.

Bootstrap in Bower Components - 404 (Not Found)

I've Googled around and searched Stack Overflow but I can't find an answer that has helped me unfortunately.
I have a small Node project with the following layout:
├── app
│   ├── config
│   │   ├── env
│   │   │   ├── development.js
│   │   │   └── production.js
│   │   ├── express.js
│   │   └── index.js
│   ├── controllers
│   │   ├── home.js
│   │   ├── index.js
│   │   ├── metric.js
│   │   ├── metricList.js
│   │   └── metrics
│   │   ├── file2.js
│   │   ├── file3
│   │   ├── file4.js
│   │   ├── file5.js
│   │   ├── file6
│   │   ├── index.js
│   │   └── points.js
│   ├── data
│   │   └── premierLeague
│   │   └── 2015-16.json
│   ├── public
│   │   └── main.css
│   │   └── bower_components
│   ├── routes.js
│   ├── server.js
│   └── views
│   ├── home.handlebars
│   ├── layouts
│   │   └── main.handlebars
│   ├── metric.handlebars
│   └── metricList.handlebars
├── bower.json
├── jsonScript.js
├── npm-debug.log
├── package.json
└── server.js
Bootstrap is located in the bower_components folder under public.
In my app/views/layouts/main.handlebars file I require the bootstrap CSS file using the following script tag:
<link rel="stylesheet" href="bower_components/bootstrap/dist/css/bootstrap.min.css">
In my app/config/express.js file (which does a lot of the work of getting the app going), I have this line:
app.use(express.static('./public'));
Unfortunately I always see this error in the Chrome console when I host up my app:
http://localhost:8080/bower_components/bootstrap/dist/css/bootstrap.min.css Failed to load resource: the server responded with a status of 404 (Not Found)
I'd be really grateful if someone could advise me how to either host my bower_components properly using Express or link to it successfully from my main layout. This is driving me mad, I've tried countless combinations and it never seems to work! Many thanks
Try to get the right path:
app.use(express.static(__dirname + '../public'));
The __dirname get the local directory.
And:
<link rel="stylesheet" href="/bower_components/bootstrap/dist/css/bootstrap.min.css">

Installing Viki on Vim 7.4.52

I'm following Swaroop's Byte of Vim, and have reached the chapter on personal information management, where it says to install the Viki plugin. The instructions are as follows (and I have no real idea of what is going on, but):
Download multvals.vim [2] and store as $vimfiles/plugin/multvals.vim
Download genutils.zip [3] and unzip this file to $vimfiles
Download Viki.zip [4] and unzip this file to $vimfiles (make sure all the folders and files under the 'Viki' folder name are stored directly in the $vimfiles folder)
After this I open a new text file in vim and run the commmand
:set filetype=viki
but I get a whole slew of errors. I've tried clearing out my ~/.vim folder and reinstalling everything, along with tlib this time as specified on the Viki vimscript page, and extracted the version 4.0 viki.vba instead of using the version 4.08 zip file, but I'm still getting errors about non-existent functions:
Error detected while processing home/user/.vim/ftplugin/viki.vim:
line 100
E117: Unknown function: tlib#balloon#Register
I don't really know what's going on, and am quite a new Vim user, so please be patient. Right now my ~/.vim directory tree looks like this:
.vim
├── autoload
│   ├── genutils.vim
│   ├── tlib
│   │   ├── eval.vim
│   │   ├── list.vim
│   │   ├── notify.vim
│   │   ├── persistent.vim
│   │   ├── progressbar.vim
│   │   ├── TestChild.vim
│   │   └── vim.vim
│   ├── tlib.vim
│   ├── viki
│   │   ├── enc_latin1.vim
│   │   └── enc_utf-8.vim
│   ├── viki_anyword.vim
│   ├── viki_latex.vim
│   ├── viki_viki.vim
│   └── viki.vim
├── colors
│   └── molokai.vim
├── compiler
│   └── deplate.vim
├── doc
│   ├── tlib.txt
│   └── viki.txt
├── ftplugin
│   ├── bib
│   │   └── viki.vim
│   └── viki.vim
├── plugin
│   ├── 02tlib.vim
│   ├── genutils.vim
│   ├── multvals.vim
│   └── viki.vim
└── test
└── tlib.vim
Any help is much appreciated.
The info is outdated. You need to install a current versions of tlib and viki from:
https://github.com/tomtom/viki_vim
https://github.com/tomtom/tlib_vim

Deb package from kernel module

I slightly modified the cp210x.c, compiled it, and copied the cp210x.ko to the right place, everything went fine. Now I would like to create a .deb package from it, but I'm stucked. I followed the tutorial, I found here: http://www.webupd8.org/2010/01/how-to-create-deb-package-ubuntu-debian.html
In Step 3. I selected "kernel module" instead of "single binary".
Before Step 3. I only had a Makefile and the cp210x.c in the mydriver-1.0 folder. The Makefile is very simpe:
obj-m += cp210x.o
KVERSION = $(shell uname -r)
all:
make -C /lib/modules/$(KVERSION)/build M=$(PWD) modules
clean:
make -C /lib/modules/$(KVERSION)/build M=$(PWD) clean
After Step 3. I have the following structure:
mydriver-1.0/
├── build-arch-stamp
├── build-indep-stamp
├── configure-stamp
├── cp210x.c
├── debian
│   ├── changelog
│   ├── compat
│   ├── control
│   ├── control.modules.in
│   ├── copyright
│   ├── docs
│   ├── mydriver.cron.d.ex
│   ├── mydriver.default.ex
│   ├── mydriver.doc-base.EX
│   ├── mydriver-modules-_KVERS_.postinst.modules.in.ex
│   ├── mydriver-source
│   │   └── usr
│   │   └── src
│   │   └── modules
│   │   └── mydriver
│   │   └── debian
│   ├── mydriver-source.debhelper.log
│   ├── mydriver-utils
│   ├── mydriver-utils.debhelper.log
│   ├── init.d.ex
│   ├── manpage.1.ex
│   ├── manpage.sgml.ex
│   ├── manpage.xml.ex
│   ├── menu.ex
│   ├── postinst.ex
│   ├── postrm.ex
│   ├── preinst.ex
│   ├── prerm.ex
│   ├── README.Debian
│   ├── README.source
│   ├── rules
│   └── source
│   └── format
└── Makefile
In Step 5 when I try enter
dpkg-buildpackage -rfakeroot
After a while I get this error:
...
# Copy only the driver source to the proper location
cp -s driver/* debian/mydriver-source/usr/src/modules/mydriver
cp: cannot stat driver/*: No such file or directory
debian/rules:130: recipe for target 'install' failed
make: *** [install] Error 1
dpkg-buildpackage: error: fakeroot debian/rules binary gave error exit status 2
Here I'm stuckedI have no clue what is the "driver" folder, should I create it or not and what should I put in it. Google did not help me neither, so I'm grateful for any help.

Resources