Tagged: apt-get
Changing Ubuntu Server Apt Source Repository
References
Abstract
Ubuntu Server, unlike the Ubuntu Desktop, has no GUI environment with fresh installation.
Backup
$ pwd /etc/apt $ ls -l ... sources.list ... $ sudo cp sources.list sources.list.bak $ ls -l ... source.list source.list.bak ... $
Check
Let’s take a look at the file.
$ pwd /etc/apt $ cat source.list ... deb-src http://slower.ubuntu.com/ubuntu/ trusty multiverse ... $
Update
Change all slower.ubuntu.com
to faster.ubuntu.com
.
$ pwd /etc/apt $ sudo vi source.list $ cat source.list ... deb-src http://faster.ubuntu.com/ubuntu/ trusty multiverse ... $
Note
Those domain addresses used in above example aren’t real. In my case I changed kr.archive.ubuntu.com
to ftp.daum.net
.
~/bin/up
우분투의 ~/.profile 파일의 내용을 보면 다음과 같이 로컬 bin 디렉토리에 대한 설정이 이미 되어 있는 것을 알 수 있다.
xxx@xxx:~$ cat ~/.profile ... # set PATH so it includes user's private bin if it exists if [ -d "$HOME/bin" ] ; then PATH="$HOME/bin:$PATH" fi xxx@xxx:~$
시스템 업데이트(업그레이드)를 할 수 있는 스크립트를 만들어보자.
xxx@xxx:~$ mkdir ~/bin xxx@xxx:~$ touch ~/bin/up xxx@xxx:~$ chmod +x ~/bin/up
~/bin/up 파일을 열어서 다음의 내용을 입력하자.
#!/bin/sh sudo apt-get -y update;sudo apt-get -y upgrade;sudo apt-get -y dist-upgrade;sudo apt-get -y autoremove;sudo apt-get -y autoclean;sudo apt-get -y clean
남보다 간이 조금 큰 편이다 싶으면 다음을 추가해도 무방하다.
sudo apt-get -y dist-update
Re-evaluate the profile.
xxx@xxx:~$ source ~/.profile
Now, you can update(upgrade) your system at any time.
xxx@xxx:~$ up ......................................