임베디드 시스템을 개바하다보면, 칩셋 제조사로부터 제공하는 BSP이미지를 이용하기 위해서 특정 라이브러리 및 유틸리티를 설치해야 한다. 설치하는 과정에서 상위버전의 필수요소가 발생하게되면, 일반적으로 현재 사용하는 관련 유틸리티를 삭제하고 소스를 받아 컴파일 하거나, 상위버전 저장소를 열어 특정 패키지를 설치하는 등의 과정을 거치게 된다. 

     

      문제는 그럼에도 불구하고 동일한 오류메시지가 출력이 된다면, 해당 패키지 외에 추가적으로 요구되는 연관(의존성) 문제가 발생할 수 있다. 아쉽게도 모든 경우의 의존성을 맞추다 보면, 새로 설치하고 데이터를 이전하는 것 보다 더 많은 시간이 소요되는 경우과 발생된다. 필자도 오늘 그런 상황에 놓였다. 

     

      그래서 우분투를 업그레이드 하는 것으로 진행해보고 안되면 새로 설치하던지 뭐... 

    1. 우분투 업그레이드
    1.1. 패키지 업데이트
    (1) 패키지 업데이트 설치

    $ sudo apt update && sudo apt upgrade && sudo apt dist-upgrade


    (2) 업데이트 완료 후 재부팅

    $ sudo reboot now


    (3) 더이상 필요하지 않은 패키지 삭제

    $ sudo apt autoremove && sudo apt clean



    1.2. 업데이터 매니저
    (1) 업데이트 매니저 설치
      업데이트 매지저가 설치 되지 않은경우 설치한다. 만약 설치되어있더라도 아래의 설치명령을 입력한다. 어차피 설치가 이미 된 경우라면 설치없이 설치되었다는 확인만 해주고 넘어갈테니까...

    $ sudo apt install update-manager-core

     
    (2) 업데이트 매니저 설정

      업데이트 매니저에서는 어떤 버전으로 설치할지를 결정한다. prompt에 설치할 버전을 넣어주면 되겠다. 

    $ sudo nano /etc/update-manager/release-upgrades

     

    출력된 내용에서 Prompt=lts로 변경 

    Default behavior for the release upgrader.
    [DEFAULT]
    # Default prompting behavior, valid options:
    #
    #  never  - Never check for, or allow upgrading to, a new release.
    #  normal - Check to see if a new release is available.  If more than one new
    #           release is found, the release upgrader will attempt to upgrade to
    #           the supported release that immediately succeeds the
    #           currently-running release.
    #  lts    - Check to see if a new LTS release is available.  The upgrader
    #           will attempt to upgrade to the first LTS release available after
    #           the currently-running one.  Note that if this option is used and
    #           the currently-running release is not itself an LTS release the
    #           upgrader will assume prompt was meant to be normal.
    Prompt=lts


    1.3. 우분투 릴리즈 업데이트
      설정이 완료되었다면, 업데이트를 진행한다. 아래와 같이 명령을 입력하여 업데이트를 해주도록 하자. ssh에 대한 협박이 출력될 수 있다. 가능하면 호스트 PC에서 직접하는 것을 추천한다. 

     

    (1) 업데이트

    $ sudo do-release-upgrade -d
    Checking for a new Ubuntu release
    Get:1 Upgrade tool signature [1554 B]                                                                    
    Get:2 Upgrade tool [1333 kB]                                                                             
    Fetched 1334 kB in 6s (203 kB/s)                                                                         
    authenticate 'focal.tar.gz' against 'focal.tar.gz.gpg' 
    extracting 'focal.tar.gz'
    Reading cache
    Checking package manager
    Continue running under SSH? 
    This session appears to be running under ssh. It is not recommended 
    to perform a upgrade over ssh currently because in case of failure it 
    is harder to recover. 
    If you continue, an additional ssh daemon will be started at port 
    '1022'. 
    Do you want to continue? 
    Continue [yN] y


      
    (2) SSH 경고(방화벽)
      SSH를 이용하여 터미널을 사용하는 상태에서 업그레이드를 수행행하다가 오류 또는 터미널의 종료로인해
    업그레이드 중 문제가 발생되면 복구가 어려운 상태가 되므로 SSH를 통한 업그레이드를 권장하지 않는다는
    메시지가 표시된다. 가능하면 호스트의 화면을 통해 직접 작업을 진행하는 것이 좋다. 만약 그대로 진행
    한던중 문제가 발생되면 1022번 포트를 통해 ssh로 재접속이 가능하다.

    Continue [yN] y
    Starting additional sshd 
    To make recovery in case of failure easier, an additional sshd will 
    be started on port '1022'. If anything goes wrong with the running 
    ssh you can still connect to the additional one. 
    If you run a firewall, you may need to temporarily open this port. As 
    this is potentially dangerous it's not done automatically. You can 
    open the port with e.g.: 
    'iptables -I INPUT -p tcp --dport 1022 -j ACCEPT' 
    To continue please press [ENTER]


    (3) 보안관련 설정

      설치되는 중간에  패키지 디펜던시 관련 메시지가 출력된다. 서드파티 저장소 정보를 비활성한다고 한다. 필요한경우 다시 re-enable하라는 메시지다. 우선 계속진행하자.

    Reading package lists... Done
    Building dependency tree        
    Reading state information... Done
    Hit http://ap-northeast-2.ec2.archive.ubuntu.com/ubuntu bionic InRelease                                 
    Get:1 http://ap-northeast-2.ec2.archive.ubuntu.com/ubuntu bionic-updates InRelease [88.7 kB]             
    Get:2 http://ap-northeast-2.ec2.archive.ubuntu.com/ubuntu bionic-backports InRelease [74.6 kB]           
    Get:3 http://security.ubuntu.com/ubuntu bionic-security InRelease [88.7 kB]                              
    Hit http://ppa.launchpad.net/wireguard/wireguard/ubuntu bionic InRelease                                 
    Fetched 252 kB in 0s (0 B/s)                                                                             
    Reading package lists... Done    
    Building dependency tree          
    Reading state information... Done
    Updating repository information
    Third party sources disabled 
    Some third party entries in your sources.list were disabled. You can 
    re-enable them after the upgrade with the 'software-properties' tool 
    or your package manager. 
    To continue please press [ENTER]


    (4) 업그레이드 시작 확인
      계속 진행하던중 업그레이드를 시작할 건지 다시 물어본다. 

    Do you want to start the upgrade?
    18 installed packages are no longer supported by Canonical. You can
    still get support from the community.
    14 packages are going to be removed. 172 new packages are going to be
    installed. 651 packages are going to be upgraded.
    You have to download a total of 407 M. This download will take about
    51 minutes with a 1Mbit DSL connection and about 15 hours with a 56k
    modem.
    Fetching and installing the upgrade can take several hours. Once the
    download has finished, the process cannot be canceled.
    Continue [yN]  Details [d] y

     


     업그레이드 도중 설정 화면이 나타날 수 있다. 기존에 사용하던 패키지등의 업데이트에 따른 변경
    혹은 설정값에 대한 부분에 대해서 변경할 것인지 유지할 것인지를 설정하게 된다. 사용자마다 추가하여
    설치하고 있는 패키지가 모두 다르기 때문에, 표시되는 메시지는 당연히 달라질 수 밖에 없으니, 긴장하지
    말고 적당한 설정값을 생각해서 지정하면 된다. 

    (5) 패키지 삭제
      설치가 종료되고 사용하지 않는 패키지의 처리와 관련된 메시지가 출력된다. 기존 업데이트후 예전 패키지들은
    삭제하는것이 유익할 것으로 보이니, 시간이 걸리더라도 삭제를 진행한다. 

    Reading state information... Done
    Remove obsolete packages?
    263 packages are going to be removed.
    Removing the packages can take several hours.

     Continue [yN]  Details [d]y
    Fetched 0 B in 0s (0 B/s)
    (Reading database ... 356884 files and directories currently installed.)
    Removing command-not-found-data (18.04.5) ...

     

    (6) 작업종료

      모든 작업이 종료되면 완료 메시지가 표시된다. y를 눌러서 리부팅 하자.

    please see the FAQ <https://wiki.debian.org/Teams/Dpkg/FAQ>
    (Reading database ... 277976 files and directories currently installed.)
    Purging configuration files for qemu-system-common (1:4.2-3ubuntu6.16) ...
    Purging configuration files for python3.6-venv (3.6.9-1~18.04ubuntu1.4) ...
    Purging configuration files for qemu-system-gui:amd64 (1:4.2-3ubuntu6.16) ...
    Purging configuration files for qemu-system-x86 (1:4.2-3ubuntu6.16) ...
    Purging configuration files for libssl1.0.0:amd64 (1.0.2n-1ubuntu5.6) ...
    Purging configuration files for ureadahead (0.100.0-21) ...
    Purging configuration files for libc6-x32 (2.31-0ubuntu9.2) ...
    Purging configuration files for libpython3.6-minimal:amd64 (3.6.9-1~18.04ubuntu1.4) ...
    Purging configuration files for libqtcore4:amd64 (4:4.8.7+dfsg-7ubuntu1) ...
    Purging configuration files for python3.6-minimal (3.6.9-1~18.04ubuntu1.4) ...
    Purging configuration files for qemu-block-extra:amd64 (1:4.2-3ubuntu6.16) ...

    System upgrade is complete.

    Restart required

    To finish the upgrade, a restart is required.
    If you select 'y' the system will be restarted.

    Continue [yN] y

     

    y를 눌러서 호스트 시스템을 재시작 한다. 
     

    3. 업그레이드 확인

      uname -r을 이용하여 커널 버전 살며시 확인해주고, lsb_release 명령을 이용하여 시스템 버전을 확인해주자.

    compiler:~$ uname -r
    5.4.0-73-generic
    shhong@shhong-compiler:~$ lsb_release -a
    No LSB modules are available.
    Distributor ID: Ubuntu
    Description:    Ubuntu 20.04.2 LTS
    Release:        20.04
    Codename:       focal
    compiler:~$

     

    # 우분투 18.04에서 20.04 업그레이드.... 끝.

    반응형
    • 네이버 블러그 공유하기
    • 네이버 밴드에 공유하기
    • 페이스북 공유하기
    • 카카오스토리 공유하기