Need to change repository?

Hi all,

I got tons of errors during my apt-get update informing me that the repository is currently not available.

Can happen, but after 3 days same message I started to think about to change the repository to a closer / new one.

So I looked around my /etc/apt/sources.list and searched for a way to modify all old repository entries and replace it with the new one.

sed did the trick for me to be honest

sed -i 's/' /etc/apt/sources.list

– and I wonder why I do not use it more oft 😉


Repository location for downloaded / installed packages

Today I played a bit with apt-get and got some strange failed to fetch error messages. Nothing wrong with but I searched a bit and did recognize I do not know where the downloaded packages are located.

  • The location is here:
  • If you want to remove them, perform
    # apt-get clean
  • output from man apt-get show:
    clean clears out the local repository of retrieved package files. It removes everything but the lock file from /var/cache/apt/archives/ and /var/cache/apt/archives/partial/. When APT is used as a dselect(1) method, clean is run automatically. Those who do not use dselect will likely want to run apt-get clean from time to time to free up disk space.
    Like clean, autoclean clears out the local repository of retrieved package files. The difference is that it only removes package files that can no longer be downloaded, and are largely useless. This allows a cache to be maintained over a long period without it growing out of control. The configuration option APT::Clean-Installed will prevent installed packages from being erased if it is set to off.

As always – have Fun!

Paketlisten erzeugen/restaurieren

… kann manchmal ganz schön wichtig werden. Denken wir nur mal an das Thema Backup und Restore.

Also erster Schritt, Paketliste erzeugen:

dpkg --get-selections | awk '!/deinstall|purge|hold/ {print $1}' > /your/path-to/packages.list

Dies hilft insbesondere wenn man nach einer Neuinstallation die gleichen Pakete wieder installieren will 😉

Wer schlau ist packt /your/path-to/ mit ins Backup rein, bzw läßt vor jedem Backup den obigen Befehl laufen.

Packetliste zu Restorezwecken einsetzen

Um alle in der erzeugten /your/path-to/packages.list gespeicherten Pakete zu installieren, bzw. als einen der ersten “restore-Schritte” hilft uns:
# xargs -a "packages.list" sudo apt-get instal
extrem gut.