Langsung ke konten utama

Jurnal Linuxku: Mengubah file sources.list

Hello, guys! Kali ini, saya akan membahas tentang cara mengubah file sources.list. Ini merupakan lanjutan dari post kemarin, yaitu tentang repository Ubuntu. Sebenarnya ini adalah tulisan yang sudah umum, bahkan bisa juga dicari di blog/website lain. Kali ini akan saya jelaskan untuk Ubuntu.

Pertama, kita perlu mengenai lokasi dari file sources.list, yaitu pada direktori:

/etc/apt/sources.list

Berhubung lokasinya ada pada direktori sistem, maka untuk mengubahnya perlu masuk dalam mode super user. Untuk melakukan hal ini, kita perlu membuka terminal dan membukanya dalam mode super user. Ada dua buah cara untuk melakukannya, pertama cara bertahap; kedua secara langsung. Maksudnya cara bertahap adalah kita login sebagai super user, lalu mengeditnya. Sedangkan secara langsung, ya langsung. Supaya cepat, umumnya pengeditan secara langsung. Pengeditan ini menggunakan teks editor, terserah mau pakai teks editor apa. Saya akan menggunakan vim yang setahu saya, vim belum terinstall otomatis dalam Ubuntu biasa. Jadi, perlu diinstall dahulu.

Cara untuk menginstall vim adalah dengan terhubung ke Internet dan membuka terminal. Selanjutnya ketikkan perintah ini:

sudo apt install vim

Tekan enter dan tunggu hingga installasi selesai. Setelah itu, ketik perintah:

sudo vim /etc/apt/sources.list

Sehingga muncul seperti pada gambar berikut ini.

Gambar tersebut merupakan daftar repository saya, yang sudah diedit. Meski demikian, ada hal yang perlu dipahami secara ringkas. Pada gambar terdapat tanda pagar. Itu menunjukkan bahwa baris itu tidak dibaca oleh sistem, karena tanda pagar menunjukkan bahwa baris itu merupakan komentar. Ini standar dalam bash. yah.., mungkin akan saya bahas di kesempatan lain.

Untuk file asli, kurang lebih seperti ini:

# deb cdrom:[Lubuntu 18.04.4 LTS _Bionic Beaver_ - Release amd64 (20200203)]/ bionic main multiverse restricted universe

# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
deb http://id.archive.ubuntu.com/ubuntu/ bionic main restricted
# deb-src http://id.archive.ubuntu.com/ubuntu/ bionic main restricted

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

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team. Also, please note that software in universe WILL NOT receive any
## review or updates from the Ubuntu security team.
deb http://id.archive.ubuntu.com/ubuntu/ bionic universe
# deb-src http://id.archive.ubuntu.com/ubuntu/ bionic universe
deb http://id.archive.ubuntu.com/ubuntu/ bionic-updates universe
# deb-src http://id.archive.ubuntu.com/ubuntu/ bionic-updates universe

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu 
## team, and may not be under a free licence. Please satisfy yourself as to 
## your rights to use the software. Also, please note that software in 
## multiverse WILL NOT receive any review or updates from the Ubuntu
## security team.
deb http://id.archive.ubuntu.com/ubuntu/ bionic multiverse
# deb-src http://id.archive.ubuntu.com/ubuntu/ bionic multiverse
deb http://id.archive.ubuntu.com/ubuntu/ bionic-updates multiverse
# deb-src http://id.archive.ubuntu.com/ubuntu/ bionic-updates multiverse

## N.B. software from this repository may not have been tested as
## extensively as that contained in the main release, although it includes
## newer versions of some applications which may provide useful features.
## Also, please note that software in backports WILL NOT receive any review
## or updates from the Ubuntu security team.
deb http://id.archive.ubuntu.com/ubuntu/ bionic-backports main restricted universe multiverse
# deb-src http://id.archive.ubuntu.com/ubuntu/ bionic-backports main restricted universe multiverse

## Uncomment the following two lines to add software from Canonical's
## 'partner' repository.
## This software is not part of Ubuntu, but is offered by Canonical and the
## respective vendors as a service to Ubuntu users.
# deb http://archive.canonical.com/ubuntu bionic partner
# deb-src http://archive.canonical.com/ubuntu bionic partner

deb http://security.ubuntu.com/ubuntu bionic-security main restricted
# deb-src http://security.ubuntu.com/ubuntu bionic-security main restricted
deb http://security.ubuntu.com/ubuntu bionic-security universe
# deb-src http://security.ubuntu.com/ubuntu bionic-security universe
deb http://security.ubuntu.com/ubuntu bionic-security multiverse
# deb-src http://security.ubuntu.com/ubuntu bionic-security multiverse

Cara paling mudah untuk mengubah repository ini adalah dengan menambahkan tanda pagar di depan "deb", lalu copy salah satu dari repository yang ada dalam halaman ini. Oh.., iya silakan juga sesuaikan dengan nama kode dari ubuntu yang kamu pakai. Kebetulan, dalam halaman itu menggunakan Impish Indri. Kalau kamu menggunakan Bionic Beaver, maka tinggal mengganti kata impish dengan kata bionic. Sehingga file sources.list berubah menjadi:

# deb cdrom:[Lubuntu 18.04.4 LTS _Bionic Beaver_ - Release amd64 (20200203)]/ bionic main multiverse restricted universe

deb http://buaya.klas.or.id/ubuntu/ bionic main restricted universe multiverse
deb http://buaya.klas.or.id/ubuntu/ bionic-updates main restricted universe multiverse
deb http://buaya.klas.or.id/ubuntu/ bionic-backports main restricted universe multiverse
deb http://buaya.klas.or.id/ubuntu/ bionic-security main restricted universe multiverse

# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
#deb http://id.archive.ubuntu.com/ubuntu/ bionic main restricted
# deb-src http://id.archive.ubuntu.com/ubuntu/ bionic main restricted

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

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team. Also, please note that software in universe WILL NOT receive any
## review or updates from the Ubuntu security team.
#deb http://id.archive.ubuntu.com/ubuntu/ bionic universe
# deb-src http://id.archive.ubuntu.com/ubuntu/ bionic universe
#deb http://id.archive.ubuntu.com/ubuntu/ bionic-updates universe
# deb-src http://id.archive.ubuntu.com/ubuntu/ bionic-updates universe

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu 
## team, and may not be under a free licence. Please satisfy yourself as to 
## your rights to use the software. Also, please note that software in 
## multiverse WILL NOT receive any review or updates from the Ubuntu
## security team.
#deb http://id.archive.ubuntu.com/ubuntu/ bionic multiverse
# deb-src http://id.archive.ubuntu.com/ubuntu/ bionic multiverse
#deb http://id.archive.ubuntu.com/ubuntu/ bionic-updates multiverse
# deb-src http://id.archive.ubuntu.com/ubuntu/ bionic-updates multiverse

## N.B. software from this repository may not have been tested as
## extensively as that contained in the main release, although it includes
## newer versions of some applications which may provide useful features.
## Also, please note that software in backports WILL NOT receive any review
## or updates from the Ubuntu security team.
#deb http://id.archive.ubuntu.com/ubuntu/ bionic-backports main restricted universe multiverse
# deb-src http://id.archive.ubuntu.com/ubuntu/ bionic-backports main restricted universe multiverse

## Uncomment the following two lines to add software from Canonical's
## 'partner' repository.
## This software is not part of Ubuntu, but is offered by Canonical and the
## respective vendors as a service to Ubuntu users.
# deb http://archive.canonical.com/ubuntu bionic partner
# deb-src http://archive.canonical.com/ubuntu bionic partner

#deb http://security.ubuntu.com/ubuntu bionic-security main restricted
# deb-src http://security.ubuntu.com/ubuntu bionic-security main restricted
#deb http://security.ubuntu.com/ubuntu bionic-security universe
# deb-src http://security.ubuntu.com/ubuntu bionic-security universe
#deb http://security.ubuntu.com/ubuntu bionic-security multiverse
# deb-src http://security.ubuntu.com/ubuntu bionic-security multiverse

Begitu, teman-teman. Selanjutnya disimpan dan keluar dari vim. Kita perlu mengupdate dan upgrade-nya. Ketikan pada terminal:

sudo apt update && sudo apt upgrade

Jika ada upgrade, akan ada pilihan ya atau tidak. Jawab dengan mengetikkan pada terminal y. Selesai.

Komentar

Posting Komentar