aidave
January 20th, 2009, 06:41 PM
Create an Offline Repository
Sometimes you have a machine without internet, and to get that internet, you need to build a driver, and to do that, need to upgrade to the latest patches or kernel. This is a quick-n-dirty way to do that.
To build a repository onto a USB stick. Use your main Linux computer first.
sudo apt-get install debmirror
Get the key for the repo.
gpg --no-default-keyring --keyring /home/.../trustedkeys.gpg --import /usr/share/keyrings/ubuntu-archive-keyring.gpg
Download the repository. This can take many hours and will be ~7.5 GB of downloads.
sudo debmirror -a i386 --no-source -s main -h cc.archive.ubuntu.com -d hardy,hardy-updates,hardy-security -r /ubuntu --progress -e http mirror
Copy the repository onto USB:
sudo cp -R mirror /media/usb/mirror
Now move that stick to the offline computer.
sudo mkdir /media/usbrepo
sudo mount /media/usbrepo /dev/sdx
sudo cp /etc/apt/sources.list /etc/apt/sources.list.backup
sudo vim /etc/apt/sources.list
Replace all the contents of "/etc/apt/sources.list" with just this:
deb file:///media/usbrepo/mirror hardy main
deb file:///media/usbrepo/mirror hardy-updates main
deb file:///media/usbrepo/mirror hardy-security main
You should now have an up-to-date offline repository:
sudo apt-get update
Upgrade to the latest versions:
sudo apt-get upgrade
Sometimes you have a machine without internet, and to get that internet, you need to build a driver, and to do that, need to upgrade to the latest patches or kernel. This is a quick-n-dirty way to do that.
To build a repository onto a USB stick. Use your main Linux computer first.
sudo apt-get install debmirror
Get the key for the repo.
gpg --no-default-keyring --keyring /home/.../trustedkeys.gpg --import /usr/share/keyrings/ubuntu-archive-keyring.gpg
Download the repository. This can take many hours and will be ~7.5 GB of downloads.
sudo debmirror -a i386 --no-source -s main -h cc.archive.ubuntu.com -d hardy,hardy-updates,hardy-security -r /ubuntu --progress -e http mirror
Copy the repository onto USB:
sudo cp -R mirror /media/usb/mirror
Now move that stick to the offline computer.
sudo mkdir /media/usbrepo
sudo mount /media/usbrepo /dev/sdx
sudo cp /etc/apt/sources.list /etc/apt/sources.list.backup
sudo vim /etc/apt/sources.list
Replace all the contents of "/etc/apt/sources.list" with just this:
deb file:///media/usbrepo/mirror hardy main
deb file:///media/usbrepo/mirror hardy-updates main
deb file:///media/usbrepo/mirror hardy-security main
You should now have an up-to-date offline repository:
sudo apt-get update
Upgrade to the latest versions:
sudo apt-get upgrade