Newly installed Linux system

Set password for root

sudo passwd root enter
 Set password of root user (use root account)

Install yum

sudo apt-get update
sudo apt install yum

Use domestic source address in Linux system (Ubuntu)

  • Source address list file path

    The path of the source list configuration file of ubuntu system is / etc/apt/ sources.list

In order to leave a backup before replacement, you can execute the command to make a backup:

cp /etc/apt/sources.list /etc/apt/sources.list-bak

  • Replacement of source address list file

    For different versions, the URLs in sources.list are different, mainly because the versions are different. For example, the code of Ubuntu 14.04 is trust, while Ubuntu 16.04 is xenial.

The specific view method is to execute the command: LSB [release - a enter

The returned Codename is the version code

As shown in the picture:


img_fd955c496dcae4b16c7040f2e9d946ee.png
image.png

Ubuntu version 14.04

Replace the contents of / etc/apt/ sources.list with:

deb http://mirrors.aliyun.com/ubuntu/ trusty main multiverse restricted universe

deb http://mirrors.aliyun.com/ubuntu/ trusty-backports main multiverse restricted universe

deb http://mirrors.aliyun.com/ubuntu/ trusty-proposed main multiverse restricted universe

deb http://mirrors.aliyun.com/ubuntu/ trusty-security main multiverse restricted universe

deb http://mirrors.aliyun.com/ubuntu/ trusty-updates main multiverse restricted universe

deb-src http://mirrors.aliyun.com/ubuntu/ trusty main multiverse restricted universe

deb-src http://mirrors.aliyun.com/ubuntu/ trusty-backports main multiverse restricted universe

deb-src http://mirrors.aliyun.com/ubuntu/ trusty-proposed main multiverse restricted universe

deb-src http://mirrors.aliyun.com/ubuntu/ trusty-security main multiverse restricted universe

deb-src http://mirrors.aliyun.com/ubuntu/ trusty-updates main multiverse restricted universe

Execute the command after replacement: sudo apt get update

Ubuntu version 16.04

Replace the contents of / etc/apt/ sources.list with:

deb  http://mirrors.aliyun.com/ubuntu/ xenial main multiverse restricted universe

deb  http://mirrors.aliyun.com/ubuntu/ xenial-backports main multiverse restricted universe

deb  http://mirrors.aliyun.com/ubuntu/ xenial-proposed main multiverse restricted universe

deb http://mirrors.aliyun.com/ubuntu/ xenial-security main multiverse restricted universe

deb http://mirrors.aliyun.com/ubuntu/ xenial-updates main multiverse restricted universe

deb-src http://mirrors.aliyun.com/ubuntu/ xenial main multiverse restricted universe

deb-src http://mirrors.aliyun.com/ubuntu/ xenial-backports main multiverse restricted universe

deb-src http://mirrors.aliyun.com/ubuntu/ xenial-proposed main multiverse restricted universe

deb-src http://mirrors.aliyun.com/ubuntu/ xenial-security main multiverse restricted universe

deb-src http://mirrors.aliyun.com/ubuntu/ xenial-updates main multiverse restricted universe

Execute the command after replacement: sudo apt get update

Apt get: package has no installation candidate

apt-get update
apt-get upgrade
apt-get install <packagename>
  • Add third party address:
sudo add-apt-repository "deb http://archive.canonical.com/ lucid partner"
sudo apt-get update

Keywords: Linux Ubuntu sudo yum

Added by glossary on Mon, 09 Dec 2019 09:09:09 +0200