LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 03-08-2019, 07:30 AM   #1
Irbis
Member
 
Registered: Jul 2018
Posts: 34

Rep: Reputation: Disabled
Debian - can't overwrite package


I have two debian packages with different names: configA.deb, configB.deb. According to debian manual - paragraph 7.6.2 both control files have the following lines:
Code:
Provides: my-config
Conflicts: my-config
Replaces: my-config
and both provide the same content - file: config

When I try to install configB.deb when configA.deb is already installed I get the following error:

Code:
dpkg: regarding configB.deb containing configB:
 configB conflicts with my-config
  configA provides my-config and is present and installed.

dpkg: error processing archive configB.deb (--install):
 conflicting packages - not installing configB
Errors were encountered while processing:
 configB.deb
Why it doesn't work ?
How to fix that ?

Last edited by Irbis; 03-08-2019 at 09:45 AM.
 
Old 03-08-2019, 10:36 AM   #2
fatmac
Senior Member
 
Registered: Sep 2011
Location: Upper Hale, Surrey/Hants Border, UK
Distribution: Devuan (mainly)
Posts: 4,280

Rep: Reputation: Disabled
Delete, or purge, configA before trying to install configB. That should work.
 
Old 03-08-2019, 10:43 AM   #3
Irbis
Member
 
Registered: Jul 2018
Posts: 34

Original Poster
Rep: Reputation: Disabled
This it workaround. It should work without deleting or purging configA.
 
Old 03-08-2019, 10:48 AM   #4
pan64
LQ Guru
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 17,245

Rep: Reputation: 5842Reputation: 5842Reputation: 5842Reputation: 5842Reputation: 5842Reputation: 5842Reputation: 5842Reputation: 5842Reputation: 5842Reputation: 5842Reputation: 5842
Quote:
Originally Posted by Irbis View Post
This it workaround. It should work without deleting or purging configA.
where is this information coming from?
 
Old 03-08-2019, 11:13 AM   #5
Irbis
Member
 
Registered: Jul 2018
Posts: 34

Original Poster
Rep: Reputation: Disabled
So what is the purpose for Replaces section in control file ? (paragraph 7.6.2)

I have thought that it allows to overwrite exisitng package without deleting/purging them first.
 
Old 03-08-2019, 12:18 PM   #6
pan64
LQ Guru
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 17,245

Rep: Reputation: 5842Reputation: 5842Reputation: 5842Reputation: 5842Reputation: 5842Reputation: 5842Reputation: 5842Reputation: 5842Reputation: 5842Reputation: 5842Reputation: 5842
I would suggest you to read the link you posted, especially the section: 7.4. Conflicting binary packages - Conflicts
 
Old 03-08-2019, 03:46 PM   #7
Irbis
Member
 
Registered: Jul 2018
Posts: 34

Original Poster
Rep: Reputation: Disabled
Ok, so is it possible to achieve overwriting package without deleting/purging them first?
 
Old 03-08-2019, 03:57 PM   #8
hydrurga
LQ Guru
 
Registered: Nov 2008
Location: Pictland
Distribution: Linux Mint 20 MATE
Posts: 8,048
Blog Entries: 5

Rep: Reputation: 2922Reputation: 2922Reputation: 2922Reputation: 2922Reputation: 2922Reputation: 2922Reputation: 2922Reputation: 2922Reputation: 2922Reputation: 2922Reputation: 2922
Try:

Code:
sudo dpkg -i --force-overwrite configB.deb
 
Old 03-08-2019, 04:58 PM   #9
Irbis
Member
 
Registered: Jul 2018
Posts: 34

Original Poster
Rep: Reputation: Disabled
Works. But I wonder if it is possible without using --force-overwrite option ?
 
Old 03-08-2019, 05:27 PM   #10
hydrurga
LQ Guru
 
Registered: Nov 2008
Location: Pictland
Distribution: Linux Mint 20 MATE
Posts: 8,048
Blog Entries: 5

Rep: Reputation: 2922Reputation: 2922Reputation: 2922Reputation: 2922Reputation: 2922Reputation: 2922Reputation: 2922Reputation: 2922Reputation: 2922Reputation: 2922Reputation: 2922
Try using Conflicts and neither of the other two (Provides and Replaces) - that may force an uninstall of configA.
 
Old 03-09-2019, 12:48 PM   #11
Irbis
Member
 
Registered: Jul 2018
Posts: 34

Original Poster
Rep: Reputation: Disabled
Provides: my-config
Replaces: my-config

Error msg:

Code:
dpkg: error processing archive configB.deb (--install):
 trying to overwrite '/home/user/configs/config', which is also in package configA
Errors were encountered while processing:
 configB.deb
 
Old 03-09-2019, 12:56 PM   #12
hydrurga
LQ Guru
 
Registered: Nov 2008
Location: Pictland
Distribution: Linux Mint 20 MATE
Posts: 8,048
Blog Entries: 5

Rep: Reputation: 2922Reputation: 2922Reputation: 2922Reputation: 2922Reputation: 2922Reputation: 2922Reputation: 2922Reputation: 2922Reputation: 2922Reputation: 2922Reputation: 2922
Quote:
Originally Posted by Irbis View Post
Provides: my-config
Replaces: my-config

Error msg:

Code:
dpkg: error processing archive configB.deb (--install):
 trying to overwrite '/home/user/configs/config', which is also in package configA
Errors were encountered while processing:
 configB.deb
No, I advised you just to use Conflicts, not the other two. You have done the opposite.

You should use:

Code:
Conflicts: configA
 
Old 03-09-2019, 01:02 PM   #13
Irbis
Member
 
Registered: Jul 2018
Posts: 34

Original Poster
Rep: Reputation: Disabled
I don't want to use explicitly config* in the control file. That is reason why I have used Provides section. Let's assume that I have a lot of different config*.deb and each contains config file. I just want to overwrite a package which is currently installed.
 
Old 03-09-2019, 01:28 PM   #14
hydrurga
LQ Guru
 
Registered: Nov 2008
Location: Pictland
Distribution: Linux Mint 20 MATE
Posts: 8,048
Blog Entries: 5

Rep: Reputation: 2922Reputation: 2922Reputation: 2922Reputation: 2922Reputation: 2922Reputation: 2922Reputation: 2922Reputation: 2922Reputation: 2922Reputation: 2922Reputation: 2922
In that case, Provides and Replaces are no good to you. They declare the relationships between packages, not between packages and files.

Please see this page:

https://www.debian.org/doc/debian-po...tionships.html
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] No package 'x11' found No package 'xext' found No package 'xdamage' found No package 'xfixes' found No package 'x11-xcb' found Jigsaw Linux From Scratch 14 02-23-2021 09:35 PM
Installed a package via rpm YaST, now overwrite-upgrade to new with source? hgb SUSE / openSUSE 3 11-14-2005 02:13 AM
dpkg: trying to overwrite `/bin/chgrp', which is also in package coreutils ahz Debian 3 05-26-2005 03:51 AM
i can read/write but overwrite no, with samba djkoe Linux - Newbie 2 01-02-2004 03:38 PM
Can't overwrite MBR Elmo Linux - General 2 03-13-2003 02:24 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 11:52 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration