初学Ubuntu,各种坑,选择一些有难度或者有价值的新手常入的坑,持续更新中。。。
1.npm安装不成功,参照后面的网址
https://blog.csdn.net/libai13/article/details/108050539
注:其实在安装NODEJS时,npm应该是已经安装好了的,可以通过npm -version查看。之所以会出现存在依赖关系的问题,是因为版本不兼容,可以不用管它。
2.Bcompare安装失败的问题
第一步:sudo dpkg -i ***.deb
此时提示缺少依赖关系。
第二步:sudo apt --fix-broken install
第三步:再次执行 sudo dpkg -i ***.deb
第四步:终端输入bcompare,回车后启动bcompare
3.LuaJIT的版本问题
可以去官网去下载一个2.0.5版本的压缩包,然后解压缩到/tmp目录下,然后执行make install即可
https://luajit.org/download.html
4.创建SPX工程后,执行编译,提示:fatal error: openssl/evp.h: 没有那个文件或目录
【问题原因】
因为我要编译的程序会使用OpenSSL,但是我的Ubuntu库里没有需要和OpenSSL链接的文件,所以要自己安装相关的文件。
【解决方案】
在Ubuntu上安装OpenSSL,执行如下命令:
$ sudo apt-get install libssl-dev
5.在解决问题4以后,继续编译,依然存在问题。提示/npm/bash: grunt:未找到命令
【问题原因】缺少grunt包
【解决方案】
首先安装grunt:
npm install -g grunt-cli
然后确认版本:
grunt --version
此时提示grunt-cli v1.4.3
安装成功
###截止步骤5,可以编译成功,但依然存在一点问题###
1.JDK版本安装。目前M7依赖于openJDK是可以编译成功的,但是M5和M6的代码是不可以的,但是JDK8是完全没问题的,可以同时支持M5M6M7全系列,所以要安装JDK8。具体安装可以参考以下链接,此处不再赘述。
https://blog.csdn.net/weixx3/article/details/80296779
https://www.cnblogs.com/smiler/p/6939913.html
6.filezilla安装失败的问题
【问题描述】
filezilla软件一直没法安装,采用网上说的命令行安装时,提示404,即IP没法链接。一开始以为是公司网络禁止进入,用自己的手机热点进入如下网站http://cn.archive.ubuntu.com/ubuntu/pool/universe/,发现f文件夹也是进不去的,说明不是公司网络的问题。
然后采用下载deb文件的方式。首先是去官网下载,我的系统是U18.04的,官网的软件版本是3.57.0,下载安装时发现版本可能是不匹配,要求我安装glibc2.28?(好像是这个玩意),我再查,发现这玩意好像不是U18.04的啊。然后自己通过查找,发现3.28.0版本才是匹配该系统版本的,所以再去网上找这个版本的deb文件。费劲千辛万苦找到后安装,发现又是一堆package没有发现,果断又放弃。。
【问题原因】
具体原因根据解决的情况来看,应该是源的问题,更换一下源就好了
【解决方案】
按照下面博主的文章操作即可完成安装,
https://blog.csdn.net/qq_35451572/article/details/79516563
即分别执行:
【第一步】更新源为阿里源
首先备份已有的源:sudo cp /etc/apt/sources.list /etc/apt/sources_init.list
然后打开源文件:sudo gedit /etc/apt/sources.list
在后面复制以下内容:
deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
【第二步】apt-get update
【第三步】apt-get -f install filezilla
注:听说上面提到的这个网址就是ubuntu默认源下载apt的地方,所以自己无法安装filezilla也是很正常咯,毕竟那个f文件夹都打不开~
http://cn.archive.ubuntu.com/ubuntu/pool/universe/
下面贴一个讲源的链接,让我这个小白学习学习
https://blog.csdn.net/SAKURASANN/article/details/104257996
7.wps安装和输入汉字问题解决
安装wps:dpkg -i wps-office_11.1.0.10702_amd64.deb
输入汉字:
第一步:vim /usr/bin/wps
第二步:在第一行后面添加:
export XMODIFIERS="@im=ibus"
export QT_IM_MODULE="ibus"
第三步:以上为word,对于表格和PPT,修改以下文件,同样添加第二步中的语句:
8.ipmitool安装失败的问题
【问题描述】在执行ipmitool的make操作时,提示storage size of ‘ctx’ isn’t known
【问题解决】
可以参考以下这两个文章
https://blog.csdn.net/gusijin/article/details/116445417
https://blog.csdn.net/sanqima/article/details/98478975
即主要是把ctx改为一个指针,所以原程序中&ctx取址的都改为ctx。在new的时候,按照第二篇文章里的内容来改。
即对于ipmitool 1.8.18,将ipmitool-1.8.18/src/plugins/lanplus_crypt_impl.c文件中的内容替换为如下代码即可
/*
* Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* Redistribution of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* Redistribution in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* Neither the name of Sun Microsystems, Inc. or the names of
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* This software is provided "AS IS," without a warranty of any kind.
* ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
* INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
* PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED.
* SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE
* FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING
* OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL
* SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA,
* OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR
* PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
* LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
*/
#include "ipmitool/log.h"
#include "ipmitool/ipmi_constants.h"
#include "lanplus.h"
#include "lanplus_crypt_impl.h"
#include <openssl/hmac.h>
#include <openssl/evp.h>
#include <openssl/rand.h>
#include <openssl/err.h>
#include <assert.h>
/*
* lanplus_seed_prng
*
* Seed our PRNG with the specified number of bytes from /dev/random
*
* param bytes specifies the number of bytes to read from /dev/random
*
* returns 0 on success
* 1 on failure
*/
int lanplus_seed_prng(uint32_t bytes)
{
if (! RAND_load_file("/dev/urandom", bytes))
return 1;
else
return 0;
}
/*
* lanplus_rand
*
* Generate a random number of the specified size
*
* param num_bytes [in] is the size of the random number to be
* generated
* param buffer [out] is where we will place our random number
*
* return 0 on success
* 1 on failure
*/
int
lanplus_rand(uint8_t * buffer, uint32_t num_bytes)
{
#undef IPMI_LANPLUS_FAKE_RAND
#ifdef IPMI_LANPLUS_FAKE_RAND
/*
* This code exists so that we can easily find the generated random number
* in the hex dumps.
*/
int i;
for (i = 0; i < num_bytes; ++i)
buffer[i] = 0x70 | i;
return 0;
#else
return (! RAND_bytes(buffer, num_bytes));
#endif
}
/*
* lanplus_HMAC
*
* param mac specifies the algorithm to be used, currently SHA1, SHA256 and MD5
* are supported
* param key is the key used for HMAC generation
* param key_len is the lenght of key
* param d is the data to be MAC'd
* param n is the length of the data at d
* param md is the result of the HMAC algorithm
* param md_len is the length of md
*
* returns a pointer to md
*/
uint8_t *
lanplus_HMAC(uint8_t mac,
const void *key,
int key_len,
const uint8_t *d,
int n,
uint8_t *md,
uint32_t *md_len)
{
const EVP_MD *evp_md = NULL;
if ((mac == IPMI_AUTH_RAKP_HMAC_SHA1) ||
(mac == IPMI_INTEGRITY_HMAC_SHA1_96))
evp_md = EVP_sha1();
else if ((mac == IPMI_AUTH_RAKP_HMAC_MD5) ||
(mac == IPMI_INTEGRITY_HMAC_MD5_128))
evp_md = EVP_md5();
#ifdef HAVE_CRYPTO_SHA256
else if ((mac == IPMI_AUTH_RAKP_HMAC_SHA256) ||
(mac == IPMI_INTEGRITY_HMAC_SHA256_128))
evp_md = EVP_sha256();
#endif /* HAVE_CRYPTO_SHA256 */
else
{
lprintf(LOG_DEBUG, "Invalid mac type 0x%x in lanplus_HMAC\n", mac);
assert(0);
}
return HMAC(evp_md, key, key_len, d, n, md, (unsigned int *)md_len);
}
/*
* lanplus_encrypt_aes_cbc_128
*
* Encrypt with the AES CBC 128 algorithm
*
* param iv is the 16 byte initialization vector
* param key is the 16 byte key used by the AES algorithm
* param input is the data to be encrypted
* param input_length is the number of bytes to be encrypted. This MUST
* be a multiple of the block size, 16.
* param output is the encrypted output
* param bytes_written is the number of bytes written. This param is set
* to 0 on failure, or if 0 bytes were input.
*/
void
lanplus_encrypt_aes_cbc_128(const uint8_t * iv,
const uint8_t * key,
const uint8_t * input,
uint32_t input_length,
uint8_t * output,
uint32_t * bytes_written)
{
EVP_CIPHER_CTX *ctx;
ctx = EVP_CIPHER_CTX_new();
EVP_CIPHER_CTX_init(ctx);
EVP_EncryptInit_ex(ctx, EVP_aes_128_cbc(), NULL, key, iv);
EVP_CIPHER_CTX_set_padding(ctx, 0);
*bytes_written = 0;
if (input_length == 0)
{
EVP_CIPHER_CTX_free(ctx);
return;
}
if (verbose >= 5)
{
printbuf(iv, 16, "encrypting with this IV");
printbuf(key, 16, "encrypting with this key");
printbuf(input, input_length, "encrypting this data");
}
/*
* The default implementation adds a whole block of padding if the input
* data is perfectly aligned. We would like to keep that from happening.
* We have made a point to have our input perfectly padded.
*/
assert((input_length % IPMI_CRYPT_AES_CBC_128_BLOCK_SIZE) == 0);
if(!EVP_EncryptUpdate(ctx, output, (int *)bytes_written, input, input_length))
{
/* Error */
*bytes_written = 0;
EVP_CIPHER_CTX_free(ctx);
return;
}
else
{
uint32_t tmplen;
if(!EVP_EncryptFinal_ex(ctx, output + *bytes_written, (int *)&tmplen))
{
*bytes_written = 0;
EVP_CIPHER_CTX_free(ctx);
return; /* Error */
}
else
{
/* Success */
*bytes_written += tmplen;
EVP_CIPHER_CTX_cleanup(ctx);
}
}
}
/*
* lanplus_decrypt_aes_cbc_128
*
* Decrypt with the AES CBC 128 algorithm
*
* param iv is the 16 byte initialization vector
* param key is the 16 byte key used by the AES algorithm
* param input is the data to be decrypted
* param input_length is the number of bytes to be decrypted. This MUST
* be a multiple of the block size, 16.
* param output is the decrypted output
* param bytes_written is the number of bytes written. This param is set
* to 0 on failure, or if 0 bytes were input.
*/
void
lanplus_decrypt_aes_cbc_128(const uint8_t * iv,
const uint8_t * key,
const uint8_t * input,
uint32_t input_length,
uint8_t * output,
uint32_t * bytes_written)
{
EVP_CIPHER_CTX *ctx;
ctx = EVP_CIPHER_CTX_new();
EVP_CIPHER_CTX_init(ctx);
EVP_DecryptInit_ex(ctx, EVP_aes_128_cbc(), NULL, key, iv);
EVP_CIPHER_CTX_set_padding(ctx, 0);
if (verbose >= 5)
{
printbuf(iv, 16, "decrypting with this IV");
printbuf(key, 16, "decrypting with this key");
printbuf(input, input_length, "decrypting this data");
}
*bytes_written = 0;
if (input_length == 0)
{
EVP_CIPHER_CTX_free(ctx);
return;
}
/*
* The default implementation adds a whole block of padding if the input
* data is perfectly aligned. We would like to keep that from happening.
* We have made a point to have our input perfectly padded.
*/
assert((input_length % IPMI_CRYPT_AES_CBC_128_BLOCK_SIZE) == 0);
if (!EVP_DecryptUpdate(ctx, output, (int *)bytes_written, input, input_length))
{
/* Error */
lprintf(LOG_DEBUG, "ERROR: decrypt update failed");
*bytes_written = 0;
EVP_CIPHER_CTX_free(ctx);
return;
}
else
{
uint32_t tmplen;
if (!EVP_DecryptFinal_ex(ctx, output + *bytes_written, (int *)&tmplen))
{
char buffer[1000];
ERR_error_string(ERR_get_error(), buffer);
lprintf(LOG_DEBUG, "the ERR error %s", buffer);
lprintf(LOG_DEBUG, "ERROR: decrypt final failed");
*bytes_written = 0;
EVP_CIPHER_CTX_free(ctx);
return; /* Error */
}
else
{
/* Success */
*bytes_written += tmplen;
EVP_CIPHER_CTX_cleanup(ctx);
}
}
if (verbose >= 5)
{
lprintf(LOG_DEBUG, "Decrypted %d encrypted bytes", input_length);
printbuf(output, *bytes_written, "Decrypted this data");
}
}