install packet with apt or dpkg

New to Debian (Or Linux in general)? Ask your questions here!

install packet with apt or dpkg

Postby debergerac » 2019-11-04 08:03

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
debergerac
 
Posts: 2
Joined: 2019-11-04 07:57

Re: install packet with apt or dpkg

Postby Deb-fan » 2019-11-04 08:32

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.
Deb-fan
 
Posts: 445
Joined: 2012-08-14 12:27

Re: install packet with apt or dpkg

Postby Dai_trying » 2019-11-04 08:42

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.
Dai_trying
 
Posts: 800
Joined: 2016-01-07 12:25

Re: install packet with apt or dpkg

Postby debergerac » 2019-11-04 10:42

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?
debergerac
 
Posts: 2
Joined: 2019-11-04 07:57

Re: install packet with apt or dpkg

Postby kedaha » 2019-11-04 10:44

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
Mate DE & OSSv4.
FreedomBox in Debian
ispmail
Debian Stable

Words, as is well known, are the great foes of reality. Joseph Conrad.
Kedaha's Conjecture
User avatar
kedaha
 
Posts: 3017
Joined: 2008-05-24 12:26

Re: install packet with apt or dpkg

Postby Dai_trying » 2019-11-04 13:54

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...
Dai_trying
 
Posts: 800
Joined: 2016-01-07 12:25

Re: install packet with apt or dpkg

Postby kedaha » 2019-11-04 18:03

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.
Mate DE & OSSv4.
FreedomBox in Debian
ispmail
Debian Stable

Words, as is well known, are the great foes of reality. Joseph Conrad.
Kedaha's Conjecture
User avatar
kedaha
 
Posts: 3017
Joined: 2008-05-24 12:26

Re: install packet with apt or dpkg

Postby stevepusser » 2019-11-04 18:33

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.
The MX Linux repositories: Backports galore! If we don't have something, just ask and we'll try--we like challenges. New packages: Clipgrab 3.8.6, Hedgewars 1.0.0, PulseEffects 4.6.8, Telegram-desktop 1.8.15, Pale Moon 28.7.2, KeepassXC 2.5.1
User avatar
stevepusser
 
Posts: 11256
Joined: 2009-10-06 05:53

Re: install packet with apt or dpkg

Postby kedaha » 2019-11-04 19:58

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.
Mate DE & OSSv4.
FreedomBox in Debian
ispmail
Debian Stable

Words, as is well known, are the great foes of reality. Joseph Conrad.
Kedaha's Conjecture
User avatar
kedaha
 
Posts: 3017
Joined: 2008-05-24 12:26


Return to Beginners Questions

Who is online

Users browsing this forum: silas2 and 14 guests

fashionable