How to install Pacman in Ubuntu

Source: Internet
Author: User

1, wget 'ftp: // ftp.archlinux.org/other/pacman/pacman-4.1.2.tar.gz' download package
2, tar xvf pacman-4.1.2.tar.gz, decompression software
3, cd pacman-4.1.2/, enter the code, execute./configure, prompt NO libarchive
4. Run sudo apt-get libarchive-dev to install libarchive.
5. Execute./configure again.
6. An error occurred while executing make.
-------------------------------------------------------------------------------
CC libalpm_la-be_sync.lo
Be_sync.c: In function '_ alpm_validate_filename ':
Be_sync.c: 499: error: 'path _ MAX 'undeclared (first use in this function)
Be_sync.c: 499: error: (Each undeclared identifier is reported only once
Be_sync.c: 499: error: for each function it appears in .)
Make [3]: *** [libalpm_la-be_sync.lo] Error 1
Make [2]: *** [all-recursive] Error 1
Make [1]: *** [all-recursive] Error 1
Make: *** [all] Error 2
--------------------------------------------------------------------------------
7, gedit lib/libalpm/be_sync.c, code file, find the code
-------------------------------------------------------------------------------
Static int _ alpm_validate_filename (alpm_db_t * db, const char * pkgname,
Const char * filename)
{
Size_t len = strlen (filename );
 
If (filename [0] = '.'){
Errno = EINVAL;
_ Alpm_log (db-> handle, ALPM_LOG_ERROR, _ ("% s database is inconsistent: filename"
"Of package % s is illegal \ n"), db-> treename, pkgname );
Return-1;
} Else if (memchr (filename, '/', len )! = NULL ){
Errno = EINVAL;
_ Alpm_log (db-> handle, ALPM_LOG_ERROR, _ ("% s database is inconsistent: filename"
"Of package % s is illegal \ n"), db-> treename, pkgname );
Return-1;
}
Else if (len> PATH_MAX ){
 
Errno = EINVAL;
_ Alpm_log (db-> handle, ALPM_LOG_ERROR, _ ("% s database is inconsistent: filename"
"Of package % s is too long \ n"), db-> treename, pkgname );
Return-1;
 
}
Return 0;
}
-------------------------------------------------------------------------------
Modify as follows:
-------------------------------------------------------------------------------
Static int _ alpm_validate_filename (alpm_db_t * db, const char * pkgname,
Const char * filename)
{
Size_t len = strlen (filename );
 
If (filename [0] = '.'){
Errno = EINVAL;
_ Alpm_log (db-> handle, ALPM_LOG_ERROR, _ ("% s database is inconsistent: filename"
"Of package % s is illegal \ n"), db-> treename, pkgname );
Return-1;
} Else if (memchr (filename, '/', len )! = NULL ){
Errno = EINVAL;
_ Alpm_log (db-> handle, ALPM_LOG_ERROR, _ ("% s database is inconsistent: filename"
"Of package % s is illegal \ n"), db-> treename, pkgname );
Return-1;
}
/*
Else if (len> PATH_MAX ){
 
Errno = EINVAL;
_ Alpm_log (db-> handle, ALPM_LOG_ERROR, _ ("% s database is inconsistent: filename"
"Of package % s is too long \ n"), db-> treename, pkgname );
Return-1;
 
}
*/
Return 0;
}
-------------------------------------------------------------------------------

Save and exit

7. Execute make & make install and wait until the installation is complete.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.