Refreshing Software Cache Stalls

I get an error when checking for updates. I’m told I need to refresh the software cache, when I do…it Freezes/Stalls. I can’t do anything but reboot.

I recall you are using:

Are you using the GUI or the command line to refresh the cache? I’d advise to run:

# apt-get update

from the terminal, and share the output with us, we may get a hit or two about this issue. Make sure you save all your work before doing so, in case another reboot will be necessary.

Try this
sudo apt-get clean ; sudo apt-get remove ; sudo apt-get autoremove ; sudo apt-get update
The first two commands do some cleaning;

I believe that worked. Thank You

I’m certain you guys forgot more than I know…Kudos

None of these work for me, ubuntu 20.04

sudo apt-get clean ; sudo apt-get check ; sudo apt -f install

The first command (clean) cleans the package manager’s cached data, the second (check) check’s such cache’s integrity after its cleanup and also checks for broken package dependencies, and the third one (-f install) attempts to install pending packages while attempting to fix dependencies that are broken among them.

If this doesn’t work, try this:

sudo apt-get dist-upgrade -y ; sudo apt-get autoremove -y

If it still doesn’t work, more contextualization is necessary, i.e. paste here the output (e.g. error) message(s) that you received when you executed the 2 commands above. The output of sudo apt update may be helpful, too.

2 Likes
  Hit:1 (link)

Hit:2 (link)
Ign:3 (link)
Hit:4 (link)
Err:5 (link)
404 Not Found [IP: 199.232.46.217 443]
Ign:6 (link)
Hit:7 (link)
Hit:8 (link)
Get:9 (link)
Ign:10 (link)
Hit:11 (link)
Get:12 (link)
Ign:13 (link)
Err:14 (link)
404 Not Found [IP: 91.189.95.85 80]
Err:15 (link)
404 Not Found [IP: 91.189.95.85 80]
Err:16 (link)
404 Not Found [IP: 91.189.95.85 80]
Hit:17 (link) hirsute-proposed InRelease
Reading package lists… Done
E: The repository (link) 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.
E: The repository (link) 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.
E: The repository ‘(link)’ 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.
E: The repository (link) hirsute 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.

this is output of sudo apt update. any help?
note: im using ubuntu 21.04.
i cant put the link in there so i change it to (link)

1 Like

Hi Agrieby_Chaniago,

Welcome to our forums.

Is this system a fresh install, or you where able to update it before?

Thank you so much ive been banging my head for days trying to figure this out 995 packages that needed updating !

1 Like

@Black_Phase No prob. Glad it worked. :nerd_face: :+1:

@Agrieby_Chaniago Clearly a problem with your sources.list file located at /etc/apt

The most pragmatic way to deal with it is to open a shell terminal window and then run this command in order to rename your original sources.list file to sources.list.bak (where “bak” means “backup”):

cd /etc/apt ; sudo mv sources.list sources.list.bak

Next, install Gnome Edit:

sudo apt install gedit -y

…and then use Gnome Edit to create a new empty sources.list file:

sudo gedit sources.list

A new Gnome Edit window will popup. Select and then copy (Ctrl C) this code:

#Default repos for Ubuntu 21.04

# Major bug fix updates produced after the final release of the distribution.
deb http://us.archive.ubuntu.com/ubuntu/ hirsute-updates main restricted
deb-src http://us.archive.ubuntu.com/ubuntu/ hirsute-updates main restricted

# These "universe" packages are useful but not supported (neither updated) by the Ubuntu security team.
deb http://us.archive.ubuntu.com/ubuntu/ hirsute universe
deb-src http://us.archive.ubuntu.com/ubuntu/ hirsute universe
deb http://us.archive.ubuntu.com/ubuntu/ hirsute-updates universe
deb-src http://us.archive.ubuntu.com/ubuntu/ hirsute-updates universe

# These "multiverse" packages are useful but not supported (neither updated) by the Ubuntu security team, and some are not free.
deb http://us.archive.ubuntu.com/ubuntu/ hirsute multiverse
deb-src http://us.archive.ubuntu.com/ubuntu/ hirsute multiverse
deb http://us.archive.ubuntu.com/ubuntu/ hirsute-updates multiverse
deb-src http://us.archive.ubuntu.com/ubuntu/ hirsute-updates multiverse

# These "restricted" packages are useful and some provide more up-to-date functionalities, but they're not supported (neither updated) by the Ubuntu security team.
deb http://us.archive.ubuntu.com/ubuntu/ hirsute-backports main restricted universe multiverse
deb-src http://us.archive.ubuntu.com/ubuntu/ hirsute-backports main restricted universe multiverse

# Canonical's 'partner' repository.
deb http://archive.canonical.com/ubuntu hirsute partner
deb-src http://archive.canonical.com/ubuntu hirsute partner

# Security packages and updates for the universe, multiverse and restricted packages.
deb http://security.ubuntu.com/ubuntu hirsute-security main restricted
deb-src http://security.ubuntu.com/ubuntu hirsute-security main restricted
deb http://security.ubuntu.com/ubuntu hirsute-security universe
deb-src http://security.ubuntu.com/ubuntu hirsute-security universe
deb http://security.ubuntu.com/ubuntu hirsute-security multiverse
deb-src http://security.ubuntu.com/ubuntu hirsute-security multiverse

Next, return to the open Gnome Edit window, paste (Ctrl V) the copied code above, then save the file (Ctrl S) and then exit (i.e. close) Gnome Edit.

Now you need to tell APT to clean its cache and then read this new sources.list file in order to know where to look for (new) repositories and their hosted packages. Hence, run this command:

sudo apt clean ; sudo apt update

If you don’t get any errors, the problem is fixed. This new sources.list file in /etc/apt is read by APT and its info is used by APT to look for packages in repos hosted in the United States. If you’re outside of the US, you can use Gnome Edit to edit the same sources.list file again but then replace us.archive.ubuntu.com (where us means United States) with br.archive.ubuntu.com (where br means Brazil), or fr.archive.ubuntu.com (where fr means France), or it.archive.ubuntu.com (where it means Italy), or ru.archive.ubuntu.com (where ru means Russia), and so on.

I do have the same problem. I tried this but it didn’t work out for me. I am new to ubuntu and have just installed it. Can you suggest something else to try?

OS: Ubuntu 20.04.4 LTS

Hi. :wave:t2: Let’s first try to solve this through the GUI by installing Synaptic (a frontend i.e. graphical interface for the APT package manager) and Xapian (a search database that eases the search for packages inside of Synaptic). Just run this installation command at the shell terminal:

sudo apt install synaptic apt-xapian-index -y ; sudo update-apt-xapian-index

Once Synaptic and Xapian are installed, run Synaptic from the Applications menu (it’s going to ask you to provide your password) or straight from the shell terminal by either issuing the command pkexec synaptic or the command sudo synaptic and then, at the Synaptic screen, click on the Reload button, wait for the reload process to end and then click on the Mark All Upgrades button. Once this process is also finished, click on the Apply button and wait for it to end.

If either the Synaptic installation fails or Synaptic does install but fails to solve this issue for you, please paste here the output of these three commands:

sudo apt update

…and:

cat /etc/apt/sources.list

…and:

grep -iR . /etc/apt/sources.list.d/

…so I can see [1] what exact error(s) APT is showing to you and [2] what the configuration files of your .deb package repositories are “programmed” to do.