2

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?

3
  • There is a similar question, whose answer really does not help (it also has a dead link). askubuntu.com/q/80128/124466 Nov 23, 2020 at 13:51
  • Just use regular sudo apt-get update && sudo apt-get upgrade. It should not download already existing packages, unless newer versions are available. Nov 23, 2020 at 13:55
  • @mikewhatever This used to work in older versions of Ubuntu. In recent versions, it tried to redownload an existing package Nov 30, 2020 at 16:36

1 Answer 1

4

To create a personal repository

Install dpkg-dev, type in a terminal

 sudo apt-get update
 sudo apt-get install dpkg-dev

Create 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.gz

Cut 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-debs

How 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.list

Edit the empty file and add this line:

sudo nano /etc/apt/sources.list.d/mysources.list

And 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 update

Now your local packages can be manipulated with Synaptic, aptitude and the apt commands: apt-get, apt-cache, etc.

2
  • I get this after running sudo apt update. E: The repository 'file:/var/cache/apt ./ Release' does not have a Release file. N: Updating from such a repository can't be done securely, and is therefore disabled by default. N: See apt-secure(8) manpage for repository creation and user configuration details. Nov 30, 2020 at 16:34
  • @Archisman Panigrahi: Edit the post, read the edit.
    – kyodake
    Dec 1, 2020 at 1:13

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .