Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

install packet with apt or dpkg

New to Debian (Or Linux in general)? Ask your questions here!
Post Reply
Message
Author
debergerac
Posts: 3
Joined: 2019-11-04 07:57

install packet with apt or dpkg

#1 Post by debergerac »

hi,
i have just installed Debian 10.
i have downloaded a xxx.deb file. So i can't use synaptic. Can i install it with apt install xxx.deb? dpkg doesn't treat dependencies if i have understood the documentation. Right?
.Regards

Deb-fan
Posts: 1047
Joined: 2012-08-14 12:27
Been thanked: 4 times

Re: install packet with apt or dpkg

#2 Post by Deb-fan »

If it's an official .deb and package with depends available in whichever Debian repositories why not just install from them ? Clearly doubting it is or why wouldn't let the package management tools apt/itude deal with automagically resolving dependencies. Generally I tend to install such things with dpkg, by downloading xyz-package + any depends for it into a directory (helps to check what's already installed on your Debian OS), what we're discussing here can be a taste of "dependency hell", as you need the depends, perhaps their depends etc. Anyway once all required packages are dl'ed into a directory, then open a terminal there (or cd to it so it's the pwd/present working directory for that terminal) and install with ie: "sudo dpkg -i *.deb" almost always dpkg does a fine job of installing them + any depends no problemo. May've been one time I had to run the command again to get it to successfully complete but vast majority nope, dpkg did fine with it.

As long as you have networking (access to the repos and any depends are in them) a person could also do "sudo apt install -f" which should/would fix any broken packages, another being "sudo dpkg --configure -a". Google if unsure of what these do, shrugs. Would tell people which package, why you're opting to try to do this that way etc.
Most powerful FREE tech-support tool on the planet * HERE. *

Dai_trying
Posts: 1101
Joined: 2016-01-07 12:25
Has thanked: 5 times
Been thanked: 16 times

Re: install packet with apt or dpkg

#3 Post by Dai_trying »

The easy solution is to use apt to install your package ie

Code: Select all

apt install ./xxx.deb
as root (or with sudo) and do not forget the ./ at the beginning of the file name as it denotes using a file instead of the repository although dependencies will be obtained from your configured sources.

debergerac
Posts: 3
Joined: 2019-11-04 07:57

Re: install packet with apt or dpkg

#4 Post by debergerac »

i have downloaded code::blocks for programming in C++. I got a tar file i extracted and gave me some XXX.deb packet under a codeblock directory. My question is : how to install it?

kedaha
Posts: 3521
Joined: 2008-05-24 12:26
Has thanked: 33 times
Been thanked: 77 times

Re: install packet with apt or dpkg

#5 Post by kedaha »

debergerac wrote:i have downloaded code::blocks for programming in C++. I got a tar file i extracted and gave me some XXX.deb packet under a codeblock directory. My question is : how to install it?
It might help if you provided the link where you got it from. Thanks
DebianStable

Code: Select all

$ vrms

No non-free or contrib packages installed on debian!  rms would be proud.

Dai_trying
Posts: 1101
Joined: 2016-01-07 12:25
Has thanked: 5 times
Been thanked: 16 times

Re: install packet with apt or dpkg

#6 Post by Dai_trying »

Code: Select all

dai@home:~$ apt search codeblock
Sorting... Done
Full Text Search... Done
codeblocks/stable 16.01+dfsg-2.1 amd64
  Code::Blocks integrated development environment (IDE)
so you could install it via apt...

kedaha
Posts: 3521
Joined: 2008-05-24 12:26
Has thanked: 33 times
Been thanked: 77 times

Re: install packet with apt or dpkg

#7 Post by kedaha »

Assuming the Buster version 16.01+dfsg-2.1 is regarded as too old, following advice given here, it is easy to backport the shinier version from sid to buster, which is preferable to installing upstream debs. Or perhaps stevepusser :wink: will kindly provide a backport from his famous repository.
codeblocks | 17.12+dfsg-1 | unstable | source, amd64
Edit or add the source to /etc/apt/sources.list with a command like (modify for your mirror)

Code: Select all

# echo "deb-src http://ftp.us.debian.org/debian unstable main" >> /etc/apt/sources.list && apt-get update
# apt-get build-dep codeblocks
-b, --compile, --build
Compile source packages after downloading them. Configuration Item:
APT::Get::Compile.
Make a directory, for example CODEBLOCKS and change directory to that.

Code: Select all

# exit
$ mkdir CODEBLOCKS && cd CODEBLOCKS
user@debian:~/CODEBLOCKS$ apt-get -b source codeblocks
This will take some time but when it's completed use ls to view the resulting packages:

Code: Select all

$ user@debian:~/CODEBLOCKS$ ls
codeblocks-17.12+dfsg                      codeblocks-contrib-dbgsym_17.12+dfsg-1_amd64.deb
codeblocks_17.12+dfsg-1_amd64.buildinfo    codeblocks-dbgsym_17.12+dfsg-1_amd64.deb
codeblocks_17.12+dfsg-1_amd64.changes      codeblocks-dev_17.12+dfsg-1_amd64.deb
codeblocks_17.12+dfsg-1_amd64.deb          libcodeblocks0_17.12+dfsg-1_amd64.deb
codeblocks_17.12+dfsg-1.debian.tar.xz      libcodeblocks0-dbgsym_17.12+dfsg-1_amd64.deb
codeblocks_17.12+dfsg-1.dsc                libwxsmithlib0_17.12+dfsg-1_amd64.deb
codeblocks_17.12+dfsg.orig.tar.xz          libwxsmithlib0-dbgsym_17.12+dfsg-1_amd64.deb
codeblocks-common_17.12+dfsg-1_all.deb     libwxsmithlib-dev_17.12+dfsg-1_amd64.deb
codeblocks-contrib_17.12+dfsg-1_amd64.deb
Install (from within the directory) with:

Code: Select all

$ su -
# dpkg -i ./*.deb
Done.
DebianStable

Code: Select all

$ vrms

No non-free or contrib packages installed on debian!  rms would be proud.

User avatar
stevepusser
Posts: 12930
Joined: 2009-10-06 05:53
Has thanked: 41 times
Been thanked: 72 times

Re: install packet with apt or dpkg

#8 Post by stevepusser »

Not all the runtime dependencies are necessarily installed, even by installing all build-depends, so wouldn't using apt to install the debs be a better idea?

Sometimes you run into a situation where the debs conflict with other debs in the same build, so you can't install them all at once. In that case, such as with the Nvidia-driver backports which generate a whole slew of packages, I send them off to my local-apt-repository (apt install local-apt-repository and follow the directions) and let apt sort out the mess for me. It really helps with the Nvidia drivers, since there are also i386 packages involved on my 64-bit install.
MX Linux packager and developer

kedaha
Posts: 3521
Joined: 2008-05-24 12:26
Has thanked: 33 times
Been thanked: 77 times

Re: install packet with apt or dpkg

#9 Post by kedaha »

stevepusser wrote:Not all the runtime dependencies are necessarily installed, even by installing all build-depends, so wouldn't using apt to install the debs be a better idea?
To do it in one fell swoop I think so; however:
# apt-get -f install
I think will resolve any missing dependencies, if there are any after installing all the debs with dpkg.
But there weren't any on my system and the backported codeblocks works flawlessly.
DebianStable

Code: Select all

$ vrms

No non-free or contrib packages installed on debian!  rms would be proud.

Post Reply