Category: apt

Xubuntu: how to create a local repository

I had the necessity to create a local repository in order to handle the upgrade of local packages, as if they were from official repositories.
Create your own repository folder

sudo su
mkdir /usr/local/packages

Create and edit the script file which will upgrade the packages’ list every time we add a new one

# open each .deb file and create a zipped list file
CMD="dpkg-scanpackages $DIR | gzip > $DIR/Packages.gz"

eval $CMD
chmod +x

Update /etc/apt/source.list with the new location

echo "deb file:/usr/local packages" >> /etc/apt/source.list

Copy your packages into the folder and run the script


Now you can install/remove/manage your local packages using command line or through Synaptic

How to fix apt-get “Encountered a section with no Package: header”

Surprisingly I got a strange error while running:

sudo apt-get check
Reading package lists... Error!
E: Encountered a section with no Package: header
E: Problem with MergeList /var/lib/apt/lists/it.archive.ubuntu.com_ubuntu_dists_quantal_main_i18n_Translation-en%5fUS
E: The package lists or status file could not be parsed or opened.

To fix it:

rm -vf /var/lib/apt/lists/*

Tested successfully on my Xubuntu 12.10

WordPress Themes