Sometimes I want to install a program when offline. But apt-get
downloads as you install.
Is there a way to install a program, like you would install a .exe
, on Ubuntu?
Sometimes I want to install a program when offline. But apt-get
downloads as you install.
Is there a way to install a program, like you would install a .exe
, on Ubuntu?
You can use:
apt-get install -d
To download software and dependencies without installing them. The .deb files (pretty much equivalent to Windows .exe installers), are then downloaded to /var/cache/apt/archives/
Unless you've issued apt-get clean
pretty much anything you've ever installed via apt-get should have the .deb files stored there.
Also you can install the .deb files via dpgk -i
but you have to remember to install the dependencies (and their dependencies and so on), first. Or you should also just be able to double click a .deb file in your file browser and Software Center should take care of it for you.
For example: I want to install gedit
(which is included with Ubuntu normally so it won't download tons of dependency .deb files). But I have a system that, for whatever reason, doesn't have gedit and has no internet connect.
So first, on a computer connected to the internet, I run apt-get install --reinstall -d gedit
(because if you try running apt-get install -d gedit
on a system with gedit already installed to the latest version it just tells you it is already installed), which then goes through the normal process of downloading the package (in this case there are no dependencies), and then stops.
Then I locate the file under /var/cache/apt/archives/
...
... and move it to the computer which needs gedit installed and install it, in this case using the Software Center.
Or I could install it using cd /var/cache/apt/archives
and dpkg -i gedit_3.10.4-0ubuntu4_amd64.deb
nginx
and nginx-common
and nginx-core
or similar as examples if my system needed an offline method to install the NGINX web server. Essentially, it's impossible to create 'one example' that would work everywhere. The tricky part is because of dependencies - a lot of 'regularly used' Desktop programs have a lot of dependencies that you would also have to download.