Before I continue let me disclaim:
If your professor is using apt
, then she is using a debian-based system. I recommend using the same distro instead of your own "from-scratch" system. If you and using a from-scratch system because you want a custom kernel, then you can install that kernel a debian-based system.
If you do use apt
, you'll end up downloading packages from somewhere. Where do you want that to be? Ubuntu's archive? Debian's archive? Elementary's archive? You'll also need to know which version of things to download. Debian stretch
has many incompatibilities with Debian buster
and Ubuntu bionic
. When you use apt
to install packages, you'll run into dependency problems if you're not installing all software from the same version of the same distro. Therefore, if you're installing everything from a distro anyways, just start with that distro and replace the kernel if that's something you're trying to do.
On a debian-based system, Everything is tracked by dpkg
, including dpkg
itself and and very low-level dependencies. Most things depend on libc
and you probably already have it installed. That will cause a conflict as it was installed without dpkg
, dpkg
can't know that it exists on your system and can't verify the version of libc
you have is compatible with the package you are trying to install.
I think the simplest way is to download the dpkg
binary package (dpkg_<version>_<arch>.deb
) for your architecture and unzip it manually. Certainly get that working before you make any attempt with apt
.
If you're using a debian-based host, you can apt download dpkg
, otherwise, go get the binaries from the archive directly.
You'll need to manually perform on dpkg*.deb
what dpkg
normally does (the only maintainer script for dpkg
is postrm
so that's not going to be relevant).
- Download
dpkg_<version>_<arch>.deb
- Extract contents with
ar -x *.deb
- Extract
control.tar.xz
with tar -xf
- Inspect the
control
file and check that all dependencies are installed
- Extract
data.tar.xz
to /
After that, you should be able to dpkg -i *.deb
on any deb
package you install assuming you first install its dependencies installed with dpkg
.
The general advice is: If you want to use dpkg
or apt
, use a distribution that comes with it. There are too many things that can go wrong if you don't.
dpkg
is a super fundamental package. I think @Newbyte is simply worried that you'll get it installed, but getting it working well is a different beast. You'll likely end up with packages that conflict with manually-installed files in your system and that goes down a rabbit hole that is too obscure to support. – Stewart Oct 15 '20 at 08:49