Today's article is a simple exercise involving installing .deb files in the terminal...

KGIII

Super Moderator
Staff member
Gold Supporter
Joined
Jul 23, 2020
Messages
11,839
Reaction score
10,415
Credits
97,923
So, I've kind of covered this with another post, but I didn't cover the dpkg method. For some sort of sense of completeness, I decided I'd revisit the topic and cover it again, this time just through the terminal and without going into things like Gdebi.

It's pretty straightforward and easy enough for anyone to understand.


The gist is, just use apt instead... I can't really think of any benefits offered by dpkg for this particular task. If you can think of any, please let me know.
 


To add my own two cents, I would like to point out, that Debian, or Linux in general isn't like windows. While microsoft's OS is a slob that leaves junk on your hard drive everywhere (I almost had a stroke the last time I inspected the win temp folder), Linux does a pretty good job of cleaning up after itself. And once you do tell it to clean - it WILL clean.

I am saying this because it concerns those to whom this guide is addressed to - the "switched over" boys, and you will probably ask about doing it. ;) I know why you had the propensity to change the location of your install folder - a desperate attempt to maintain some semblance of order in a bloated, messy operating system.

But in Linux, there is no reason (which could be carried over from the windows mentality) not to install on the default directory... unless you're running out of hard drive space.
 
I know why you had the propensity to change the location of your install folder - a desperate attempt to maintain some semblance of order in a bloated, messy operating system.

Me? Oh, no... No, I'm far too lazy for that sort of crap. In modernity, I have enough disk space for everything I could realistically want. All the important stuff is saved to a NAS and that gets backed up automatically. Everything else can be downloaded again, even with my paltry bandwidth.
 
Also, all I can think of is that you might have misread the article. It's got nothing to do with that.
 
Also, all I can think of is that you might have misread the article. It's got nothing to do with that.
Oh I read your article, its about installing a .deb package using the terminal and/or even extracting the contents of the package to see what's inside. Here is why it pertains to your article:

Speaking from personal experience, when a "convert" (lol), learns how to install stuff in Linux, the next thing he/she will probably want to know is where it is going to install, and how to change that install location in an effort to maintain order in his/her operating system. And while it may not be directly related to your sermon (hehehe lol), I was being a bit ahead of the curve and explaining the... "lack of necessity" for it to anyone who might wondering on just how to do that.
 
the next thing he/she will probably want to know is where it is going to install, and how to change that install location in an effort to maintain order in his/her operating system.

If you insist, though that's a pretty rare question these days. Some gamers still like to do that, where they'll install their game on an HDD while their OS is on an SDD. I suppose it makes limited sense in that contact.

There's a removed comment which I can see and they're correct. While I gave the right information, I probably should have elaborated.
 
Also, I now kinda want to try writing an article as though I'm a Southern Baptist preacher giving a sermon.

(I am not a Southern Baptist preacher.)
 
Also, I now kinda want to try writing an article as though I'm a Southern Baptist preacher giving a sermon.

(I am not a Southern Baptist preacher.)
Reverend KGIII... has a nice ring to it!:p
 
Reverend KGIII... has a nice ring to it!:p

That's right, brothers and sisters, we're going to open the terminal. Just press that CTRL + ALT + T and let me get a hallelujah! That terminal should pop right open!

Let me hear that again! Hallelujah!

It's easy to use sudo. Just enter the command with sudo at the front and it works! Let me get an amen, brothers and sisters in Linux. Let me get an emphatic amen! Let me get an amen like you mean it!

As an aside, the comedian Sam Kinison was a preacher before he was a comedian. And, pretty much none of his material is appropriate here. So, I will not be linking to any of his work.
 
Since KGIII menitoned the removed post in post #6, here it is with very minor amendment.

There's an interesting case with the local installation of .deb files which happens on this installation of debian trixie and on the other debian machines here. Since there's a bit of such local installing happening here, it may be of interest to others.

The difference is that apt needs ./ prepended to install a downloaded .deb file from the computer's filesystem if the full pathname is not provided in the apt install command. If ./ is not prepended, apt will look for the named file through the repositories which have been configured in the sources.list. Below is an example, using simulation, with a downloaded .deb file which appears in the debian repositories named: cowsay_3.03+dfsg2-8_all.deb, and a .deb file which is not in the debian repository named: add2_0.1-1_amd64.deb.

The finding here is that without the prepended ./, and without the full pathname provided, apt cannot find the .deb file which is present in the directory of the computer's filesystem, because it's searching the debian repos.

Code:
[flip@flop ~]$ ls
add2_0.1-1_amd64.deb

[flip@flop ~]$ apt -s install add2_0.1-1_amd64.deb
NOTE: This is only a simulation!
      apt needs root privileges for real execution.
      Keep also in mind that locking is deactivated,
      so don't depend on the relevance to the real current situation!
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
E: Unable to locate package add2_0.1-1_amd64.deb

With the prepended ./, the .deb file will install:

Code:
[flip@flop ~]$ apt -s install ./add2_0.1-1_amd64.deb
NOTE: This is only a simulation!
      apt needs root privileges for real execution.
      Keep also in mind that locking is deactivated,
      so don't depend on the relevance to the real current situation!
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Note, selecting 'add2' instead of './add2_0.1-1_amd64.deb'
<snip>
The following NEW packages will be installed:
  add2
0 upgraded, 1 newly installed, 0 to remove and 1 not upgraded.
Inst add2 (0.1 local-deb [amd64])
Conf add2 (0.1 local-deb [amd64])

In the case of the file which already exists in the debian repositories, the same prepending is necessary on the machines here to install the .deb file which is in a directory on the filesystem of the computer.

Code:
[flip@flop ~]ls
cowsay_3.03+dfsg2-8_all.deb

[flip@flop ~]$ apt -s install cowsay_3.03+dfsg2-8_all.deb
NOTE: This is only a simulation!
      apt needs root privileges for real execution.
      Keep also in mind that locking is deactivated,
      so don't depend on the relevance to the real current situation!
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
E: Unable to locate package cowsay_3.03+dfsg2-8_all.deb

apt can't locate the package because it's looking for it in the repo, and in the repo it's called: cowsay, without the appended versioning.

With the prepended ./, apt will install it:

Code:
[flip@flop ~]$ apt -s install ./cowsay_3.03+dfsg2-8_all.deb
NOTE: This is only a simulation!
      apt needs root privileges for real execution.
      Keep also in mind that locking is deactivated,
      so don't depend on the relevance to the real current situation!
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Note, selecting 'cowsay' instead of './cowsay_3.03+dfsg2-8_all.deb'
<snip>
Suggested packages:
  filters cowsay-off
The following NEW packages will be installed:
  cowsay
0 upgraded, 1 newly installed, 0 to remove and 1 not upgraded.
Inst cowsay (3.03+dfsg2-8 Debian:testing, local-deb [all])
Conf cowsay (3.03+dfsg2-8 Debian:testing, local-deb [all])

This matter of installation is all moot if the full pathname is provided, as described in the article since that works as intended and expected.

Code:
[flip@flop ~]$ apt -s install /home/flip/cowsay_3.03+dfsg2-8_all.deb
NOTE: This is only a simulation!
      apt needs root privileges for real execution.
      Keep also in mind that locking is deactivated,
      so don't depend on the relevance to the real current situation!
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Note, selecting 'cowsay' instead of '/home/flip/cowsay_3.03+dfsg2-8_all.deb'
<snip>
Suggested packages:
  filters cowsay-off
The following NEW packages will be installed:
  cowsay
0 upgraded, 1 newly installed, 0 to remove and 5 not upgraded.
Inst cowsay (3.03+dfsg2-8 Debian:testing, local-deb [all])
Conf cowsay (3.03+dfsg2-8 Debian:testing, local-deb [all])
 
Last edited:
I actually used your article to install the Debian Sid microcode .deb file on one of my baby NUCs for the latest Intel bug.
It went off without a hitch, TYVM
 
The difference is that apt needs ./ prepended to install a downloaded .deb file from the computer's filesystem if the full pathname is not provided in the apt install command.

Yup. That's why I had the /path/to/file thing in there but I didn't elaborate and say why and I probably should mention that, as well as the ability to both use ./ and ~/path/to/file like ~/Downloads/foo.deb for example.

Your post was a worthy addition, so I remarked on it. Yes, yes I can see your deleted posts. I intentionally don't reference them, but this seemed like a good time to do so. I can also see your edits. I generally consider this sort of information private and don't normally check it (unless there's a report).

I do sometimes check on my own.

I need to figure out a concise way to amend the article. You can also always just leave a comment there.
 
I actually used your article to install the Debian Sid microcode .deb file on one of my baby NUCs for the latest Intel bug.

Also, I reference my own articles all the time. By that, I mean I'll want to do something and I know I've written about it so I just check my site and follow my own instructions. It's especially handy when I've done a fresh install and not everything is configured to my liking.
 
And, just a quick thanks to @osprey - I've gone ahead and made an edit, effectively adding a note to the text. It was the most effective way I could think of to do so.
 

Members online


Latest posts

Top