I use Ubuntu 12.04 at my home and have good internet connection and my system works fine.
One of my friend is having small office and he is thinking to switch from Windows to Ubuntu 11.10 or above. The problem is that he does not have an Internet connection.
He ask me that is there any possibilities to install all updates without having Internet. I make many search, I found this question that says using Keryx or Synaptic Manager will do that.
But I am using 11.04 and there is no Synaptic manager in that so that I generate and download script.In other way when I try to install keryx (on any fresh install system on which I have to fetch the updates or system having Internet connection)
Its shows me error that I am not having python.But I am having that
Installing these application doesn't meet dependencies. The key point here is
- How I Install updates without having internet on fresh install Ubuntu.
- How I install
ubuntu-restricted-extras
Best Answer
As far as I know, you can't download updates for a Oneiric (11.10) system using Ubuntu Natty (11.04). You must have a working Ubuntu 11.10 system.
An sketch about the process we are following:
1. Getting a working Oneiric system
There are two ways to have a working Oneiric system.
By Doing an actual installation
You have to install Ubuntu Oneiric (11.10) on the computer with Internet connection. Though it is also possible from a live system running from USB or CD, I recommend installing. You can get help for installing Ubuntu from these links:
How do I install Ubuntu?
Help with Ubuntu installation.
Installing Oneiric in a VirtualBox Virtual Machine
To install VirtualBox in Ubuntu 11.04 Natty Narwhal, run these commands in a terminal:
Then install Oneiric in the virtual machine.
Set up a shared folder in the virtual machine.
You need to install VirtualBox Guest Additions to enable shared folder feature. Run this command in the virtual machine to install that:
If you need help enabling the shared folders feature in the VirtualBox, check this link:
2. Grab the .deb files required for updates
Please Note these specific points:
It is recommended not to update the virtual system during installation or afterwards before installing Synaptic. Cause, those updates might be deleted from cache and without those updates, you can't successfully generate package download script.
Don't run
sudo apt-get clean
orsudo apt-get autoclean
, because those commands removes .deb files from cache.Then boot to the Oneiric system that has an Internet connection (either from the installed system or in VirtualBox) and follow this procedure:
Install Synaptic Package Manager. Run these commands in a terminal for this: (Note, You must connect the virtual machine to the Internet, without Internet access the machine cannot update the package list)
You may also want to download the packages required for the
ubuntu-restricted-extras
package. To do so, Run this command additionally with the previous two commandsThis command will not install the packages, it only downloads them with all dependencies in
/var/cache/apt/archives
folder.Then open Synaptic Package Manager. Push the button Mark All Upgrades.

When asked if you want to Mark additional required chanages, press the Mark button.

Then going to File --> Generate package download script, save the script as a file. Let it be
update-downloader.sh
in a folder namedUpdates
. We assume theUpdates
folder is in your home directory, i.e., in/home/username
. Then close Synaptic.Now download the .deb files.
Go to the Updates folder, where you saved
update-downloader.sh
.While you are still in the Terminal and have
cd
'd to the Updates folder you created earlier, run this command:That copies the downloaded .deb files which are used for installing Synaptic Package Manager and the files downloaded for the
ubuntu-restricted-extras
package.Then run this command
sh ./update-downloader.sh
to download all the .deb files required to update in the current folder (i.e., in theUpdates
folder.Or
Alternatively, you can transfer the
Updates
folder with the few .deb files you just copied from/var/cache/apt/archives
with theupdate-downloader.sh
script in it to the host OS via VirtualBox's shared folder feature.Then in the host Ubuntu system, open a terminal and run the below command by going to the Updates folder you just copied from the guest OS using shared folder feature, where
update-downloader.sh
file resides:If you downloaded the .deb files in the virtual machine, in this step, transfer the Updates folder with those files using Virtual Box's shared folder feature. (This step is only required if you downloaded the files in virtual machine)
After you get the Updates folder with all .deb files in your host PC (i.e., in your Natty system) copy that folder with all files on a USB flash drive. You may also want to burn a DVD with those packages, though I am not recommending that.
Transfer the
Updates
folder using your USB drive (or CD/DVD, if you burned them) to your friend's PC.3. Use the .deb files to create a local repository
Copy the whole folder named
Updates
to the Internet-less computer. Put that folder in a directory. Let say, you have put the Updates folder in the home directory. Create a new directory in your home folder with nameoffline
, and move theUpdates
folder into theoffline
folder. Now, the directory structure looks like thisNow open a terminal and go to the
offline
folder. Once in theoffline
folder, run this command to generate the necessary package index file:It will create a file with name
Packages
.Now open
/etc/apt/sources.list
file with root power. In a terminal do thisThen press an Enter while your cursor is at the beginning of the file. This will create a new blank line at the top. Write this line as the first line in the file
Then save the file with Ctrl+S and exit gedit, the text editor.
Remember to use the exact folder / path names for the offline folder, and replace
username
with login name of the user.Also, if you are sure, your friend cannot use other repository sources, you may want to disable all other repositories by placing a
#
mark before each line in the/etc/apt/sources.list
file. (This is not actually required, but recommended).Note that it is generally required to put a local repository at the top of the file, to give it a higher preference then other repository sources. (But in this particular case, you might be able to get away with not doing this, since your friend can't even connect to the Internet to access any of the other configured repositories.)
4. Do the update without accessing the Internet!
Run
sudo apt-get update
in the terminal to make the package manager recognize your local update directory.Then do this command to upgrade the offline system:
Done! You have upgraded your system without Internet access.
Some Notes:
1. Don't want to write allow-unauthenticated option every time?
If you want to use this local repository to install packages time to time, but feel bored to always use that
allow-unauthenticated
option, do this.Create a file named
99mysettings
in/etc/apt/apt.conf.d
with gedit and add the line in that file and save.To open a file named 99mysettins in that directory with root power use this command in a terminal
2. Note about allow-unauthenticated option:
You might wonder why I have provided the
--allow-unauthenticated
option. This is used because your local update repository is not authentic to the system. But it will not harm, because you downloaded those packages from an authentic official Ubuntu repository.3. I want to have a trusted repository instead:
Check this awesome and epic post in Ubuntu forums about creating a trusted local repository. If you create a trusted repository, you don't have to provide
--allow-unauthenticated
option anymore.Recommendation: I would recommend you not to use PPA repositories, unless you really trust them. In particular, don't use experimental repositories, because they may introduce dependency problems in the system, which is often referred by Unix geek as dependency hell. This can be harder to fix when you do not have an Internet connection.