Linux from entry to soil

Open a topic here to record the commands commonly used in Linux.


Continually updated……


Common Functions

Install deb software

dpkg -i +文件名

Other usages of dpkg: The
following are some common usages of Dpkg:
1. dpkg -i <package.deb>
installs a Debian package, such as a file you downloaded manually.
2. dpkg -c <package.deb>
lists the contents of <package.deb>.
3. dpkg -I <package.deb>
extracts package information from <package.deb>.
4. dpkg -r
removes an installed package.
5. dpkg -P
completely removes an installed package. Unlike remove, remove only deletes data and executable files, while purge also deletes all configuration files.
6. dpkg -L
lists all files installed. Also please see dpkg -c to check the contents of a .deb file.
7. dpkg -s
displays information about installed packages. Also see apt-cache to display package information in Debian archives, and dpkg -I to display package information extracted from a .deb file.
8. dpkg-reconfigure reconfigures
an installed package if it uses debconf (debconf provides a unified configuration interface for package installation).

cmake install library to the specified location

cmake -DCMAKE_INSTALL_PREFIX=/usr/include/

Compression and decompression

ar
unpacking: tar zxvf filename.tar
packing: tar czvf filename.tar dirname

gz command
decompression 1: gunzip filename.gz
decompression 2: gzip -d filename.gz
compression: gzip filename
.tar.gz and .tgz
decompression: tar zxvf filename.tar.gz
compression: tar zcvf filename.tar.gz dirname
compression more Files: tar zcvf filename.tar.gz dirname1 dirname2 dirname3...

bz2 command
Decompression 1: bzip2 -d filename.bz2
decompression 2: bunzip2 filename.bz2
compression: bzip2 -z filename

.tar.bz2
decompression: tar jxvf filename.tar.bz2
compression: tar jcvf filename.tar.bz2 dirname

bz command
decompression 1: bzip2 -d filename.bz
decompression 2:
bunzip2 filename.bz .tar.bz
decompression: tar jxvf filename.tar.bz

z command
decompression: uncompress filename. z
compression: compress filename

.tar.z
decompression: tar zxvf filename.tar.z
compression: tar zcvf filename.tar.z dirname

zip command
Unzip: unzip filename.zip
Compress: zip filename.zip dirname

Common mistakes

"Please use apt-cdrom..." error

请使用 apt-cdrom,通过它可以让 APT 识别该盘片。apt-get upgdate 不能被用来加入新的盘片。

Enter System Settings -> Software and Updates -> Other Software -> Uncheck the first cdrom: [Ubuntu 16.04.6 LTS_Xenia Xerus_-Release amd64(20190227)]/ xenial main restricted

Reference: https://blog.csdn.net/weixin_39198406/article/details/79669048

"NO_PUBKEY The following signature cannot be verified because there is no public key" error

Open the terminal and enter

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 76F1A20FF987672F

Replace 76F1A20FF987672F with the missing key

Reference: https://blog.csdn.net/weixin_44172434/article/details/89160720

But I got an error

gpg --keyserver subkeys.pgp.net --recv 55BE302B 
gpg: 下载密钥‘55BE302B’,从 hkp 服务器 subkeys.pgp.net 
gpg: 公钥服务器超时 
gpg: 从公钥服务器接收失败:公钥服务器错误 

Solution: Go online scientifically
Insert picture description here


I have encountered many network problems recently... If you encounter problems in the future, consider the network problems first

Unable to download http://ppa.launchpad.net/…… 404NotFound

Unable to download ubuntu16.04 http://ppa.launchpad.net/pyside/ppa/ubuntu/dists/xenial/main/binary-amd64/Packages
Solution: remove the related files

d /etc/apt/sources.list.d
mv pyside-ubuntu-ppa-xenial.list pyside-ubuntu-ppa-xenial.list.bak

Change this pyside-ubuntu-ppa-xenial.list to the one you reported wrong, and
then try again

sudo apt-get update

Guess you like

Origin blog.csdn.net/weixin_44456692/article/details/106440549