Guide to Change Ubuntu Repository to Local Indonesian Server (22.04 & 24.04)
Why Use Local Repositories?
Using local Indonesian server repositories offers several advantages:
- Faster download speeds
- Reduces international bandwidth usage
- Supports local IT infrastructure
- More stable access without relying on international connections
Steps to Change Ubuntu Repository
1. Backup Default Repository
Before making changes, it’s recommended to backup your sources.list file:
sudo cp /etc/apt/sources.list /etc/apt/sources.list.backup
2. Edit Sources.List File
Open the sources.list file with your favorite text editor:
sudo nano /etc/apt/sources.list
3. Replace with Local Indonesian Repository
Comment out or remove all existing lines, then replace with the local repository. Here’s the configuration for AwanData’s local repository:
For Ubuntu 22.04 LTS (Jammy Jellyfish):
deb http://mr.awandata.co.id/ubuntu/ jammy main restricted universe multiverse
deb http://mr.awandata.co.id/ubuntu/ jammy-updates main restricted universe multiverse
deb http://mr.awandata.co.id/ubuntu/ jammy-backports main restricted universe multiverse
deb http://mr.awandata.co.id/ubuntu/ jammy-security main restricted universe multiverse
For Ubuntu 24.04 LTS (Noble Numbat):
deb http://mr.awandata.co.id/ubuntu/ noble main restricted universe multiverse
deb http://mr.awandata.co.id/ubuntu/ noble-updates main restricted universe multiverse
deb http://mr.awandata.co.id/ubuntu/ noble-backports main restricted universe multiverse
deb http://mr.awandata.co.id/ubuntu/ noble-security main restricted universe multiverse
4. Update Package List
After making changes, update the package list:
sudo apt update
5. Upgrade System (Optional)
If you want to upgrade your system to the latest version:
sudo apt upgrade
Alternative Method: Using sed Command
You can also use the sed command to quickly replace repositories:
For Ubuntu 22.04:
sudo sed -i 's|http://.*.ubuntu.com|http://mr.awandata.co.id/ubuntu|g' /etc/apt/sources.list
sudo sed -i 's|http://archive.ubuntu.com|http://mr.awandata.co.id/ubuntu|g' /etc/apt/sources.list
sudo sed -i 's|http://security.ubuntu.com|http://mr.awandata.co.id/ubuntu|g' /etc/apt/sources.list
For Ubuntu 24.04:
sudo sed -i 's|http://.*.ubuntu.com|http://mr.awandata.co.id/ubuntu|g' /etc/apt/sources.list
sudo sed -i 's|http://archive.ubuntu.com|http://mr.awandata.co.id/ubuntu|g' /etc/apt/sources.list
Check Your Ubuntu Version
If you’re unsure about your Ubuntu version, run:
lsb_release -a
Additional Tips
- Always verify connection to the repository server after making changes
- If you encounter issues, you can revert to default repositories using the backup file:
sudo cp /etc/apt/sources.list.backup /etc/apt/sources.list
sudo apt update
- Test the repository speed with:
sudo apt update
Alternative Local Repositories in Indonesia
If AwanData repository is unavailable, you can also use:
- Kambing UI: http://kambing.ui.ac.id/ubuntu/
- UGM Repository: http://repo.ugm.ac.id/ubuntu/
Troubleshooting
If you get errors after changing repositories:
- Check your internet connection
- Verify the repository URL is correct
- Ensure you’re using the right codename for your Ubuntu version
- Check if the local repository server is operational
Conclusion
By changing your Ubuntu repository to a local Indonesian server like AwanData’s, you not only get better download speeds but also contribute to the development of local IT infrastructure. This guide works for both Ubuntu 22.04 LTS (Jammy Jellyfish) and the latest Ubuntu 24.04 LTS (Noble Numbat).
