Installing Packages on Debian computers without Internet connection

I have an old computer at home on which I have installed Debian. I don’t have Internet connection at home and it sometimes happens that I have to upgrade or newly install a package. I tried taking the packages that i have already downloaded on my office computer (from /var/cache/apt/archive) but this didn’t work. So i searched the Internet and found some answers. Here i will list step-by-step that method which worked perfectly for me (Google found so many for me :))

1. Do an apt-get update on the computer with internet connection. This updates the files in /var/lib/apt/lists/.
2. Take the files in /var/lib/apt/lists/ to the home computer and load it there at the same place.
3. Now do a “apt-get -qq –print-uris install name-of-package | cut -d\’ -f 2 > urilist” on the home computer where name-of-package is of course the name of the package to be installed or upgraded. If you want to do a dist-upgrade, type dist-upgrade instead of package name. This will create a file named urilist containing the url to all the packages that needs to be downloaded.
4. Take the urilist to the office computer and do a “wget with wget -i urilist”. This will download all the needed package.
5. Take downloaded deb files to your home computer and load them in /var/cache/apt/archives/ . Also copy the /etc/apt/sources.list file from your office computer to your home computer.
6. Lastly do “apt-get install package-name”.

Hope this little manual is helpful to you.. 🙂


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s