Installing Tools

In GNU/Linux, you can download and install a software by one command (which may be difficult to do in Windows). This is achieved by the package manager. Different GNU/Linux distribution has different package manager. In Debian, the package manager is called apt.

You will download and install some tools needed for the PAs from the network mirrors. Before using the network mirrors, you should check whether the system can access the Internet.

Checking network state

Inside NJU, you should easily obtain an IPv6 address. To test this, try to ping a mirror host with IPv6 support:

ping -c 4

You should receive reply packets successfully:

PING (2402:f000:1:408:8100::1)) 56 data bytes
64 bytes from 2402:f000:1:408:8100::1 (2402:f000:1:408:8100::1): icmp_seq=1 ttl=54 time=1.56 ms
64 bytes from 2402:f000:1:408:8100::1 (2402:f000:1:408:8100::1): icmp_seq=2 ttl=54 time=1.07 ms
64 bytes from 2402:f000:1:408:8100::1 (2402:f000:1:408:8100::1): icmp_seq=3 ttl=54 time=1.07 ms
64 bytes from 2402:f000:1:408:8100::1 (2402:f000:1:408:8100::1): icmp_seq=4 ttl=54 time=1.24 ms

--- ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 7ms
rtt min/avg/max/mdev = 1.071/1.237/1.563/0.203 ms

If you do not have an IPv6 address, you may access the Internet by IPv4 address. You can try to ping a host outside the university LAN:

ping -c 4

If you can ping Baidu successfully, you should successfully ping the mirror host above, too.

Setting APT source file

Run the following commands to update the APT source file:

echo "deb stable main" > /etc/apt/sources.list

However, you will receive an error message:

bash: /etc/apt/sources.list: Permission denied

This is because the APT source file is owned by root, and you do not have the permission to modify it.

One solution is first switching to the root account. But to avoid switching, an alternative way is to use sudo. If you find an operation requires superuser permission, append sudo before that operation. First, you should add your account to the sudo group:

su -   # we still need to switch to the root account first
adduser username sudo  # change `username` to your user name

To let the changes to take effect, you should log out or reboot. After that, try

sudo whoami

If it is the first time you run sudo, enter the password of your account. You should find that sudo whoami will output root.

Now you can use sudo to modify the APT source file. This time you should modify it successfully. To check this, you can output the file:

cat /etc/apt/sources.list

You should see it really outputs the line you just echoed.

Updating APT package information

Now you can tell apt to retrieve software information from the sources:

apt-get update

However, you will receive an error message:

E: Could not open lock file /var/lib/apt/lists/lock - open (13: Permission denied)
E: Unable to lock directory /var/lib/apt/lists/

This is because apt-get requires superuser privilege to run. Run the command with superuser privilege. Since it requires Internet accessing, it may cost some time to finish.

Installing tools for PAs

The following tools are necessary for PAs:

apt-get install build-essential    # build-essential packages, include binary utilities, gcc, make, and so on
apt-get install man                # on-line reference manual
apt-get install gdb                # GNU debugger
apt-get install git                # reversion control system
apt-get install libreadline-dev    # a library to use compile the project later
apt-get install libsdl2-dev        # a library to use compile the project later
apt-get install libc6-dev-i386     # a library to use compile the project later
apt-get install qemu-system        # QEMU

The usage of these tools is explained later.

Installing Chinese input method

搜狗输入法 for Linux is a Chinese input method for GNU/Linux. Refer to this page to install it.

results matching ""

    No results matching ""