Installing a package manually using apt-get
You can do this in two separate steps:
Install the package with
dpkg
.sudo dpkg -i packagename.deb
That created missing dependencies.
apt-get
can fix missing dependencies automatically.sudo apt-get -f install
That should also automatically finish configuring the original package. (So you will not likely need to run
sudo dpkg --configure -a
yourself.)
Why apt-get
Won't Do This
apt-get
checks your configured software sources (repositories) and automatically downloads and installs packages. Except in the case where a configured repository is inaccessible, this does not enable an apt-get install
command to succeed that would not otherwise succeed. If the package isn't in one of your repositories, apt-get
will not know to install it even if the .deb file happens to be in /var/cache/apt/archives
.
Related videos on Youtube
AhmedWas
Updated on September 18, 2022Comments
-
AhmedWas over 1 year
I'm trying to install a deb package offline using
apt-get
command. From what I understand, I can download a package manually from the internet. Put it in the local repository folder (which is usually/var/cache/apt/archives
). Then update the repository usingapt-get update
. And finallyapt-get install myPackage
I tried these steps, but I keep getting the error
Unable to locate package uex_15.1.0.8_amd64
. What am I missing? or should I useapt-offline
? If so, how?BTW, the package
uex_15.1.0.8_amd64
is the package to install UltraEdit.-
Alen Milakovic about 8 yearsYour approach doesn't work.
apt
doesn't know the deb file is in the cache if you do it that way. Please give a specific example of what you are trying to do. And yes, I think you can useapt-offline
, assuming you haveapt
configured correctly. -
Rahul about 8 yearsCould you please post content of
/etc/apt/sources.list
file ? -
AhmedWas about 8 yearsWhat do you mean by a specific example? I specified everything in the question. But again the steps in more details. 1- Download the file 2- Save the file to
/var/cache/apt/archives
3- runsudo apt-get update
4- runsudo apt-get install uex_15.1.0.8_amd64
-
fkraiem about 8 yearsWhy not install with
dpkg -i
? -
Alen Milakovic about 8 yearsWhat package are you trying to install?
uex
isn't in Debian. Are you trying to use a third-party repository? What is the output ofapt-cache policy
? -
Alen Milakovic about 8 years@fkraiem That would only work if there are no additional dependencies which need to be installed.
-
fkraiem about 8 years@FaheemMitha Dependencies can be installed manually beforehand.
-
Alen Milakovic about 8 years@fkraiem Certainly, if you know what they are. I think this is what
apt-offline
is designed to automate. -
fkraiem about 8 years@FaheemMitha
dpkg
tells you what they are when you try to install the package. -
fkraiem about 8 years@FaheemMitha It seems that
apt-offline
is mostly designed to manage a system which is completely offline, especially regarding upgrades, not really for installing a single package. -
Alen Milakovic about 8 years@fkraiem Yes,
apt-offline
is. But it isn't clear from the poster's question whether his system is offline or not. If it isn't, why doesn't he just useapt
directly?
-