I want to install texlive-full in my Ubuntu 20.04. It is a rather large download, and I have a metered internet connection.
I installed it in another computer running Xubuntu 20.04, and copied the packages from its var/cache/apt.
I can do sudo dpkg -i *.deb, but it will install all the dependencies explicitly (I don't want to have the dependencies explicitly installed), and it may also install other unwanted packages (because I copied all .deb packages from var/cache/apt).
How can I use apt to install texlive-full, so that it uses these .deb packages for dependencies instead of downloading them?
1 Answer
To create a personal repository
Install dpkg-dev, type in a terminal
sudo apt-get update sudo apt-get install dpkg-devCreate the Script to update your packages directory
It's a simple three liner:
#! /bin/bash cd /var/cache/apt dpkg-scanpackages . /dev/null | gzip -9c > Packages.gzCut and paste the above into gedit, and save it as update-debs in /bin.
Next, make the script executable:
sudo chmod u+x /bin/update-debsHow the script works:
dpkg-scanpackages looks at all the packages in /var/cache/apt, and the output is compressed and written to a file Packages.gz, that apt-get update can read
Edited: =========================================================
Create a Ubuntu configuration file for the repository
sudo touch /etc/apt/sources.list.d/mysources.listEdit the empty file and add this line:
sudo nano /etc/apt/sources.list.d/mysources.listAnd add this line:
deb [trusted=yes] file:/var/cache/apt ./And you're done.
Whenever you put a new deb in the /var/cache/apt directory, run
sudo update-debs
sudo apt-get updateNow your local packages can be manipulated with Synaptic, aptitude and the apt commands: apt-get, apt-cache, etc.
2