Introduction: When dealing with Ubuntu on Arm64 servers, sometimes you may need to reset or fix your repository sources to ensure that you can properly update and install packages. This guide will walk you through the steps to fix the repositories on an Ubuntu Arm64 server by editing the sources.list
file.
Step-by-Step Tutorial
Step 1: Open the sources.list
File
First, you need to open the sources.list
file in a text editor with superuser privileges. This file contains the list of repositories that your system uses to download updates and new software packages.
Open a terminal and type the following command:
sudo nano /etc/apt/sources.list
This command opens the sources.list
file using the nano
text editor with superuser privileges.
Step 2: Clear the Existing Content
Once the sources.list
file is open, you will see the current list of repositories. Delete everything in the file. You can do this by holding down the Ctrl
key and pressing K
repeatedly until all lines are removed.
Step 3: Add the New Repository URLs
Next, you will add the following lines to the sources.list
file. These lines specify the repositories for the Arm64 architecture on Ubuntu focal (20.04) with various components:
deb [arch=arm64] http://ports.ubuntu.com/ focal main multiverse universe
deb [arch=arm64] http://ports.ubuntu.com/ focal-security main multiverse universe
deb [arch=arm64] http://ports.ubuntu.com/ focal-backports main multiverse universe
deb [arch=arm64] http://ports.ubuntu.com/ focal-updates main multiverse universe
Copy and paste these lines into the sources.list
file.
Step 4: Save and Exit the Text Editor
After adding the new repository URLs, save the changes and exit the text editor. In nano
, you can do this by pressing Ctrl + X
, then Y
to confirm saving the changes, and finally Enter
to write the changes to the file and exit.
Step 5: Update the Package List
Now that the sources.list
file has been updated with the correct repositories, you need to update your package list to reflect these changes. Run the following command in the terminal:
sudo apt-get update
This command fetches the latest package lists from the repositories specified in your sources.list
file.
Conclusion
By following these steps, you have successfully fixed the repositories on your Ubuntu Arm64 server. Your system should now be able to update and install packages from the correct sources. If you encounter any issues, ensure that the URLs and syntax in the sources.list
file are correct.