I have two Ubuntu system and they are exactly the same.
I execute several apt-get install XXX on one system and I can get the relative deb packages at /var/cache/apt/archives/. Then I copy these deb files to the other system at /home/me/archives/ and execute apt-get install ./*.deb.
I thought it should install the deb packages locally but to my surprise, it still redownload all deb files. I don't know why.
There are three things weird:
When I execute
apt-get install ./*.deb, lots of messages show up:Note, selecting 'python-rospkg' instead of './python-rospkg_1.1.4-100_all.deb' Note, selecting 'python-serial' instead of './python-serial_3.0.1-1_all.deb' Note, selecting 'python-service-identity' instead of './python-service-identity_16.0.0-2_all.deb' Note, selecting 'python-setuptools' instead of './python-setuptools_20.7.0-1_all.deb' Note, selecting 'python-sip-dev' instead of './python-sip-dev_4.17+dfsg-1build1_amd64.deb' Note, selecting 'python-sip' instead of './python-sip_4.17+dfsg-1build1_amd64.deb' Note, selecting 'python-six' instead of './python-six_1.10.0-3_all.deb'I try to install one of the deb packages, for example,
apt-get install libwebp-dev_0.4.4-1_amd64.deb, but I always get the error:Reading package lists... Done Building dependency tree Reading state information... Done E: Unable to locate package libwebp-dev_0.4.4-1_amd64.deb E: Couldn't find any package by glob 'libwebp-dev_0.4.4-1_amd64.deb' E: Couldn't find any package by regex 'libwebp-dev_0.4.4-1_amd64.deb'I've also tried to use
dpkg -i *.debto install these local deb packages, but it produced the error about missing some packages, then I executedapt install -fto get the missing deb package from the Internet, but the missing packages coming from the Internet and the original local packages are exactly the same...
In a word, my system cannot install local deb packages as expected.
92 Answers
"apt-get" command cannot be used like you want. You may install with it only from repositories. But the correct way is to use "dpkg" or "apt" commands:
sudo dpkg -i package_name.debor
sudo apt install package_name.debUsing the dpkg may broke the package dependencies, which do not resolve it automatically so you can use apt-get to resolve the issue:
sudo apt-get install -f 4 This problem comes here:
I executed several apt install XXX, which are about python module, such as python-numpy etc. I thought it would depend on python2.7 so python2.7 would be downloaded and installed automatically but I was wrong (maybe it's because python3.5 has been installed by default? I don't know exactly the reason). Meaning that I should execute one more command: apt install python2.7. Otherwise, apt install ./*deb will redownload all of packages again. Also, I don't know why but dpkg -i *.deb && apt install -f didn't install python2.7.
Anyway, after installing python2.7 and put its deb package with other packages together, I can install all of them locally with the command apt install ./*.deb.